test_an_imported_trace_is_drawn_over_its_test_flow

Tests › tests/test_wiki_tracerun.py

passed Passed in the packaged run.

What this test is for

Why it exists

ANY LANGUAGE, ONE OVERLAY: an OTLP JSON trace exported by a test run (a C++ test built with instrumentation, a JS test with OTel) is matched to the test flow whose test is its root span, and the page shows which predicted steps it confirmed, which never ran, what it discovered and where it failed. A trace that matches no flow is listed, never dropped.

Given

  1. root = tmp_path / "repo"
  2. for rel, text in { "src/__init__.py": "", "src/data.py": _DATA, "src/out.py": _OUT, "src/cli.py": _CLI, "tools/other.py": _OTHER_MAIN, "pyproject.toml": _PYPROJECT, "tests/test_data.py": _TEST, "requirements.yaml": _CATALOG, "README.md": "# Demo\n", "junit.xml": _JUNIT, "ROADMAP.md": _ROADMAP, "docs/extra.css": ".x{}\n", "tests/features/finish.feature": _FEATURE, }.items(): (root / rel).parent.mkdir(parents=True, exist_ok=True) (root / rel).write_text(text)
6 more
  1. failure = [ { "name": "exception", "attributes": [ {"key": "code.lineno", "value": {"stringValue": "6"}}, {"key": "exception.message", "value": {"stringValue": "boom"}}, ], } ]
  2. spans = [ _span("0000000000000001", "", "test_load", status=2, events=failure), _span("0000000000000002", "0000000000000001", "load"), _span("0000000000000003", "0000000000000002", "parse"), _span("0000000000000004", "0000000000000002", "helper_not_in_flow"), ]
  3. (root / "traces").mkdir()
  4. (root / "traces" / "run.json").write_text( json.dumps({"resourceSpans": [{"scopeSpans": [{"spans": spans}]}]}) )
  5. (root / "traces" / "orphan.json").write_text( json.dumps( { "resourceSpans": [ {"scopeSpans": [{"spans": [_span("0000000000000009", "", "test_nothing")]}]} ] } ) )
  6. db = tmp_path / "clew.db"
→

When

  1. _run_pipeline(_build_argparser().parse_args(["--output", str(db), "--repo-root", str(root)]))
  2. config = tmp_path / "wiki.yaml"
  3. config.write_text(_WIKI.replace("tests:\n", 'tests:\n traces: ["traces/*.json"]\n', 1))
4 more
  1. html = build_wiki(root, db, tmp_path / "out", config_path=config)
  2. page = (html / "flow-test_load-tests-test-data-py.html").read_text()
  3. panel = page[page.index('class="trace-panel imported"') :].split("</div>")[0]
  4. flows = (html / "flows.html").read_text()
→

Then

  1. ✓ panel contains "traces/run.json"
  2. ✓ panel contains "confirmed"
  3. ✓ panel contains "helper_not_in_flow"
  4. ✓ panel contains "boom"
  5. ✓ page contains 'g[data-step="0"]'
  6. ✓ flows contains "traces/orphan.json"
  7. ✓ flows contains "test_nothing"

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 · 311 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)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–104. entry_point_flows → _scripts95_scripts +9 more105. _declared_entry_patterns → table_exists105table_exists106–108. _declared_entry_patterns → load_declaration106load_declaration +2 more109. _read_mapping → _parsed_declaration109_parsed_declaration110. load_declaration_located → _checked_sections110_checked_sections

… 10 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.pyother filesother filesother filesother filesother filesloop (line 598)looploop (line 43)loopopt (line 200)optloop (line 259)loopelif (line 264)elifopt (line 202)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 more134. _text → check_report_size134check_report_size135. _contexts_from_lcov → _relative135_relative136. parse_contexts → _contexts_from_data_file136_contexts_from_data_file

… 3 steps between

callercallercallercallercallercallercallercallercallercallerclew/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/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/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.pyclew/wiki/symbols.pyclew/wiki/symbols.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/flowpage.pyclew/wiki/activity.pyclew/wiki/activity.pyclew/wiki/activity.pyclew/wiki/activity.pyclew/wiki/activity.pyclew/wiki/activity.pyclew/wiki/activity.pyclew/wiki/activity.pyclew/wiki/activity.pyclew/wiki/activity.pyother filesother filesother filesother 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)optloop (line 290)loopopt (line 310)optloop (line 385)loopopt (line 394)optloop (line 265)looploop (line 355)looploop (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_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–193. per_flow_lanes → _sides191_sides +2 more194–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–209. flow_page → _overview208_overview +1 more210. _segment_row → list210list211. _segment_row → _keyword211_keyword212. _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 → overlay237overlay238. imported_trace → failure_of238failure_of239. 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–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

… 1 step between

callercallercallercallerclew/wiki/activity.pyclew/wiki/activity.pyclew/wiki/activity.pyclew/wiki/activity.pyopt (line 231)optopt (line 232)optloop (line 187)loopelif (line 195)elifopt (line 160)optbuild_wiki282–283. _py_orelse → _py_orelse282_py_orelse +1 more284. _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

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 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–322. feature_pages → render_scenario316render_scenario +6 more323. 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

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 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–360. write_quick_views → _briefs359_briefs +1 more361. write_quick_views → symbol_href361symbol_href362. write_quick_views → anchor362anchor363–374. write_quick_views → modal363modal +11 more375. _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–400. requirements_page → list385list +15 more
7 more

tests/test_wiki_tracerun.py:263 · its file's page

What it checks (4)

  1. assert "traces/run.json" in panel and "confirmed" in panel not attributed
  2. assert "helper_not_in_flow" in panel and "boom" in panel not attributed
  3. assert 'g[data-step="0"]' in page not attributed
  4. assert "traces/orphan.json" in flows and "test_nothing" in flows not attributed

Where the product reaches it

  • build_wiki is the entry of the flow (flow)

Call flow

test_an_imported_trace_is_drawn_over_its_test_flow→_span→_run_pipeline→_build_argparser→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_an_imported_trace_is_drawn_over_its_test_flow · 4 checks_run_pipeline_run_pipeline_innerreport_statsREQ-DDB-CLI-001 · measured_run_pipeline… 6 calls …doxygen_supports_sqlite3REQ-DDB-CLI-002 · inferredbuild_wiki_build_site_commitgit_argvREQ-DDB-CONFIG-001 · measured_run_pipeline… 3 calls …_is_flat_req_listREQ-DDB-CONFIG-003 · measured_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 · measuredbuild_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 86 more requirement paths, listed below.

Also reaches 103 requirements

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