test_no_owners_file_leaves_reviewers_out_rather_than_empty

Tests › tests/test_impact_reviewers.py

passed Passed in the packaged run.

What this test is for

Why it exists

No CODEOWNERS or MAINTAINERS: no key, no column.

Given

  1. resolver = OwnerResolver.from_repo(tmp_path)
→

When

  1. (entry,) = build_impact_report(_changed(), _CONFIG, owners=resolver)
  2. format_json([entry])
  3. format_markdown([entry])
→

Then

  1. ✓ entry.reviewers is None
  2. ✓ json.loads(format_json([entry]))["entries"][0] does not contain "reviewers"
  3. ✓ format_markdown([entry]) does not contain "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

program launcherprogram launcherprogram launcherprogram launcherclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pymain55. _validate_files → load_requirements_full55load_requirements_full56. load_requirements_full → _get_requirements_config56_get_requirements_config57. _get_requirements_config → get_requirements57get_requirements58. _get_requirements_config → resolve_contained_path58resolve_contained_path59. load_requirements_full → _validate_requirements59_validate_requirements

… 211 steps between

program launcherprogram launcherprogram launcherprogram launcherclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pyother filesother filesother filesother filesloop (line 583)loopopt (line 587)optopt (line 482)optmain271. find_index → registered_index271registered_index272. impact_report → build_report272build_report273. build_report → load_requirements273load_requirements▶ test enters274. load_requirements → _get_requirements_config274_get_requirements_config275. load_requirements → load_requirements_full275load_requirements_full276. build_report → _place_untagged276_place_untagged277. build_report → _reviewers277_reviewers278. run_precommit → _write_report278_write_report279. _write_report → validate_output_path279validate_output_path

… 1 step between

program launcherprogram launcherprogram launcherprogram launcherclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pyother filesother filesother filesother filesopt (line 673)optloop (line 684)loopopt (line 482)optloop ×5 (line 699)loop ×5main281. _write_report → format_markdown281format_markdown282. format_markdown → _unmapped_markdown282_unmapped_markdown283. format_markdown → _markdown_row283_markdown_row▶ test enters284–288. _markdown_row → _cell284_cell ×5289. format_markdown → _unmapped_markdown289_unmapped_markdown290. _write_report → format_json290format_json291. run_precommit → git_add291git_add

… 66 later steps

tests/test_impact_reviewers.py:48 · its file's page

What it checks (3)

  1. assert entry.reviewers is None not attributed
  2. assert "reviewers" not in json.loads(format_json([entry]))["entries"][0] observes format_json
  3. assert "Reviewers" not in format_markdown([entry]) observes format_markdown

Where the product reaches it

  • main → _run → run_precommit → _write_report → format_json (flow)
  • main → _run → run_precommit → format_markdown (flow)

Call flow

test_no_owners_file_leaves_reviewers_out_rather_than_empty→build_impact_report→_changed→format_json→format_markdown

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_no_owners_file_leaves_reviewers_out_rather_than_empty · 3 checksbuild_impact_reportbuild_reportload_requirementsREQ-DDB-GUARD-009 · measuredbuild_impact_reportREQ-DDB-GUARD-010 · measuredbuild_impact_reportbuild_reportload_requirements_get_requirements_configREQ-DDB-GUARD-011 · measuredbuild_impact_report… 3 calls …resolve_contained_pathREQ-DDB-GUARD-016 · inferred
Also reaches 5 requirements

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