test_a_submodule_whose_git_is_a_file_is_detected

Tests › tests/test_external_provenance.py

passed Passed in the packaged run.

What this test is for

Why it exists

THE CASE THE WHOLE FEATURE WAS BUILT FOR, and the one every other fixture in this file gets wrong. A `git submodule` checkout writes a 44-byte `gitdir: ../../.git/modules/<name>` POINTER FILE where a standalone clone has a `.git` DIRECTORY, and the detector tested `".git" in dirnames`.

Verifies REQ-DDB-PIPE-014

Given

  1. root = repo_with_submodules(tmp_path / "repo")
  2. make_gitlink(root, "extern/theirs", git_as_file=True)
→

When

  1. external_roots(root)
→

Then

  1. ✓ (root / "extern" / "theirs" / ".git").is_dir() is false
  2. ✓ external_roots(root) equals ["extern/theirs"]

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.

thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 6 of 142 steps

… 2 earlier steps

thread startthread startthread startthread startclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyother filesother filesother filesother filestry (line 1003)tryopt (line 845)optloop (line 1239)loopopt (line 847)optloop (line 746)loop_first_build_worker3. whole_repo_scope → _gitignored_paths3_gitignored_paths4. _gitignored_paths → git_argv4git_argv5. git_argv → _no_ext_diff5_no_ext_diff▶ test enters6. git_argv → list6list7. list → link7link8. _gitignored_paths → git_env8git_env9. whole_repo_scope → list9list10. whole_repo_scope → nested_repo_roots10nested_repo_roots11. nested_repo_roots → _nested_repos_under11_nested_repos_under▶ test enters12–14. _nested_repos_under → _warn_unwalkable12_warn_unwalkable +2 more15. nested_repo_roots → _nested_repos_under15_nested_repos_under16. whole_repo_scope → _gitignored_paths16_gitignored_paths

… 126 later steps

4 more

tests/test_external_provenance.py:401 · its file's page

What it checks (2)

  1. assert not (root / "extern" / "theirs" / ".git").is_dir(), ( "the fixture's whole point is that this `.git` is a FILE — if some helper turned it " "back into a directory the test would pass while covering the case that already worked" ) observes repo_with_submodules via root
  2. assert external_roots(root) == ["extern/theirs"], ( "a submodule's .git is a FILE; a detector that only looks for a directory " "is blind to every submodule while still reporting a plausible count" ) observes external_roots

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_a_submodule_whose_git_is_a_file_is_detected→repo_with_submodules→make_gitlink→external_roots

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_a_submodule_whose_git_is_a_file_is_detected · 2 checksexternal_rootsdependency_rootsREQ-DDB-CONFIG-001 · measuredexternal_rootsREQ-DDB-INDEX-005 · measured

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-PIPE-014catalogunknown
Also reaches 2 requirements

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