test_branch_diff_range_builds_range_string

Tests › tests/guard/test_guard_git.py

passed Passed in the packaged run.

What this test is for

Why it exists

The test says nothing about why.

Given

  1. def mock_runner(cmd): if "rev-parse" in cmd: return "def456\n" return "abc123\n"
→

When

  1. result = get_branch_diff_range("origin/main", run_command=mock_runner)
→

Then

  1. ✓ result equals "abc123...HEAD"

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) · 7 of 357 steps

… 65 earlier steps

program launcherprogram launcherprogram launcherprogram launcherother filesother filesother filesother filesopt (line 1336)optalt (line 1344)altmain66–67. read_catalog_at → git_text66git_text +1 more68–69. git_argv → _no_ext_diff68_no_ext_diff +1 more70–71. read_catalog_at → _refuse_url70_refuse_url +1 more

… 157 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/checks.pyclew/guard/checks.pyclew/guard/checks.pyclew/guard/checks.pyother filesother filesother filesother filesopt (line 265)optmain229. validate_file → get_file_at_revision229get_file_at_revision230. get_file_at_revision → run_git230run_git231. run_git → git_argv231git_argv232. validate_file → parse_content_for_file232parse_content_for_file233. validate_file → check_version_staleness233check_version_staleness

… 14 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 filesopt (line 482)optmain248. run_precommit → get_requirements248get_requirements249. run_precommit → get_branch_diff_range249get_branch_diff_range250. get_branch_diff_range → get_merge_base250get_merge_base▶ test enters251. get_merge_base → run_git251run_git252–253. get_branch_diff_range → _rev_parse_head252_rev_parse_head +1 more254. run_precommit → impact_base254impact_base255. run_precommit → impact_report255impact_report

… 102 later steps

4 more

tests/guard/test_guard_git.py:180 · its file's page

What it checks (1)

  1. assert result == "abc123...HEAD" observes get_branch_diff_range via result

Where the product reaches it

  • main → _run → run_precommit → get_branch_diff_range (flow)

Call flow

test_branch_diff_range_builds_range_string→get_branch_diff_range

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_branch_diff_range_builds_range_string · 1 checksget_branch_diff_rangeget_merge_baserun_gitgit_argvREQ-DDB-CONFIG-001 · measuredget_branch_diff_rangeREQ-DDB-GUARD-023 · measured
Also reaches 2 requirements

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