test_the_walk_runs_once_per_root_inside_the_cache¶
Tests › tests/test_nested_tree_cache.py
What this test is for
Why it exists
Four callers, one walk. The cache is keyed by RESOLVED root, so two callers naming the same tree differently still share the answer.
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
with scope.nested_tree_cache(): first = scope.nested_repo_roots(root) scope.nested_repo_roots(root) scope.nested_repo_roots(Path(str(root) + "/."))
Then
- ✓ len(calls) equals 1
- ✓ [p.name for p in first] equals ["dep"]
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:41 · its file's page
What it checks (2)
assert len(calls) == 1, f"the walk ran {len(calls)} times inside one build"not attributedassert [p.name for p in first] == ["dep"]observesnested_repo_rootsviafirst
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