test_contexts_are_read_from_coverage_s_own_data_file¶
Tests › tests/test_wiki_imports.py
What this test is for
Why it exists
FOUND ON CLEW'S OWN SUITE (round 4): the JSON report with per-test contexts was 3.9 GB for 3,176 tests — every line repeating every test that ran it. coverage.py's data file holds the same contexts compactly (SQLite), so `contexts:` also takes it, read through coverage's API.
Verifies REQ-DDB-WIKI-009
Given
data = CoverageData(basename=str(tmp_path / ".coverage"))data.set_context("tests/unit/test_c.py::test_cov|run")
5 more
data.add_lines({str(tmp_path / "src" / "a.c"): [11]})data.set_context("tests/unit/test_c.py::test_elsewhere|run")data.add_lines({str(tmp_path / "src" / "a.c"): [40]})data.write()inputs = EvidenceInputs(contexts=".coverage", infer_depth=0)
When
rows = { r.req_id: r for r in requirement_evidence(traced, junit=[], inputs=inputs, repo_root=tmp_path) }
Then
- ✓ rows["R-A"].measured_tests equals ("test_cov",)
What it exercises
The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.
Build this wiki from the index · 5 of 400 steps
… 133 earlier steps
… 204 steps between
… 50 later steps
tests/test_wiki_imports.py:549 · its file's page
What it checks (1)
assert rows["R-A"].measured_tests == ("test_cov",)observesrequirement_evidenceviarows
Where the product reaches it
No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.
Call flow
What it reaches
Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.
Requirements it verifies (1)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-WIKI-009 | catalog | unknown |
Also reaches 11 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-QUERY-001 measured
- REQ-DDB-QUERY-003 measured
- REQ-DDB-SCHEMA-006 measured
- REQ-DDB-WIKI-002 measured
- REQ-DDB-WIKI-010 measured
- REQ-DDB-WIKI-015 measured
- REQ-DDB-WIKI-016 measured
- REQ-DDB-WIKI-017 measured
- REQ-DDB-WIKI-041 measured
- REQ-DDB-WIKI-054 inferred