test_versioned_builds_and_a_diff_between_them

Tests › tests/test_wiki_trace_extensions.py

passed Passed in the packaged run.

What this test is for

Why it exists

ONE SITE PER KEY, and the diff names what changed between two keys: nodes added or removed (the key space) and requirement tier changes.

Given

  1. repo, db, _kv = trace_repo
  2. out = tmp_path / "sites"
→

When

  1. build_wiki(repo, db, out, version="v1")
  2. (repo / "model" / "keys.toml").write_text(_KEYS.replace("net.retries", "net.backoff"))
  3. (repo / "build" / "junit.xml").write_text(_JUNIT.replace("/>", "><failure/></testcase>"))
3 more
  1. build_wiki(repo, db, out, version="v2")
  2. diff = diff_versions(out, "v1", "v2")
  3. page = (out / "diff-v1-v2.html").read_text()
→

Then

  1. ✓ (out / "v1" / "html" / "index.html").is_file() holds
  2. ✓ (out / "v2" / "html" / "index.html").is_file() holds
  3. ✓ [v["key"] for v in json.loads((out / "versions.json").read_text())] equals ["v1", "v2"]
  4. ✓ (out / "index.html").read_text() contains "v1"
  5. ✓ diff["nodes_added"] equals ["keys:net.backoff"]
  6. ✓ diff["nodes_removed"] equals ["keys:net.retries"]
  7. ✓ diff["requirements_changed"] contains {"id": "REQ-W-001", "from": "PASS", "to": "GAP"}
  8. ✓ page contains "keys:net.backoff"
  9. ✓ page contains "REQ-W-001"

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 · 209 of 400 steps

callercallercallercallercallercallercallercallerclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/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.pyclew/wiki/config.pyclew/wiki/config.pyclew/wiki/config.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyother filesother filesother filesother 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)opttry (line 1123)trytry (line 1155)tryloop (line 63)looploop (line 64)looploop (line 195)looploop (line 281)loopopt (line 611)optloop (line 43)looploop (line 223)looploop (line 224)looploop (line 74)looploop (line 78)looptry (line 146)tryopt (line 529)optopt (line 531)optloop (line 569)loopopt (line 571)optloop ×2 (line 1156)loop ×2build_wiki1. build_wiki → load_wiki_config1load_wiki_config▶ test enters2–6. load_wiki_config → _read_section2_read_section +4 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_site58. _build_site → load_wiki_config58load_wiki_config59. _build_site → _audience59_audience60. _build_site → valid_key60valid_key61. _build_site → _commit61_commit62. _commit → git_argv62git_argv63–64. git_argv → _no_ext_diff63_no_ext_diff +1 more65. _build_site → commit_published65commit_published66–67. commit_published → git_argv66git_argv ×268. _build_site → gather68gather69. gather → link_kind69link_kind70. _build_site → _milestones70_milestones71. _milestones → roadmap_milestones71roadmap_milestones72. roadmap_milestones → list72list73. _build_site → _burndown73_burndown74. _burndown → burndown74burndown75–76. burndown → _same75_same +1 more77. _milestone_marks → _same77_same78. _burndown → series78series79–80. series → _versions79_versions +1 more81. _build_site → _requirements_of81_requirements_of82. _build_site → gather82gather83. _build_site → load_traces83load_traces84. load_traces → redact_local_paths84redact_local_paths85. _build_site → root_name85root_name86. root_name → spans_of86spans_of87. _build_site → _test_flows87_test_flows88. _test_flows → connect88connect89. _test_flows → test_functions89test_functions90. test_functions → table_exists90table_exists91. _build_site → _all_flows91_all_flows92. _all_flows → list92list93. _all_flows → entry_point_flows93entry_point_flows94. entry_point_flows → connect94connect95–97. entry_point_flows → _scripts95_scripts +2 more98. _read_toml → require_toml_module98require_toml_module99. require_toml_module → toml_module99toml_module▶ test enters100. console_scripts → _nested100_nested101. _scripts → _defined101_defined102–104. entry_point_flows → _mains102_mains +2 more105. _declared_entry_patterns → table_exists105table_exists106–111. _declared_entry_patterns → load_declaration106load_declaration +5 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/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyother filesother filesother filesother filesloop (line 43)loopopt (line 200)optbuild_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_exists125. entry_point_flows → _thread_entries125_thread_entries126. _thread_entries → table_exists126table_exists127. _thread_entries → _not_test127_not_test128. entry_point_flows → _calls_something128_calls_something129. _calls_something → table_exists129table_exists130. _build_site → _coverage130_coverage131. _coverage → parse_contexts131parse_contexts132–133. parse_contexts → _contexts_from_lcov132_contexts_from_lcov +1 more

… 6 steps between

callercallercallercallercallerclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyother filesother filesother filesother filesother filesloop (line 204)loopopt (line 373)optloop (line 373)looploop (line 282)loopopt (line 442)optloop (line 122)looploop (line 207)looptry (line 209)trybuild_wiki140–141. parse_contexts → _relative140_relative +1 more142. _build_site → build_graph142build_graph143. build_graph → connect143connect144. build_graph → _tested_calls144_tested_calls145. _tested_calls → table_exists145table_exists146. build_graph → _links146_links147. _links → table_exists147table_exists148. _links → _bump148_bump149. _links → table_exists149table_exists150. _links → 150… 1 call not run151. build_graph → _threads151_threads152. _threads → table_exists152table_exists153. build_graph → _vendor_calls_in153_vendor_calls_in154. _vendor_calls_in → table_exists154table_exists155. _vendor_calls_in → is_vendor155is_vendor156–157. build_graph → _components156_components +1 more158. _components → _impact_into158_impact_into159–164. build_graph → is_vendor159is_vendor +5 more165. _build_site → flow_page165flow_page166. flow_page → _executed166_executed

… 5 steps between

callercallercallercallerclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pybuild_wiki172–173. function_candidates → table_exists172table_exists +1 more174. _test_scope_term → table_exists174table_exists▶ test enters175–176. function_candidates → matching_identity175matching_identity +1 more

… 49 steps between

callercallercallercallerclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyother filesother filesother filesother filesloop (line 290)loopbuild_wiki226. flow_page → _badges226_badges227. _badges → page_of227page_of228. page_of → _key228_key229. flow_page → code229code230. flow_page → symbol_href230symbol_href231–232. symbol_href → anchor231anchor +1 more233. flow_page → code233code234. flow_page → table234table

… 16 steps between

callercallercallercallercallerclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/activity.pyclew/wiki/activity.pyclew/wiki/activity.pyclew/wiki/activity.pyclew/wiki/activity.pyother filesother filesother filesother filesother filesloop (line 355)looploop (line 207)looptry (line 209)tryloop (line 173)looploop (line 132)looploop (line 360)loopopt (line 372)optopt (line 424)optopt (line 374)optopt (line 64)optloop (line 187)loopopt (line 191)optbuild_wiki251. trace_for → spans_of251spans_of252. _build_site → _actor_of252_actor_of253. _build_site → symbol_pages253symbol_pages254. symbol_pages → connect254connect255–257. symbol_pages → test_functions255test_functions +2 more258. _owners_by_file → file_owners258file_owners259. file_owners → table_exists259table_exists260. _owners_by_file → list260list261. symbol_pages → table_exists261table_exists262–263. symbol_pages → _section262_section +1 more264. _section → source_url264source_url265–266. _section → _near265_near +1 more267. _split_callers → list267list268–270. _section → _test_block268_test_block +2 more271. _test_block → verifies_block271verifies_block272. verifies_block → tag272tag273. _test_block → assertions273assertions274. _section → _activity274_activity275. _activity → steps_of275steps_of276–278. steps_of → _py_steps276_py_steps +2 more279–280. _py_block → _py_block279_py_block +1 more

… 3 steps between

callercallercallercallerclew/wiki/activity.pyclew/wiki/activity.pyclew/wiki/activity.pyclew/wiki/activity.pyloop (line 187)loopelif (line 195)elifopt (line 160)optbuild_wiki284. _py_block → _py_block284_py_block285. _py_block → 285… 3 calls not run286. _py_steps → _without_docstring286_without_docstring287–288. steps_of → _c_steps287_c_steps +1 more

… 6 steps between

callercallercallercallerclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/activity.pyclew/wiki/activity.pyclew/wiki/activity.pyclew/wiki/activity.pyother filesother filesother filesother filesloop (line 320)loopalt (line 347)altopt (line 386)optloop (line 132)looploop (line 311)looploop (line 296)looploop (line 302)loopbuild_wiki295. _c_block → _collapse295_collapse296. _c_block → 296… 1 call not run297. _activity → anchor297anchor298. _activity → activity_svg298activity_svg299–301. activity_svg → _edge299_edge +2 more302. _section → md_title302md_title303–309. symbol_pages → _file_header303_file_header +6 more310. _build_site → parse_features310parse_features311–313. parse_features → _scenarios311_scenarios +2 more314. _build_site → feature_pages314feature_pages315. feature_pages → anchor315anchor316. feature_pages → render_scenario316render_scenario

… 6 steps between

callercallercallercallerclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyother filesother filesother filesother filesloop (line 296)looploop (line 302)loopbuild_wiki323. feature_pages → symbol_href323symbol_href324. feature_pages → page_for324page_for325. _build_site → test_pages325test_pages326. test_pages → connect326connect327. test_pages → _test_definitions327_test_definitions328. _test_definitions → table_exists328table_exists329. test_pages → _briefs329_briefs330. _briefs → strip_xml330strip_xml331–336. test_pages → load_modes331load_modes +5 more337–338. _exercises → _player_controls337_player_controls +1 more

… 5 steps between

callercallercallercallerclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyother filesother filesother filesother filesloop (line 151)looploop (line 193)looploop (line 195)loopbuild_wiki344–345. slice_svg → flow_svg344flow_svg +1 more346. _build_site → parse_junit346parse_junit347–353. parse_junit → fold_cases347fold_cases +6 more354. _build_site → _lines_by_test354_lines_by_test355. _lines_by_test → lines_per_test355lines_per_test356. _build_site → _slices_by_test356_slices_by_test357. _build_site → write_quick_views357write_quick_views358. write_quick_views → connect358connect359. write_quick_views → _briefs359_briefs360. write_quick_views → _facts_of360_facts_of361. write_quick_views → symbol_href361symbol_href

… 11 steps between

callercallercallercallerclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyother filesother filesother filesother filesloop (line 193)loopopt (line 202)optloop (line 398)loopopt (line 136)optopt (line 139)optbuild_wiki373. _reqs → page_of373page_of374. write_quick_views → plural374plural375. _build_site → find_decisions375find_decisions376–379. find_decisions → parse_adr376parse_adr +3 more380. _build_site → _fetch_issues380_fetch_issues381. _fetch_issues → provider_for381provider_for382. _fetch_issues → link_issues382link_issues383. _build_site → _issues_into383_issues_into384. _build_site → requirements_page384requirements_page385–390. requirements_page → list385list +5 more391–394. _ears_line → catalog_value391catalog_value +3 more395–396. requirement_pages → _what395_what +1 more397. _what → md_title397md_title398–400. _what → first398first +2 more
8 more

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

What it checks (8)

  1. assert (out / "v1" / "html" / "index.html").is_file() not attributed
  2. assert (out / "v2" / "html" / "index.html").is_file() not attributed
  3. assert [v["key"] for v in json.loads((out / "versions.json").read_text())] == ["v1", "v2"] not attributed
  4. assert "v1" in (out / "index.html").read_text() not attributed
  5. assert diff["nodes_added"] == ["keys:net.backoff"] observes diff_versions via diff
  6. assert diff["nodes_removed"] == ["keys:net.retries"] observes diff_versions via diff
  7. assert {"id": "REQ-W-001", "from": "PASS", "to": "GAP"} in diff["requirements_changed"] observes diff_versions via diff
  8. assert "keys:net.backoff" in page and "REQ-W-001" in page not attributed

Where the product reaches it

  • build_wiki is the entry of the flow (flow)

Call flow

test_versioned_builds_and_a_diff_between_them→build_wiki→diff_versions

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_versioned_builds_and_a_diff_between_them · 8 checksbuild_wiki_build_site_commitgit_argvREQ-DDB-CONFIG-001 · measuredbuild_wiki… 5 calls …_is_flat_req_listREQ-DDB-CONFIG-003 · inferredbuild_wikiload_wiki_config_requirements_sectionread_requirements_sectionREQ-DDB-GUARD-012 · measuredbuild_wiki… 6 calls …apply_opt_in_languagesREQ-DDB-GUARD-024 · inferredbuild_wiki… 5 calls …git_textREQ-DDB-GUARD-027 · measuredbuild_wiki… 4 calls …console_scriptsREQ-DDB-PIPE-004 · measuredbuild_wiki_build_siteapi_pagesconnectREQ-DDB-QUERY-001 · measuredbuild_wiki_build_sitesymbol_pagestable_existsREQ-DDB-QUERY-003 · measuredbuild_wiki… 3 calls …file_ownersREQ-DDB-QUERY-004 · measuredbuild_wiki… 4 calls …function_candidatesREQ-DDB-QUERY-010 · measuredbuild_wiki… 5 calls …resolve_catalog_pathREQ-DDB-SCHEMA-006 · measuredbuild_wiki… 4 calls …link_idsREQ-DDB-SCHEMA-015 · measured

and 41 more requirement paths, listed below.

Also reaches 58 requirements

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