test_an_incremental_refresh_equals_a_full_rebuild¶
Tests › tests/integration/test_incremental_pipeline.py
What this test is for
Why it exists
THE WIRING IS THE SUBJECT. Every call goes through `build_index`, so removing any step from `_incremental_plan` or `_incremental_doxygen` changes this test's answer.
Given
root = tmp_path / "repo"_seed(root)incremental = tmp_path / "incremental.db"
When
with captured_output(): build_index(output=incremental, repo_root=root, doxyfile=root / "Doxyfile")_edit(root)with captured_output(): build_index(output=incremental, repo_root=root, doxyfile=root / "Doxyfile")
6 more
sidecar = sqlite3.connect(str(incremental) + ".idxcache")try: row = sidecar.execute( "SELECT value FROM cache_meta WHERE key = 'splice_generation'" ).fetchone() finally: sidecar.close()full = tmp_path / "full.db"with captured_output(): build_index(output=full, repo_root=root, doxyfile=root / "Doxyfile")got, want = _snapshot(incremental), _snapshot(full)for layer in ("members", "edges", "indexed", "reimplements", "params"): missing = want[layer] - got[layer] extra = got[layer] - want[layer] assert not missing and not extra, ( f"{layer}: the incrementally refreshed index disagrees with a full rebuild.\n" f" missing from incremental ({len(missing)}): {sorted(missing)[:8]}\n" f" only in incremental ({len(extra)}): {sorted(extra)[:8]}" )
Then
- ✓ row is not None
- ✓ int(row[0]) is greater than 0
- ✓ ("pipeline_probe", "sound_play_findme", "doxygen_sqlite") in want["edges"] or any( a == "pipeline_probe" and b == "sound_play_findme" for a, b, _ in want["edges"] ) holds
- ✓ any("vendor" in f for f in want["indexed"]) is false
- ✓ any("Extra" in a or "Extra" in b for a, b in want["reimplements"]) holds
- ✓ want["params"] 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.
clew — `main` (clew/cli.py) · 34 of 400 steps
… 10 earlier steps
… 2 steps between
… 3 steps between
… 5 steps between
… 7 steps between
… 23 steps between
… 57 steps between
… 27 steps between
… 190 later steps
6 more
- thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 26 of 142 steps
- `main` (clew/guard/main.py) · 25 of 357 steps
- Build this wiki from the index · 17 of 400 steps
- Build, refresh and check the index · 5 of 153 steps
- clew-mcp — `main` (clew/mcp_server/server.py) · 1 of 17 steps
- `main` (scripts/incremental_probe.py) · 1 of 3 steps
tests/integration/test_incremental_pipeline.py:181 · its file's page
What it checks (6)
assert row is not None and int(row[0]) > 0, ( f"the second build did NOT take the incremental branch (splice_generation={row}), so " f"this test compares two full rebuilds and proves nothing about the splice" )not attributedassert ("pipeline_probe", "sound_play_findme", "doxygen_sqlite") in want["edges"] or any( a == "pipeline_probe" and b == "sound_play_findme" for a, b, _ in want["edges"] ), "the rebuild has no pipeline_probe -> sound_play_findme edge; the second pass is untested"not attributedassert not any("vendor" in f for f in want["indexed"]), ( "the rebuild indexed the excluded vendor/ tree, so EXCLUDE_PATTERNS is not in force " "and the scope filter is untested here" )not attributedassert any("Extra" in a or "Extra" in b for a, b in want["reimplements"]), ( "the rebuild has no Extra override, so the inheritance tables are untested here" )not attributedassert want["params"], ( "the rebuild produced no memberdef_param rows, so comparing that table is vacuous" )not attributedassert not missing and not extra, ( f"{layer}: the incrementally refreshed index disagrees with a full rebuild.\n" f" missing from incremental ({len(missing)}): {sorted(missing)[:8]}\n" f" only in incremental ({len(extra)}): {sorted(extra)[:8]}" )not attributed
Where the product reaches it
No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.
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 52 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CLI-001 measured
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-CONFIG-003 measured
- REQ-DDB-CONFIG-004 measured
- REQ-DDB-CONFIG-005 measured
- REQ-DDB-CONFIG-006 measured
- REQ-DDB-CONFIG-007 measured
- REQ-DDB-CONFIG-009 measured
- REQ-DDB-GUARD-012 measured
- REQ-DDB-GUARD-024 measured
- REQ-DDB-INDEX-001 measured
- REQ-DDB-INDEX-002 measured
- REQ-DDB-INDEX-003 measured
- REQ-DDB-INDEX-004 measured
- REQ-DDB-INDEX-005 measured
- REQ-DDB-INDEX-006 measured
- REQ-DDB-INDEX-007 measured
- REQ-DDB-INDEX-008 measured
- REQ-DDB-INDEX-009 measured
- REQ-DDB-INDEX-010 measured
- REQ-DDB-INDEX-011 measured
- REQ-DDB-MCP-001 measured
- REQ-DDB-MCP-004 measured
- REQ-DDB-PIPE-001 measured
- REQ-DDB-PIPE-003 measured
- REQ-DDB-PIPE-004 measured
- REQ-DDB-PIPE-005 measured
- REQ-DDB-PIPE-006 measured
- REQ-DDB-PIPE-007 measured
- REQ-DDB-PIPE-008 measured
- REQ-DDB-PIPE-009 measured
- REQ-DDB-PIPE-010 measured
- REQ-DDB-PIPE-011 measured
- REQ-DDB-PIPE-012 measured
- REQ-DDB-PIPE-013 measured
- REQ-DDB-PIPE-014 measured
- REQ-DDB-PIPE-015 measured
- REQ-DDB-QUERY-003 measured
- REQ-DDB-QUERY-011 measured
- REQ-DDB-SCHEMA-001 measured
- REQ-DDB-SCHEMA-002 measured
- REQ-DDB-SCHEMA-003 measured
- REQ-DDB-SCHEMA-004 measured
- REQ-DDB-SCHEMA-005 measured
- REQ-DDB-SCHEMA-006 measured
- REQ-DDB-SCHEMA-007 measured
- REQ-DDB-SCHEMA-009 measured
- REQ-DDB-SCHEMA-011 measured
- REQ-DDB-SCHEMA-012 measured
- REQ-DDB-SCHEMA-013 measured
- REQ-DDB-SCHEMA-014 measured
- REQ-DDB-SCHEMA-015 measured