test_full_pipeline

Tests › tests/guard/test_guard_impact.py

passed Passed in the packaged run.

What this test is for

Why it exists

The test says nothing about why.

Given

  1. c_file = tmp_path / "test.c"
  2. c_file.write_text( dedent("""\ /** * @brief Func. * @version 1.0 * @req REQ-0252 */ void Func(void) { impl(); } """) )
2 more
  1. def mock_runner(cmd): return "@@ -6,1 +6,1 @@\n-old\n+new\n"
  2. config = _make_impact_config(req_file=FIXTURES_DIR / "impact" / "req.csv")
→

When

  1. result = run_impact( [str(c_file)], config, staged=True, run_command=mock_runner, )
→

Then

  1. ✓ result contains "REQ-0252"
  2. ✓ result contains "Func"

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.

`main` (clew/guard/main.py) · 81 of 357 steps

… 53 earlier steps

program launcherprogram launcherprogram launcherprogram launcherclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pyloop (line 391)loopmain54. run_precommit → _validate_files54_validate_files55. _validate_files → load_requirements_full55load_requirements_full56. load_requirements_full → _get_requirements_config56_get_requirements_config57. _get_requirements_config → get_requirements57get_requirements58. _get_requirements_config → resolve_contained_path58resolve_contained_path59. load_requirements_full → _validate_requirements59_validate_requirements60. _validate_requirements → get_validate60get_validate61. _validate_requirements → _summarise_id61_summarise_id62. _validate_files → load_external_requirements62load_external_requirements63. load_external_requirements → get_requirements63get_requirements

… 2 steps between

program launcherprogram launcherprogram launcherprogram launcherother filesother filesother filesother filesopt (line 1336)optalt (line 1344)altmain66–67. read_catalog_at → git_text66git_text +1 more68–69. git_argv → _no_ext_diff68_no_ext_diff +1 more70–71. read_catalog_at → _refuse_url70_refuse_url +1 more

… 30 steps between

program launcherprogram launcherprogram launcherprogram launcherprogram launcherclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/checks.pyclew/guard/checks.pyclew/guard/checks.pyclew/guard/checks.pyclew/guard/checks.pyclew/guard/ts_parser.pyclew/guard/ts_parser.pyclew/guard/ts_parser.pyclew/guard/ts_parser.pyclew/guard/ts_parser.pyother filesother filesother filesother filesother filesopt (line 168)optloop (line 647)loopopt (line 786)optopt (line 377)optelif (line 379)elifopt (line 400)optopt (line 658)optopt (line 681)optopt (line 683)optalt (line 684)altopt (line 227)opttry (line 241)trymain102. gate_exclusion → binary_file102binary_file103. validate_file → parse_source_file103parse_source_file104–109. parse_source_file → parse_source_file_with_content104parse_source_file_with_content +5 more110. parse_content_for_file → language_for_file110language_for_file111–112. language_for_file → language_for_extension111language_for_extension +1 more113. language_for_file → _language_from_config113_language_from_config114. parse_content_for_file → parse_functions114parse_functions115. parse_functions → parse_functions_ts115parse_functions_ts116. parse_functions_ts → get_parser_for_language116get_parser_for_language117. parse_functions_ts → get_language_spec117get_language_spec118–119. parse_functions_ts → _collect_functions118_collect_functions +1 more120. _is_rust_test_item → _rust_attributes120_rust_attributes121. _collect_functions → _enclosing_class_for121_enclosing_class_for122. _enclosing_class_for → _rust_impl_self_type122_rust_impl_self_type123–126. _collect_functions → _declared_function123_declared_function +3 more127–128. _append_declaration → _qualified_enclosing127_qualified_enclosing +1 more129–137. _collect_functions → _resolve_function_node129_resolve_function_node +8 more138–139. _find_preceding_doxygen → _collect_rust_doc138_collect_rust_doc +1 more140–142. _find_preceding_doxygen → _collect_python_comments140_collect_python_comments +2 more143. _find_preceding_doxygen → parse_doxygen_tags143parse_doxygen_tags144. _find_preceding_doxygen → apply_autobrief144apply_autobrief145. _find_preceding_doxygen → _last_row145_last_row146–149. _collect_functions → _qualified_enclosing146_qualified_enclosing +3 more150. _js_returns_void → _function_carrier150_function_carrier151. _collect_functions → _produced_class151_produced_class152. _produced_class → _function_carrier152_function_carrier153. _collect_functions → _collect_functions153_collect_functions154. _collect_functions → _collect_functions154_collect_functions155. validate_file → unconfigured_language155unconfigured_language156. validate_file → check_file_presence156check_file_presence

… 6 steps between

program launcherprogram launcherprogram launcherprogram launcherclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/checks.pyclew/guard/checks.pyclew/guard/checks.pyclew/guard/checks.pyother filesother filesother filesother filesopt (line 1198)optloop (line 143)loopopt (line 1171)optloop (line 181)loopmain163. _extract_file_block_text → _docstring_block163_docstring_block164. _check_file_block_tags → parse_doxygen_tags164parse_doxygen_tags165–170. parse_doxygen_tags → _mask_escaped_at165_mask_escaped_at +5 more171. _check_file_block_tags → apply_autobrief171apply_autobrief172. apply_autobrief → _mask_escaped_at172_mask_escaped_at▶ test enters173–174. apply_autobrief → _split_inline_tags173_split_inline_tags +1 more175. validate_file → check_presence175check_presence176. check_presence → get_validate176get_validate

… 52 steps between

program launcherprogram launcherprogram launcherprogram launcherclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/checks.pyclew/guard/checks.pyclew/guard/checks.pyclew/guard/checks.pyother filesother filesother filesother filesopt (line 265)optmain229. validate_file → get_file_at_revision229get_file_at_revision230. get_file_at_revision → run_git230run_git231. run_git → git_argv231git_argv232. validate_file → parse_content_for_file232parse_content_for_file233. validate_file → check_version_staleness233check_version_staleness

… 22 steps between

program launcherprogram launcherprogram launcherprogram launcherprogram launcherclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pyother filesother filesother filesother filesother filesopt (line 853)optloop (line 188)loopopt (line 114)optopt (line 116)optopt (line 92)optopt (line 94)optopt (line 98)optloop (line 583)loopopt (line 587)optopt (line 482)optmain256. impact_report → get_changed_files256get_changed_files257. get_changed_files → run_git257run_git258. impact_report → collect_changes258collect_changes▶ test enters259–260. collect_changes → _collect_changed_lines259_collect_changed_lines +1 more261. _get_file_diff → get_staged_diff261get_staged_diff262. get_staged_diff → run_git262run_git263. _get_file_diff → get_diff263get_diff264. get_diff → run_git264run_git265. _collect_changed_lines → parse_changed_lines265parse_changed_lines266. _collect_changed_lines → _get_file_diff266_get_file_diff267. _collect_changed_lines → parse_changed_lines267parse_changed_lines268. collect_changes → _extract_changed_functions268_extract_changed_functions269. _extract_changed_functions → parse_source_file269parse_source_file270. impact_report → find_index270find_index271. find_index → registered_index271registered_index272–275. impact_report → build_report272build_report +3 more276. build_report → _place_untagged276_place_untagged277. build_report → _reviewers277_reviewers278. run_precommit → _write_report278_write_report279. _write_report → validate_output_path279validate_output_path

… 1 step between

program launcherprogram launcherprogram launcherprogram launcherclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pyother filesother filesother filesother filesopt (line 673)optloop (line 684)loopopt (line 482)optloop ×5 (line 699)loop ×5main281. _write_report → format_markdown281format_markdown282. format_markdown → _unmapped_markdown282_unmapped_markdown283. format_markdown → _markdown_row283_markdown_row▶ test enters284–288. _markdown_row → _cell284_cell ×5289. format_markdown → _unmapped_markdown289_unmapped_markdown290. _write_report → format_json290format_json291. run_precommit → git_add291git_add

… 24 steps between

program launcherprogram launcherprogram launcherprogram launcherclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/coverage.pyclew/guard/coverage.pyclew/guard/coverage.pyclew/guard/coverage.pyother filesother filesother filesother filesloop (line 150)loopopt (line 57)optmain316. analyze_coverage → traceability316traceability317. traceability → is_test_path317is_test_path318. is_test_path → _matcher318_matcher▶ test enters319. analyze_coverage → covered_via319covered_via320. covered_via → get_requirements320get_requirements

… 37 later steps

4 more

tests/guard/test_guard_impact.py:352 · its file's page

What it checks (2)

  1. assert "REQ-0252" in result observes run_impact via result
  2. assert "Func" in result observes run_impact via result

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_full_pipeline→_make_impact_config→run_impact

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_full_pipeline · 2 checksrun_impact… 3 calls …git_argvREQ-DDB-CONFIG-001 · measuredrun_impactimpact_reportcollect_changes_extract_changed_functionsREQ-DDB-GUARD-008 · measuredrun_impactimpact_reportbuild_reportload_requirementsREQ-DDB-GUARD-009 · measuredrun_impactREQ-DDB-GUARD-010 · measuredrun_impact… 3 calls …_get_requirements_configREQ-DDB-GUARD-011 · measuredrun_impact… 6 calls …get_language_configREQ-DDB-GUARD-013 · measuredrun_impact… 4 calls …resolve_contained_pathREQ-DDB-GUARD-016 · measuredrun_impact… 3 calls …parse_source_fileREQ-DDB-GUARD-018 · measuredrun_impact… 10 calls …parse_doxygen_tagsREQ-DDB-GUARD-019 · measuredrun_impact… 6 calls …language_for_fileREQ-DDB-GUARD-020 · measuredrun_impact… 10 calls …_find_python_docstring_blockREQ-DDB-GUARD-021 · measuredrun_impactimpact_reportget_changed_filesREQ-DDB-GUARD-023 · measured

and 2 more requirement paths, listed below.

Also reaches 16 requirements

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