test_the_cache_sees_a_tree_added_between_builds

Tests › tests/test_nested_tree_cache.py

passed Passed in the packaged run.

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

  1. root = _nested(tmp_path)
→

When

  1. with scope.nested_tree_cache(): before = scope.nested_repo_roots(root)
  2. (root / "vendor" / "extra" / ".git").mkdir(parents=True)
  3. with scope.nested_tree_cache(): after = scope.nested_repo_roots(root)
→

Then

  1. ✓ {p.name for p in before} equals {"dep"}
  2. ✓ {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

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:75 · its file's page

What it checks (2)

  1. assert {p.name for p in before} == {"dep"} observes nested_repo_roots via before
  2. assert {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" ) observes nested_repo_roots via after

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

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