test_a_repo_without_nested_trees_is_not_split¶
Tests › tests/test_sub_index_split.py
What this test is for
Why it exists
THE COMPATIBILITY CASE, and the reason the return is a LIST rather than always at least one entry: a repository with nothing vendored must keep building exactly as it does today, to one index, with no new slug and no migration. An empty result says "do not split" without the caller needing to compare counts.
Given
repo = tmp_path / "plain"(repo / "src").mkdir(parents=True)(repo / "src" / "main.c").write_text("int main(void){return 0;}\n", encoding="utf-8")
When
derive_sub_indexes(repo)
Then
- ✓ derive_sub_indexes(repo) equals []
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) · 25 of 142 steps
… 12 steps between
… 93 later steps
4 more
- Build, refresh and check the index · 25 of 153 steps
- clew — `main` (clew/cli.py) · 20 of 400 steps
- Build this wiki from the index · 2 of 400 steps
- `main` (clew/guard/main.py) · 2 of 357 steps
tests/test_sub_index_split.py:49 · its file's page
What it checks (1)
assert derive_sub_indexes(repo) == [], ( "a repo with nothing vendored was split, which would give every existing target a new " "slug and strand its index" )observesderive_sub_indexes
Where the product reaches it
index→_index_action→build_or_refresh→_build_subject→_sub_index_rejection→_buildable_sub_indexes→derive_sub_indexes(flow)
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 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-INDEX-002 measured