Skip to content

Fix test core dump, add producer metadata, real-time dashboard plugin - #33

Merged
patricklbell merged 10 commits into
masterfrom
copilot/improve-testing-visibility
Mar 20, 2026
Merged

patricklbell merged 10 commits into
masterfrom
copilot/improve-testing-visibility

Conversation

Copilot AI commented Mar 16, 2026 •

Copy link
Copy Markdown

CI crashes with SIGABRT because SKIP() and FAIL() require exceptions but the project builds with -fno-exceptions. Also addresses several infrastructure requests: producer metadata, function-oriented plugins, real-time dashboard, and file rename.

Test recovery (-fno-exceptions fix)

  • Replace SKIP() with if constexpr (!enabled) { return; } — no exception needed
  • Replace FAIL() in assert handler with FAIL_CHECK() (non-throwing) + longjmp recovery
  • Add PLEXDB_TEST_SCOPE() macro for opt-in graceful exit on assertion failure
  • Catch2 listener resets recovery state between test cases
  • Enable -DPLEXDB_LOG_ENABLED=ON -DPLEXDB_DEBUG=ON in test.yml
// Before: terminates process
FAIL("Assert failed ...");

// After: records failure, longjmps back to PLEXDB_TEST_SCOPE if active
FAIL_CHECK("Assert failed ...");

Producer metadata

  • New PLEXDB_LOG_PRODUCER_META = 5 event type in log_abi.h
  • PlexdbLogProducerMeta { producer_id, key, value } for key-value metadata on producers
  • fire_producer_meta() added to C++ module, handled in all consumers/plugins

Plugin refactor (functions over OOP)

  • log_stat_plugin.cpp, log_file_plugin.cpp: classes with methods → plain structs with free functions
  • log_consumer.test.cpp → log_consumer_helper.test.cpp (both plexdb and objstore), also refactored

Real-time dashboard plugin

  • New objstore/plugins/log_dashboard/log_dashboard_plugin.cpp — ANSI terminal dashboard via LD_PRELOAD
  • Renders live producer/stat/metadata updates, throttled by PLEXDB_DASHBOARD_INTERVAL_MS
  • plot_stats.py updated with --live mode and D tag for producer metadata
  • Stat plugin format extended with D <producer_id>\t<key>\t<value> lines
Original prompt

This section details on the original issue you should resolve

<issue_title>Improve Testing Visibility</issue_title>
<issue_description>- Allow tests to fail an assert but move to the next test case or section

  • Ensure parsing errors are correctly visible as UNSCOPED_INFO
  • Add a basic zero-overhead logging system with log levels and consumers using the existing plexdb plugin infrastructure. The logs should be structured where possible and also allow realtime monitoring of statstics (without the overhead of string formatting) for realtime metrics.
  • Route all logs to be visible after test failure.</issue_description>

<agent_instructions>Make the minimal possible changes, focusing on keeping the current style and quality. Ensure things are highly visibile and obvious. Update the agent instructions to ensure agents can debug the causes of test failures, ideally by enabling the agent to configure plugins for filtering. this may require introducing configuration files, but where possible, use the plugin infrastructure.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Improve testing visibility for better debug information Add log levels, structured stats, and route logs to Catch2 on test failure Mar 16, 2026
Copilot AI requested a review from patricklbell March 16, 2026 09:02
Copilot AI changed the title Add log levels, structured stats, and route logs to Catch2 on test failure Improve testing visibility: assert semantics, log levels, stat metadata, stat graphing Mar 16, 2026
Copilot stopped work on behalf of patricklbell due to an error March 19, 2026 09:36
Copilot AI changed the title Improve testing visibility: assert semantics, log levels, stat metadata, stat graphing Fix test core dump, add producer metadata, real-time dashboard plugin Mar 19, 2026
Copilot AI and others added 8 commits March 20, 2026 00:08
…g consumer

- Add PlexdbLogLevel enum (TRACE/DEBUG/INFO/WARN/ERROR) and PLEXDB_LOG_STAT event to log_abi.h
- Update plexdb::log module with Level enum, level-aware fire_message, fire_stat
- Update objstore log to use appropriate log levels (Debug for parse, Error for errors)
- Change FAIL to FAIL_CHECK in assert helpers so tests continue after failures
- Add Catch2 log consumer helpers that route all logs to UNSCOPED_INFO
- Update log_file plugin to handle log levels and stat events
- Add tests for log levels and fire_stat

Co-authored-by: patricklbell <46551885+patricklbell@users.noreply.github.com>
…rder docs

Co-authored-by: patricklbell <46551885+patricklbell@users.noreply.github.com>
…graphing script

- Revert FAIL_CHECK back to FAIL in assert handlers so assertions stop the
  test case (preventing continued execution with corrupted state)
- Remove noexcept from assert_true/assert_true_always so the assert handler
  can interact with the test framework (noexcept was incompatible with Catch2 FAIL)
- Add PLEXDB_LOG_STAT_META event type to log ABI for stat metadata (maps
  producer_id + stat_id to a human-readable name)
- Add fire_stat_meta() to plexdb::log module
- Create log_stat plugin that writes stat events to a parseable text file
- Create extra/plot_stats.py script to graph stat data using matplotlib
- Update log_file plugin and test log consumers to handle stat metadata
- Add tests for fire_stat_meta
- Update AGENTS.md and test instructions with stat metadata documentation

Co-authored-by: patricklbell <46551885+patricklbell@users.noreply.github.com>
…he__

Co-authored-by: patricklbell <46551885+patricklbell@users.noreply.github.com>
…ons, add real-time dashboard plugin

- Fix SKIP() crash: replace with compile-time return (SKIP requires exceptions)
- Fix FAIL() crash: use FAIL_CHECK + longjmp recovery + Catch2 listener
- Add PLEXDB_TEST_SCOPE macro for graceful test recovery from assertions
- Enable PLEXDB_LOG_ENABLED and PLEXDB_DEBUG in CI test.yml
- Rename log_consumer.test.cpp to log_consumer_helper.test.cpp
- Add PLEXDB_LOG_PRODUCER_META event type to log ABI
- Add fire_producer_meta() to C++ log module
- Refactor log_stat, log_file plugins to use functions instead of OOP
- Create real-time terminal dashboard plugin (log_dashboard)
- Update plot_stats.py with --live mode and producer metadata support
- Add test for fire_producer_meta

Co-authored-by: patricklbell <46551885+patricklbell@users.noreply.github.com>
Co-authored-by: patricklbell <46551885+patricklbell@users.noreply.github.com>
@patricklbell
patricklbell force-pushed the copilot/improve-testing-visibility branch from b02f9c5 to b078e6a Compare March 19, 2026 13:11
@patricklbell
patricklbell marked this pull request as ready for review March 19, 2026 13:16
@patricklbell
patricklbell merged commit 8bdc8b2 into master Mar 20, 2026
3 checks passed
@patricklbell
patricklbell deleted the copilot/improve-testing-visibility branch March 20, 2026 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Testing Visibility

2 participants