test_the_summary_counts_requirements_tests_and_coverage¶
Tests › tests/test_wiki_cisummary.py
What this test is for
Why it exists
Each tier counted, tests by result, Cobertura's line and branch rates.
Given
cobertura = tmp_path / "coverage.xml"cobertura.write_text('<coverage line-rate="0.8421" branch-rate="0.61"><packages/></coverage>')
When
text = ci_summary( "Lib", [_ev("R1", "PASS"), _ev("R2", "PASS"), _ev("R3", "GAP"), _ev("R4", "MISSING", ())], { "t1": CaseResult("t1", "passed", 1), "t2": CaseResult("t2", "failed", 1), "t3": CaseResult("t3", "skipped", 1), }, cobertura, )
Then
- ✓ text.startswith("## Lib — clew evidence") holds
- ✓ text contains "**4** requirements · 3 implemented"
- ✓ text contains "| PASS | 2 |"
- ✓ text contains "| GAP | 1 |"
- ✓ text contains "| MISSING | 1 |"
- ✓ text contains "**3** tests: 1 passed, 1 failed, 1 skipped"
- ✓ text contains "line 84.2% · branch 61.0%"
tests/test_wiki_cisummary.py:23 · its file's page
What it checks (5)
assert text.startswith("## Lib — clew evidence")observesci_summaryviatextassert "**4** requirements · 3 implemented" in textobservesci_summaryviatextassert "| PASS | 2 |" in text and "| GAP | 1 |" in text and "| MISSING | 1 |" in textobservesci_summaryviatextassert "**3** tests: 1 passed, 1 failed, 1 skipped" in textobservesci_summaryviatextassert "line 84.2% · branch 61.0%" in textobservesci_summaryviatext
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.
Also reaches 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-WIKI-002 measured