mjdi docsv0.10.0latest
Test inventory and coverage definitions (P0-07)
mjdi publishes one authoritative test inventory, generated from the
Source: mjdi/docs/test-inventory.md
mjdi publishes one authoritative test inventory, generated from the
runners themselves: tests/inventory.json
(machine-readable) and tests/INVENTORY.md
(human-readable), produced by scripts/test_inventory.py. Documentation
quotes those numbers; CI fails when the reports are stale
(--check) or when a current-version document quotes an unreconciled
figure (enforced by tests/python/test_inventory.py).
The 0.9.0 suite
| Category | Count | Execution |
|---|---|---|
Unit tests (tests/test_*.mojo) | 38 | mojo run -I . <file> — exit 0 and a PASS marker |
| Compile-fail tests | 23 | must FAIL to compile, with the pinned message fragment |
| Crash-expected tests | 3 | must abort with the pinned diagnostic |
| Strengthening checks | 2 | MJDI-A001 ID in the abort output; the P0-03 destructor-diagnostics golden output |
| Composition-root templates | 4 | self-testing apps under templates/ |
| Python tooling checks | 1 runner check (54 unittest cases across 4 modules) | python3 -m unittest discover |
| End-to-end example | 1 | examples/e2e_example.mojo |
| Golden example applications | 12 | output must match the pinned fragment |
| Suite check total | 84 | exactly what scripts/run_tests.sh counts |
The suite total is derived from the runner's own tables and globs — never hand-written — so the reports cannot drift from what actually executes.
Coverage categories (clearly distinguished)
mjdi reports four distinct kinds of "coverage" and never mixes them:
- Library API-surface coverage (
scripts/coverage_report.py, gate 95%) — every public library declaration appears in compiled, executed test code. 0.9.0: 509/509 = 100%. - Example API-surface coverage (
scripts/example_coverage.py, gate 95%) — every example declaration appears in the test suite. 0.9.0: 115/115 = 100%. - Test-case counts — the inventory table above (behavioral checks).
- Behavioral/branch coverage — not measurable on the supported
Mojo toolchain (no coverage instrumentation exists in the compiler or
mojo test). mjdi does not fake it: there is no line/branch percentage anywhere in the reports, and the inventory states the limitation explicitly.
Executed vs skipped vs unavailable
- Every inventory check is executed on the verified platform (linux-x86_64) in the release environment.
- On the ci-verified platforms the same inventory runs in CI; a job without a runner is reported skipped in CI — never as passing.
- mjdi has no skipped-by-design or expected-failure categories: the compile-fail and crash-expected tests are positive tests of failure behavior, executed to completion and counted.
- Benchmarks are measurements, not tests and are never counted in the suite total. The website build/lint and the metadata validator are release-gate tooling with their own CI jobs, also not part of the suite total.
The historical 54/55 reconciliation
The PRD quotes both 54 and 55 for the v0.7.0-era suite. Resolution: the
0.7.0 runner had 44 checks; its documents reported 54/54 (44 checks +
10 golden example runs, both 0.7.0 pages quote 54/54). The 55 figure
came from sources that counted the runner's then-new python-tooling phase
as an extra check while the prose still quoted the pre-phase number — two
hand-maintained counts disagreeing mid-cycle. Both are now replaced by the
derived inventory; archived snapshots keep their historical figures
untouched (P0-01), and current-version documents quote only
tests/INVENTORY.md.