test_an_unresolved_include_is_neither_first_party_nor_external¶
Tests › tests/test_external_provenance.py
What this test is for
Why it exists
THE DEFECT THAT MADE THE INVARIANCE ABOVE FALSE, and it was found on the real target rather than here. Doxygen registers a `path` row for every `#include` it cannot resolve, spelled as a BARE FILENAME with no directory. A bare filename matches no external root, so every one of them counted as first party.
Verifies REQ-DDB-PIPE-014
Given
db_path, root = _indexed(tmp_path, _ours())conn = sqlite3.connect(str(db_path))try: ## Exactly what doxygen writes for an unresolvable include: a name with no ## directory and no file behind it. conn.execute("INSERT INTO path (type, name) VALUES (1, 'aclnn_add.h')") conn.commit() finally: conn.close()
When
stamp_external_provenance(db_path, root)coverage = measure_index_coverage(db_path, root)stats = q.graph_stats(db_path)
Then
- ✓ coverage.indexed_files equals 25
- ✓ coverage.external_files equals 0
- ✓ coverage.unresolved_files equals 1
- ✓ stats.files.indexed_files equals 25
- ✓ stats.files.unresolved_files equals 1
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) · 6 of 400 steps
… 50 earlier steps
… 157 steps between
… 175 later steps
4 more
- thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 4 of 142 steps
- Build, refresh and check the index · 4 of 153 steps
- Look up one name: everything the index holds about it · 2 of 226 steps
- `main` (scripts/export_parity.py) · 2 of 203 steps
tests/test_external_provenance.py:328 · its file's page
What it checks (5)
assert coverage.indexed_files == 25, "an unresolvable include is not one of this repo's files"observesmeasure_index_coverageviacoverageassert coverage.external_files == 0, "nor is it attributable to a named foreign tree"observesmeasure_index_coverageviacoverageassert coverage.unresolved_files == 1, "and the exclusion is reported, not silent"observesmeasure_index_coverageviacoverageassert stats.files.indexed_files == 25observesgraph_statsviastatsassert stats.files.unresolved_files == 1observesgraph_statsviastats
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_an_unresolved_include_is_neither_first_party_nor_external→_indexed→_ours→stamp_external_provenance→measure_index_coverage→graph_statsWhat 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.
Requirements it verifies (1)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-PIPE-014 | catalog | unknown |
Also reaches 10 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-INDEX-002 measured
- REQ-DDB-INDEX-003 measured
- REQ-DDB-INDEX-004 measured
- REQ-DDB-INDEX-005 measured
- REQ-DDB-MCP-001 measured
- REQ-DDB-PIPE-005 measured
- REQ-DDB-QUERY-001 measured
- REQ-DDB-QUERY-003 measured
- REQ-DDB-QUERY-008 measured