test_outside_the_cache_every_call_walks¶
Tests › tests/test_nested_tree_cache.py
What this test is for
Why it exists
THE STALENESS GUARD, asserted rather than assumed. The cache must not outlive the build that opened it: `nested_repo_roots` answers filesystem state, and a submodule added while a long-lived server runs would otherwise serve a stale SCOPE — which decides what is indexed at all, so the cost of being wrong is not a slow build but a wrong one.
Given
root = _nested(tmp_path)calls: list[Path] = []
2 more
real = scope._nested_repos_undermonkeypatch.setattr(scope, "_nested_repos_under", lambda r: calls.append(r) or real(r))
When
scope.nested_repo_roots(root)scope.nested_repo_roots(root)
Then
- ✓ len(calls) equals 2
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
… 8 earlier steps
… 126 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:58 · its file's page
What it checks (1)
assert len(calls) == 2, "outside a build the walk must not be memoised"not attributed
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