test_removed_file_drops_its_rows¶
Tests › tests/integration/test_indexcache_integration.py
What this test is for
Why it exists
The cache assertion matches on a path SUFFIX rather than an exact string: `source_files` is keyed by whatever spelling the scan and the harvest driver used, and a synthesized Doxyfile makes doxygen report absolute names. Asking "no key names this file, in any spelling" is both stronger and immune to that.
Given
cache = tmp_path / "shared.idxcache"_build(guard_repo, tmp_path / "cold.db", cache=cache)
5 more
(guard_repo / DELETE_TARGET).unlink()warm = _build(guard_repo, tmp_path / "warm.db", cache=cache)conn = sqlite3.connect(str(warm))names = {r[0] for r in conn.execute("SELECT name FROM memberdef WHERE kind = 'function'")}conn.close()
When
- —
Then
- ✓ any(path.endswith(DELETE_TARGET) for path in _cached_paths(cache)) holds
- ✓ names does not contain DELETE_TARGET_FUNCTION
- ✓ any(path.endswith(DELETE_TARGET) for path in _cached_paths(cache)) is false
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) · 35 of 400 steps
… 10 earlier steps
… 26 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) · 27 of 142 steps
- Build, refresh and check the index · 21 of 153 steps
- `main` (clew/guard/main.py) · 12 of 357 steps
- Build this wiki from the index · 8 of 400 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_indexcache_integration.py:477 · its file's page
What it checks (3)
assert any(path.endswith(DELETE_TARGET) for path in _cached_paths(cache))observes_cached_pathsassert DELETE_TARGET_FUNCTION not in namesnot attributedassert not any(path.endswith(DELETE_TARGET) for path in _cached_paths(cache))observes_cached_paths
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
test_removed_file_drops_its_rows→_build→_cached_pathsWhat 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.
and 42 more requirement paths, listed below.
Also reaches 55 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CLI-001 measured
- REQ-DDB-CLI-002 inferred
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-CONFIG-003 inferred
- 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 inferred
- REQ-DDB-GUARD-019 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
- REQ-DDB-WIKI-054 inferred