test_an_unresolved_include_is_neither_first_party_nor_external

Tests › tests/test_external_provenance.py

passed Passed in the packaged run.

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

  1. db_path, root = _indexed(tmp_path, _ours())
  2. conn = sqlite3.connect(str(db_path))
  3. 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

  1. stamp_external_provenance(db_path, root)
  2. coverage = measure_index_coverage(db_path, root)
  3. stats = q.graph_stats(db_path)
→

Then

  1. ✓ coverage.indexed_files equals 25
  2. ✓ coverage.external_files equals 0
  3. ✓ coverage.unresolved_files equals 1
  4. ✓ stats.files.indexed_files equals 25
  5. ✓ 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

command-line usercommand-line usercommand-line usercommand-line userclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyother filesother filesother filesother filesopt (line 845)optloop (line 1239)loopopt (line 847)optloop (line 746)loopmain51. whole_repo_scope → list51list52. whole_repo_scope → nested_repo_roots52nested_repo_roots53. nested_repo_roots → _nested_repos_under53_nested_repos_under▶ test enters54–56. _nested_repos_under → _warn_unwalkable54_warn_unwalkable +2 more57. nested_repo_roots → _nested_repos_under57_nested_repos_under58. whole_repo_scope → _gitignored_paths58_gitignored_paths

… 157 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyloop (line 1576)looploop (line 1494)loopopt (line 1497)optmain216. _memberdef_corpora → _expansion_sql216_expansion_sql217. _expansion_sql → has_columns217has_columns218. has_columns → table_exists218table_exists219. _memberdef_corpora → _memberdef_candidates219_memberdef_candidates220. _memberdef_candidates → table_exists220table_exists221. _memberdef_candidates → documented_first221documented_first222. documented_first → records_provenance222records_provenance223. records_provenance → has_columns223has_columns▶ test enters224. _memberdef_candidates → symbol_provenance224symbol_provenance225. symbol_provenance → records_provenance225records_provenance

… 175 later steps

4 more

tests/test_external_provenance.py:328 · its file's page

What it checks (5)

  1. assert coverage.indexed_files == 25, "an unresolvable include is not one of this repo's files" observes measure_index_coverage via coverage
  2. assert coverage.external_files == 0, "nor is it attributable to a named foreign tree" observes measure_index_coverage via coverage
  3. assert coverage.unresolved_files == 1, "and the exclusion is reported, not silent" observes measure_index_coverage via coverage
  4. assert stats.files.indexed_files == 25 observes graph_stats via stats
  5. assert stats.files.unresolved_files == 1 observes graph_stats via stats

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_stats

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.

test_an_unresolved_include_is_neither_first_party_nor_external · 5 checksstamp_external_provenanceexternal_rootsdependency_rootsREQ-DDB-CONFIG-001 · measuredmeasure_index_coverage_file_yieldsmemoizedREQ-DDB-INDEX-002 · measuredmeasure_index_coverageREQ-DDB-INDEX-003 · measuredgraph_stats_symbol_provenancerecords_provenanceREQ-DDB-INDEX-004 · measuredstamp_external_provenanceREQ-DDB-INDEX-005 · measuredgraph_statsfile_countsmeta_sectionREQ-DDB-MCP-001 · measuredgraph_statsread_build_signatureREQ-DDB-PIPE-005 · measuredgraph_statsconnectREQ-DDB-QUERY-001 · measuredgraph_statscall_edge_countstable_existsREQ-DDB-QUERY-003 · measuredgraph_statsREQ-DDB-QUERY-008 · measured

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-PIPE-014catalogunknown
Also reaches 10 requirements

Its run touches their code; that is reach, not proof.