test_each_requirement_names_the_owners_of_the_changed_files¶
Tests › tests/test_impact_reviewers.py
What this test is for
Why it exists
The union of both files' owners, in first-seen order.
Given
(tmp_path / ".github").mkdir()(tmp_path / ".github/CODEOWNERS").write_text("* @core\n/src/net/ @net-team\n")resolver = OwnerResolver.from_repo(tmp_path)
When
(entry,) = build_impact_report(_changed(), _CONFIG, owners=resolver)format_json([entry])format_markdown([entry])
Then
- ✓ entry.reviewers equals ["@net-team", "@core"]
- ✓ json.loads(format_json([entry]))["entries"][0]["reviewers"] equals ["@net-team", "@core"]
- ✓ format_markdown([entry]) contains "| Reviewers |"
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.
`main` (clew/guard/main.py) · 11 of 357 steps
… 54 earlier steps
… 211 steps between
… 1 step between
… 66 later steps
tests/test_impact_reviewers.py:36 · its file's page
What it checks (3)
assert entry.reviewers == ["@net-team", "@core"]not attributedassert json.loads(format_json([entry]))["entries"][0]["reviewers"] == ["@net-team", "@core"]observesformat_jsonassert "| Reviewers |" in format_markdown([entry])observesformat_markdown
Where the product reaches it
Call flow
test_each_requirement_names_the_owners_of_the_changed_files→build_impact_report→_changed→format_json→format_markdownWhat 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 5 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-GUARD-009 measured
- REQ-DDB-GUARD-010 measured
- REQ-DDB-GUARD-011 measured
- REQ-DDB-GUARD-016 inferred
- REQ-DDB-INDEX-007 measured