test_outside_the_cache_every_call_walks

Tests › tests/test_nested_tree_cache.py

passed Passed in the packaged run.

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

  1. root = _nested(tmp_path)
  2. calls: list[Path] = []
2 more
  1. real = scope._nested_repos_under
  2. monkeypatch.setattr(scope, "_nested_repos_under", lambda r: calls.append(r) or real(r))
→

When

  1. scope.nested_repo_roots(root)
  2. scope.nested_repo_roots(root)
→

Then

  1. ✓ 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

thread startthread startthread startthread startclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyother filesother filesother filesother filesopt (line 845)optloop (line 1239)loopopt (line 847)optloop (line 746)loop_first_build_worker9. whole_repo_scope → list9list10. whole_repo_scope → nested_repo_roots10nested_repo_roots11. nested_repo_roots → _nested_repos_under11_nested_repos_under▶ test enters12–14. _nested_repos_under → _warn_unwalkable12_warn_unwalkable +2 more15. nested_repo_roots → _nested_repos_under15_nested_repos_under16. whole_repo_scope → _gitignored_paths16_gitignored_paths

… 126 later steps

2 more

tests/test_nested_tree_cache.py:58 · its file's page

What it checks (1)

  1. assert len(calls) == 2, "outside a build the walk must not be memoised" not attributed

Where the product reaches it

  • build_wiki → _build_site → _all_flows → entry_point_flows → _scripts → console_scripts → _nested (flow)
  • index → _index_action → build_or_refresh → _build_subject → _sub_index_rejection → first_party_sub_index → nested_repo_roots (flow)

Call flow

test_outside_the_cache_every_call_walks→_nested→nested_repo_roots

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.

test_outside_the_cache_every_call_walks · 1 checksnested_repo_rootsREQ-DDB-CONFIG-001 · measured
Also reaches 1 requirement

Its run touches their code; that is reach, not proof.