test_check_refuses_a_reference_to_an_undeclared_node

Tests › tests/test_wiki_trace_extensions.py

passed Passed in the packaged run.

What this test is for

Why it exists

THE TRACE TARGET MUST EXIST: a tag naming a node no source declares is a named problem, as is a source file that is missing.

Verifies REQ-DDB-WIKI-007 REQ-DDB-WIKI-024

Given

  1. repo, db, _kv = trace_repo
→

When

  1. check_wiki(repo, db)
  2. (repo / "src" / "data.py").write_text(_PY.replace("net.timeout", "net.nope"))
  3. db2 = tmp_path / "again.db"
3 more
  1. _run_pipeline(_build_argparser().parse_args(["--output", str(db2), "--repo-root", str(repo)]))
  2. (repo / "model" / "topics.yaml").unlink()
  3. problems = "\n".join(check_wiki(repo, db2))
→

Then

  1. ✓ check_wiki(repo, db) equals []
  2. ✓ problems contains "keys:net.nope"
  3. ✓ problems contains "load"
  4. ✓ problems contains "model/topics.yaml"

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.

Build this wiki from the index · 63 of 400 steps

callercallercallercallercallerclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/config.pyclew/wiki/config.pyclew/wiki/config.pyclew/wiki/config.pyclew/wiki/config.pyother filesother filesother filesother filesother filestry (line 708)tryopt (line 445)optloop (line 417)loopopt (line 420)optalt (line 421)altloop (line 135)looploop (line 632)looptry (line 752)tryloop (line 1312)loopopt (line 1314)optbuild_wiki1. build_wiki → load_wiki_config1load_wiki_config2. load_wiki_config → _read_section2_read_section▶ test enters3–6. load_wiki_config → _overlaid3_overlaid +3 more7. _requirements_section → read_requirements_section7read_requirements_section8. read_requirements_section → _validate_node8_validate_node9–11. _validate_node → _validate_map_of9_validate_map_of +2 more12–13. _validate_node → _validate_dict_node12_validate_dict_node +1 more14–16. _validate_dict_node → _suggest_key14_suggest_key +2 more17. _validate_dict_node → _validate_node17_validate_node18–21. load_wiki_config → _top_level18_top_level +3 more22. _strings → all22all23–25. all → _events23_events +2 more26–28. load_wiki_config → _strings26_strings +2 more29. _audiences → _unknown29_unknown30–37. load_wiki_config → _pinned_catalogs30_pinned_catalogs +7 more38. _declared_report → read_guard_section38read_guard_section39–41. load_wiki_config → _issues39_issues +2 more42. _sbom → all42all43–47. load_wiki_config → _one_of43_one_of +4 more48. _comments → all48all49–55. load_wiki_config → _doc_tags49_doc_tags +6 more56. build_wiki → report_limit56report_limit57. build_wiki → _build_site57_build_site

… 3 steps between

callercallercallercallerclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyother filesother filesother filesother filestry (line 1123)trytry (line 1155)trybuild_wiki61. _build_site → _commit61_commit62. _commit → git_argv62git_argv63. git_argv → _no_ext_diff63_no_ext_diff▶ test enters64. git_argv → list64list65. _build_site → commit_published65commit_published66. commit_published → git_argv66git_argv

… 28 steps between

callercallercallercallerother filesother filesother filesother filesloop (line 43)looploop (line 223)looploop (line 224)looploop (line 74)looploop (line 78)loopbuild_wiki95–96. entry_point_flows → _scripts95_scripts +1 more97. console_scripts → _read_toml97_read_toml▶ test enters98. _read_toml → require_toml_module98require_toml_module99. require_toml_module → toml_module99toml_module▶ test enters100. console_scripts → _nested100_nested101. _scripts → _defined101_defined102. entry_point_flows → _mains102_mains

… 2 steps between

callercallercallercallerclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyother filesother filesother filesother filestry (line 146)tryopt (line 529)optopt (line 531)optloop (line 569)loopopt (line 571)optbuild_wiki105. _declared_entry_patterns → table_exists105table_exists106. _declared_entry_patterns → load_declaration106load_declaration107. load_declaration → load_declaration_located107load_declaration_located▶ test enters108–111. load_declaration_located → _read_mapping108_read_mapping +3 more112–113. _checked_section → _checked_list_section112_checked_list_section +1 more114–116. _checked_section → _checked_requirements114_checked_requirements +2 more117. _checked_tests → _checked_list_section117_checked_list_section118. _checked_tests → 118… 1 call not run

… 1 step between

callercallercallercallerclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyother filesother filesother filesother filesbuild_wiki120–121. check_manifest_document → _checked_document120_checked_document +1 more122. _checked_section → _check_section_keys122_check_section_keys123. _mains → _not_test123_not_test124. _not_test → table_exists124table_exists

… 44 steps between

callercallercallercallerclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyother filesother filesother filesother filesopt (line 201)optbuild_wiki169. derive_flow → _entry_rowids169_entry_rowids170. _entry_rowids → identity_rowids170identity_rowids171. identity_rowids → function_candidates171function_candidates▶ test enters172–175. function_candidates → table_exists172table_exists +3 more176–177. matching_identity → qualified_name_of176qualified_name_of +1 more

… 2 steps between

callercallercallercallerclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyother filesother filesother filesother filesopt (line 777)optalt (line 780)altopt (line 203)optbuild_wiki180–181. identity_rowids → qualified_name_of180qualified_name_of +1 more182. identity_rowids → qualified_name_of182qualified_name_of▶ test enters183. identity_rowids → qualified_name_of183qualified_name_of184. _entry_rowids → function_candidates184function_candidates185. _entry_rowids → qualified_name_of185qualified_name_of

… 215 later steps

7 more

tests/test_wiki_trace_extensions.py:214 · its file's page

What it checks (3)

  1. assert check_wiki(repo, db) == [] observes check_wiki
  2. assert "keys:net.nope" in problems and "load" in problems observes check_wiki via problems
  3. assert "model/topics.yaml" in problems observes check_wiki via problems

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_check_refuses_a_reference_to_an_undeclared_node→check_wiki→_run_pipeline→_build_argparser

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_check_refuses_a_reference_to_an_undeclared_node · 3 checks_run_pipeline_run_pipeline_innerreport_statsREQ-DDB-CLI-001 · measured_run_pipeline… 6 calls …doxygen_supports_sqlite3REQ-DDB-CLI-002 · inferred_run_pipeline_run_pipeline_inner_apply_declared_documentstated_document_metaREQ-DDB-CONFIG-001 · measured_run_pipeline… 3 calls …_is_flat_req_listREQ-DDB-CONFIG-003 · inferred_run_pipeline_run_pipeline_inner_build_stagesresolve_preprocessorREQ-DDB-CONFIG-004 · measured_run_pipeline_run_pipeline_inner_build_stagesimport_kconfigREQ-DDB-CONFIG-005 · measured_run_pipeline_run_pipeline_inner_recorded_entry_patternsrecorded_explicitREQ-DDB-CONFIG-006 · measured_run_pipeline_run_pipeline_inner_build_stageswrite_build_signatureREQ-DDB-CONFIG-007 · measured_run_pipeline_run_pipeline_inner_apply_toolchain_exclusionsload_toolchain_configREQ-DDB-CONFIG-009 · measuredcheck_wikiload_wiki_config_requirements_sectionread_requirements_sectionREQ-DDB-GUARD-012 · measured_run_pipeline… 4 calls …parse_doxygen_tagsREQ-DDB-GUARD-019 · measured_run_pipeline… 4 calls …apply_autobriefREQ-DDB-GUARD-024 · measured

and 52 more requirement paths, listed below.

Requirements it verifies (2)

requirementlinked byimplementers exercised
REQ-DDB-WIKI-007catalogunknown
REQ-DDB-WIKI-024catalogunknown
Also reaches 65 requirements

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