mjdi

Search documentation

Search the mjdi v0.10.0 documentation

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

CategoryCountExecution
Unit tests (tests/test_*.mojo)38mojo run -I . <file> — exit 0 and a PASS marker
Compile-fail tests23must FAIL to compile, with the pinned message fragment
Crash-expected tests3must abort with the pinned diagnostic
Strengthening checks2MJDI-A001 ID in the abort output; the P0-03 destructor-diagnostics golden output
Composition-root templates4self-testing apps under templates/
Python tooling checks1 runner check (54 unittest cases across 4 modules)python3 -m unittest discover
End-to-end example1examples/e2e_example.mojo
Golden example applications12output must match the pinned fragment
Suite check total84exactly 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:

  1. 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%.
  2. Example API-surface coverage (scripts/example_coverage.py, gate 95%) — every example declaration appears in the test suite. 0.9.0: 115/115 = 100%.
  3. Test-case counts — the inventory table above (behavioral checks).
  4. 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.