test_ignored_nested_trees_are_not_sub_indexes¶
Tests › tests/test_sub_index_split.py
What this test is for
Why it exists
FOUND BY DRIVING THE PRODUCT, NOT BY A FIXTURE. Every test above passed while the derivation happily split out CMake FetchContent output — `build/_deps/catch2-src`, `build/_deps/httplib-src` and six more — because each is a real git clone and `nested_repo_roots` walks the whole tree. A real build spent twenty minutes indexing throwaway artefacts before it was stopped.
Given
repo = tmp_path / "withbuild"(repo / "app").mkdir(parents=True)
6 more
(repo / "app" / "main.c").write_text("int main(void){return 0;}\n", encoding="utf-8")(repo / ".gitignore").write_text("build/\n", encoding="utf-8")subprocess.run(["git", "init", "-q"], cwd=repo, check=True)subprocess.run(["git", "add", "-A"], cwd=repo, check=True)vendored = _nested(repo / "extern" / "dep", as_pointer=True)_nested(repo / "build" / "_deps" / "catch2-src", as_pointer=False)
When
names = {s.name for s in derive_sub_indexes(repo)}
Then
- ✓ names contains "extern-dep"
- ✓ any("catch2" in n or n.startswith("build") for n in names) is false
- ✓ vendored.exists() holds
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) · 37 of 142 steps
… 7 steps between
… 85 later steps
4 more
- Build, refresh and check the index · 37 of 153 steps
- clew — `main` (clew/cli.py) · 22 of 400 steps
- Build this wiki from the index · 2 of 400 steps
- `main` (clew/guard/main.py) · 2 of 357 steps
tests/test_sub_index_split.py:135 · its file's page
What it checks (3)
assert "extern-dep" in names, "the real vendored dependency was dropped from the split"observesderive_sub_indexesvianamesassert not any("catch2" in n or n.startswith("build") for n in names), ( f"an ignored build artefact became a sub-index: {sorted(names)} — the split must use the " "same rule the build uses, or it indexes trees the build would never touch" )observesderive_sub_indexesvianamesassert vendored.exists()observes_nestedviavendored
Where the product reaches it
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.
Also reaches 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-INDEX-002 measured