test_ctrf_results_fold_like_every_other_format

Tests › tests/test_wiki_test_imports.py

passed Passed in the packaged run.

What this test is for

Why it exists

CTRF: statuses mapped, parameters dropped, worst case wins.

Verifies REQ-DDB-WIKI-030

Given

  1. report = tmp_path / "ctrf.json"
  2. report.write_text( json.dumps( { "results": { "tool": {"name": "pytest"}, "tests": [ {"name": "test_a", "status": "passed"}, {"name": "test_b[1]", "status": "passed"}, {"name": "test_b[2]", "status": "failed", "message": "boom"}, {"name": "test_c", "status": "pending"}, {"name": "test_d", "status": "other"}, ], } } ) )
→

When

  1. found = parse_results("ctrf", report)
→

Then

  1. ✓ RESULT_FORMATS contains "ctrf"
  2. ✓ {n: r.status for n, r in found.items()} equals { "test_a": "passed", "test_b": "failed", "test_c": "skipped", "test_d": "error", }
  3. ✓ found["test_b"].cases equals 2

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 · 2 of 400 steps

… 131 earlier steps

callercallercallercallerother filesother filesother filesother filesopt (line 200)optloop (line 259)loopelif (line 264)elifopt (line 202)optbuild_wiki132–133. parse_contexts → _contexts_from_lcov132_contexts_from_lcov +1 more134. _text → check_report_size134check_report_size▶ test enters135. _contexts_from_lcov → _relative135_relative136. parse_contexts → _contexts_from_data_file136_contexts_from_data_file

… 209 steps between

callercallercallercallerclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyother filesother filesother filesother filesbuild_wiki346. _build_site → parse_junit346parse_junit347. parse_junit → fold_cases347fold_cases348. fold_cases → _folded348_folded▶ test enters349–350. parse_junit → _case_name349_case_name +1 more

… 50 later steps

tests/test_wiki_test_imports.py:25 · its file's page

What it checks (3)

  1. assert "ctrf" in RESULT_FORMATS not attributed
  2. assert {n: r.status for n, r in found.items()} == { "test_a": "passed", "test_b": "failed", "test_c": "skipped", "test_d": "error", } observes parse_results via found
  3. assert found["test_b"].cases == 2 observes parse_results via found

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

test_ctrf_results_fold_like_every_other_format→parse_results

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.

test_ctrf_results_fold_like_every_other_format · 3 checksparse_resultsREQ-DDB-WIKI-010 · measured

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-WIKI-030catalogunknown
Also reaches 1 requirement

Its run touches their code; that is reach, not proof.