Test Runner — oc_diagnostics
=============================
Purpose
-------
Execute the full ``oc_diagnostics`` test suite from the command line by
importing and running all individual per-module test files via a lightweight
PASS/FAIL/SKIP reporting infrastructure.
Responsibilities
----------------
- Import test functions from each per-module test file and run them via the
internal ``_run()`` wrapper, which catches ``AssertionError`` and
unexpected exceptions and records PASS / FAIL / SKIP accordingly.
- Handle Dash-optional test modules cleanly: attempt import and skip with a
clear message when Dash is absent.
- Invoke ``instrumentation_selftest_cli`` as a subprocess when Dash is
available; treat a non-zero exit code as a test failure.
- Collect PASS/SKIP/FAIL per test, print a structured summary, and exit
with code ``0`` on full success or ``1`` on any failure.
Diagnostics
-----------
Domain: TEST
Levels:
L2 — lifecycle
L3 — semantic details
L4 — deep tracing
Contracts
---------
- Must exit ``0`` only when all non-skipped tests pass.
- Must exit ``1`` when any test fails or raises an unexpected exception.
- Core tests must run without Dash, FastAPI, or any optional dependency.
- Must not start a Dash server or produce interactive UI.
- Must not modify global oc_diagnostics state permanently; any state
changes made during tests must be restored before the test exits.
Modules covered by this test suite
-----------------------------------
- unified_debug
- logging_handler
- fastapi_middleware
- id_instrumentation
- instrumentation_middleware
- ui_event_logger
- instrumentation_selftest_cli
- instrumentation_selftest_app