test_the_walk_runs_once_per_root_inside_the_cache

Tests › tests/test_nested_tree_cache.py

passed Passed in the packaged run.

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

  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. with scope.nested_tree_cache(): first = scope.nested_repo_roots(root) scope.nested_repo_roots(root) scope.nested_repo_roots(Path(str(root) + "/."))
→

Then

  1. ✓ len(calls) equals 1
  2. ✓ [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

thread startthread startthread startthread startclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyloop (line 1239)loopopt (line 847)optloop (line 746)loop_first_build_worker10–11. whole_repo_scope → nested_repo_roots10nested_repo_roots +1 more12–14. _nested_repos_under → _warn_unwalkable12_warn_unwalkable +2 more15. nested_repo_roots → _nested_repos_under15_nested_repos_under▶ test enters16–17. whole_repo_scope → _gitignored_paths16_gitignored_paths +1 more

… 125 later steps

2 more

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

What it checks (2)

  1. assert len(calls) == 1, f"the walk ran {len(calls)} times inside one build" not attributed
  2. assert [p.name for p in first] == ["dep"] observes nested_repo_roots via first

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_the_walk_runs_once_per_root_inside_the_cache→_nested→nested_tree_cache→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_the_walk_runs_once_per_root_inside_the_cache · 2 checksnested_repo_rootsREQ-DDB-CONFIG-001 · measured
Also reaches 1 requirement

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