test_build_writes_a_self_contained_site

Tests › tests/test_wiki_build.py

passed Passed in the packaged run.

What this test is for

Why it exists

NO CDN, NO RUNTIME FETCH: the generated HTML references nothing off the site.

Given

  1. repo, out = site_repo
→

When

  1. site = build_wiki(repo, out, tmp_path / "site")
  2. pages = {p.name: p.read_text() for p in site.rglob("*.html")}
  3. flow = next(text for name, text in pages.items() if name.startswith("flow-"))
  4. for text in pages.values(): assert "https://cdn" not in text and 'src="http' not in text
→

Then

  1. ✓ pages contains "index.html"
  2. ✓ pages["index.html"] contains "Demo Wiki"
  3. ✓ flow contains "<svg"
  4. ✓ flow contains "parse"
  5. ✓ any("SECRET_BODY_MARKER" in t for t in pages.values()) holds

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

callercallercallercallerclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/config.pyclew/wiki/config.pyclew/wiki/config.pyclew/wiki/config.pyother filesother filesother filesother filestry (line 708)trybuild_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–9. read_requirements_section → _validate_node8_validate_node +1 more

… 6 steps between

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 filesloop (line 417)loopalt (line 421)altloop (line 135)looptry (line 752)tryloop (line 1312)loopopt (line 1314)opttry (line 1123)trytry (line 1155)tryloop (line 63)looploop (line 64)looploop ×2 (line 1156)loop ×2build_wiki16. list → link16link17. _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–37. load_wiki_config → _strings26_strings +11 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_limit▶ test enters57. 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. burndown → _same75_same

… 3 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.pyother filesother filesother filesother filesother filesloop (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 485)optbuild_wiki79–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–99. _read_toml → require_toml_module98require_toml_module +1 more100. console_scripts → _nested100_nested101. _scripts → _defined101_defined102–104. entry_point_flows → _mains102_mains +2 more105. _declared_entry_patterns → table_exists105table_exists106–109. _declared_entry_patterns → load_declaration106load_declaration +3 more110–111. load_declaration_located → _checked_sections110_checked_sections +1 more

… 9 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.pyother filesother filesother filesother filesloop (line 598)looploop (line 43)loopopt (line 200)optbuild_wiki121. _checked_document → _checked_entries121_checked_entries122. _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

callercallercallercallercallercallercallerclew/wiki/build.pyclew/wiki/build.pyclew/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/query/_common.pyclew/query/_common.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyother filesother filesother 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)tryopt (line 201)optopt (line 777)optopt (line 203)optloop (line 566)looploop (line 441)loopopt (line 275)optopt (line 601)optbuild_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_executed167. flow_page → derive_flow167derive_flow168. derive_flow → connect168connect169. derive_flow → _entry_rowids169_entry_rowids170. _entry_rowids → identity_rowids170identity_rowids171–175. identity_rowids → function_candidates171function_candidates +4 more176–179. matching_identity → qualified_name_of176qualified_name_of +3 more180–183. identity_rowids → qualified_name_of180qualified_name_of +3 more184. _entry_rowids → function_candidates184function_candidates185. _entry_rowids → qualified_name_of185qualified_name_of186. _entry_rowids → identity_rowids186identity_rowids187. derive_flow → qualified_name_of187qualified_name_of188. flow_page → slices_of188slices_of189. slices_of → _slice189_slice190. flow_page → per_flow_lanes190per_flow_lanes191–192. per_flow_lanes → _sides191_sides +1 more193. per_flow_lanes → list193list194–196. flow_page → page_name194page_name +2 more197. _signatures → connect197connect198. _signatures → identity_rowids198identity_rowids199. step_data → source_url199source_url200. step_data → _call_text200_call_text201. flow_page → with_values201with_values202. with_values → overlay202overlay203–204. overlay → spans_of203spans_of +1 more205–206. flow_page → _segments205_segments +1 more207. _preface → gherkin207gherkin208. flow_page → _overview208_overview209. _overview → _segment_row209_segment_row210. _segment_row → list210list

… 1 step between

callercallercallercallercallerclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyother filesother filesother filesother filesother filesloop (line 290)loopopt (line 310)optbuild_wiki212. _overview → _keyword212_keyword213. _overview → plural213plural214–215. flow_page → _top_segments214_top_segments +1 more216. _message_of → plural216plural217–218. flow_page → _block217_block +1 more219. _block → flow_svg219flow_svg220–222. flow_svg → _fold_inside220_fold_inside +2 more223–224. flow_page → test_node223test_node +1 more225. _site_cell → code225code226. 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 → table234table235. flow_page → plural235plural236. flow_page → imported_trace236imported_trace237. imported_trace → overlay237overlay

… 1 step 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/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyother filesother filesother filesother filesother filesloop (line 385)loopopt (line 394)optloop (line 265)looploop (line 207)looptry (line 209)tryloop (line 355)looploop (line 173)looploop (line 132)looploop (line 360)loopopt (line 372)optbuild_wiki239. failure_of → spans_of239spans_of240. imported_trace → plural240plural241. flow_page → _diagram_exports241_diagram_exports242. _diagram_exports → flow_mermaid242flow_mermaid243. _diagram_exports → flow_plantuml243flow_plantuml244. _diagram_exports → flow_dot244flow_dot245–248. flow_dot → _dot_id245_dot_id +3 more249. _build_site → _with_role249_with_role250. _build_site → trace_for250trace_for251. 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–269. _section → _test_block268_test_block +1 more

… 2 steps between

callercallercallercallerclew/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 filesopt (line 424)optloop (line 360)loopopt (line 374)optopt (line 64)optloop (line 187)loopopt (line 191)optbuild_wiki272. 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)looploop (line 102)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. test_pages → load_modes331load_modes332–333. test_pages → test_page_of332test_page_of +1 more

… 10 steps between

callercallercallercallerclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyclew/wiki/build.pyother filesother filesother filesother filesloop (line 151)loopbuild_wiki344–345. slice_svg → flow_svg344flow_svg +1 more346. _build_site → parse_junit346parse_junit347–348. parse_junit → fold_cases347fold_cases +1 more349–350. parse_junit → _case_name349_case_name +1 more

… 1 step 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.pyother filesother filesother filesother filesother filesloop (line 193)looploop (line 195)loopopt (line 202)optloop (line 398)loopbuild_wiki352–353. parse_junit → _root352_root +1 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–360. write_quick_views → _briefs359_briefs +1 more361. write_quick_views → symbol_href361symbol_href362. write_quick_views → anchor362anchor363–372. write_quick_views → modal363modal +9 more373. _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–386. requirements_page → list385list +1 more387–388. requirement_pages → first387first +1 more

… 12 later steps

5 more

tests/test_wiki_build.py:115 · its file's page

What it checks (4)

  1. assert "index.html" in pages and "Demo Wiki" in pages["index.html"] not attributed
  2. assert "<svg" in flow and "parse" in flow not attributed
  3. assert "https://cdn" not in text and 'src="http' not in text not attributed
  4. assert any("SECRET_BODY_MARKER" in t for t in pages.values()), "bodies render by default" not attributed

Where the product reaches it

  • build_wiki is the entry of the flow (flow)

Call flow

test_build_writes_a_self_contained_site→build_wiki

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_build_writes_a_self_contained_site · 4 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 · inferredbuild_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 · inferred

and 41 more requirement paths, listed below.

Also reaches 56 requirements

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