test_a_submodule_whose_git_is_a_file_is_detected¶
Tests › tests/test_external_provenance.py
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
root = repo_with_submodules(tmp_path / "repo")make_gitlink(root, "extern/theirs", git_as_file=True)
When
external_roots(root)
Then
- ✓ (root / "extern" / "theirs" / ".git").is_dir() is false
- ✓ 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
… 126 later steps
4 more
- Build, refresh and check the index · 6 of 153 steps
- clew — `main` (clew/cli.py) · 6 of 400 steps
- Build this wiki from the index · 2 of 400 steps
- `main` (clew/guard/main.py) · 2 of 357 steps
tests/test_external_provenance.py:401 · its file's page
What it checks (2)
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" )observesrepo_with_submodulesviarootassert 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" )observesexternal_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
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.
Requirements it verifies (1)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-PIPE-014 | catalog | unknown |
Also reaches 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-INDEX-005 measured