test_submodules_and_clones_both_become_sub_indexes¶
Tests › tests/test_sub_index_split.py
What this test is for
Why it exists
THE POINTER-FILE HALF IS THE ONE THAT MATTERS. A submodule's `.git` is a FILE, and a fixture built only from directories would pass against a detector blind to exactly the case this feature exists for.
Given
repo = tmp_path / "vendored"(repo / "app").mkdir(parents=True)
3 more
(repo / "app" / "main.c").write_text("int main(void){return 0;}\n", encoding="utf-8")clone = _nested(repo / "extern" / "cloned", as_pointer=False)submodule = _nested(repo / "deps" / "submoduled", as_pointer=True)
When
split = derive_sub_indexes(repo)by_name = {s.name: s for s in split}first = by_name[FIRST_PARTY_INDEX]
2 more
vendored = [s for s in split if s.name != FIRST_PARTY_INDEX]all(s.excludes == () for s in vendored)
Then
- ✓ by_name contains FIRST_PARTY_INDEX
- ✓ len(split) equals 3
- ✓ set(first.excludes) equals {clone.resolve(), submodule.resolve()}
- ✓ first.roots equals (repo.resolve(),)
- ✓ {s.roots[0] for s in vendored} equals {clone.resolve(), submodule.resolve()}
- ✓ all(s.excludes == () for s in vendored) holds
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) · 37 of 142 steps
… 7 steps between
… 85 later steps
4 more
- Build, refresh and check the index · 37 of 153 steps
- clew — `main` (clew/cli.py) · 22 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:70 · its file's page
What it checks (6)
assert FIRST_PARTY_INDEX in by_name, f"no first-party sub-index in {sorted(by_name)}"not attributedassert len(split) == 3, f"expected first-party plus two trees, got {sorted(by_name)}"observesderive_sub_indexesviasplitassert set(first.excludes) == {clone.resolve(), submodule.resolve()}, ( f"first-party does not exclude both nested trees: {first.excludes}" )observes_nestedviacloneassert first.roots == (repo.resolve(),)not attributedassert {s.roots[0] for s in vendored} == {clone.resolve(), submodule.resolve()}observes_nestedviacloneassert all(s.excludes == () for s in vendored)observesall
Where the product reaches it
build_wiki→_build_site→_all_flows→entry_point_flows→_scripts→console_scripts→_nested(flow)dossier→_rank_enum_over_mirror→_class_side_is_only_enum_mirrors→all(flow)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 3 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-INDEX-002 measured
- REQ-DDB-WIKI-054 inferred