test_the_cache_sees_a_tree_added_between_builds¶
Tests › tests/test_nested_tree_cache.py
What this test is for
Why it exists
The behavioural form of the guard above: two builds, a nested tree appearing between them, and the second build must see it. A process-lifetime cache passes the call-count test and fails this one.
Given
root = _nested(tmp_path)
When
with scope.nested_tree_cache(): before = scope.nested_repo_roots(root)(root / "vendor" / "extra" / ".git").mkdir(parents=True)with scope.nested_tree_cache(): after = scope.nested_repo_roots(root)
Then
- ✓ {p.name for p in before} equals {"dep"}
- ✓ {p.name for p in after} equals {"dep", "extra"}
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) · 4 of 142 steps
… 9 earlier steps
… 125 later steps
2 more
- Build, refresh and check the index · 4 of 153 steps
- clew — `main` (clew/cli.py) · 4 of 400 steps
tests/test_nested_tree_cache.py:75 · its file's page
What it checks (2)
assert {p.name for p in before} == {"dep"}observesnested_repo_rootsviabeforeassert {p.name for p in after} == {"dep", "extra"}, ( "the second build did not see a tree added after the first — the cache outlived its build" )observesnested_repo_rootsviaafter
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 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured