test_index_takes_only_all_tool_statements

Tests › tests/test_toolchain.py

passed Passed in the packaged run.

What this test is for

Why it exists

The test says nothing about why.

Verifies REQ-DDB-PIPE-011

Given

  1. (tmp_path / "toolchain.toml").write_text( '[ignore]\npaths = ["vendor/**"]\n[clew.ignore]\npaths = ["legacy/**"]\n' '[knots.ignore]\npaths = ["bench/**"]\n' )
  2. (tmp_path / "suppress.toml").write_text( '[[suppress]]\nname = "a"\ntool = "*"\nfile_glob = "third_party/**"\n' '[[suppress]]\nname = "b"\ntool = "*"\nfile = "gen.c"\n' '[[suppress]]\nname = "c"\ntool = "clew"\nfile_glob = "doc_only/**"\n' '[[suppress]]\nname = "d"\ntool = "*"\nrule = "r"\nfile = "src/x.c"\n' '[[suppress]]\nname = "e"\ntool = "knots"\nfile_glob = "src/**"\n' )
→

When

  1. config = load_toolchain_config(tmp_path)
→

Then

  1. ✓ config.index_globs equals ("vendor/**", "third_party/**", "gen.c")
  2. ✓ set(config.gate_globs) equals { "vendor/**", "third_party/**", "gen.c", "legacy/**", "doc_only/**", }
  3. ✓ config.sources(tmp_path) equals "toolchain.toml, suppress.toml"

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) · 9 of 357 steps

… 85 earlier steps

program launcherprogram launcherprogram launcherprogram launcherother filesother filesother filesother filesopt (line 178)opttry (line 118)tryloop (line 135)loopopt (line 98)optmain86–87. gate_exclusion → _gate_matcher86_gate_matcher +1 more88. load_toolchain_config → _read_toml88_read_toml▶ test enters89–90. _read_toml → require_toml_module89require_toml_module +1 more91–92. load_toolchain_config → _string_list91_string_list +1 more93–95. all → _events93_events +2 more96–99. load_toolchain_config → _string_list96_string_list +3 more100. _gate_matcher → compile_globs100compile_globs101. gate_exclusion → matches101matches

… 256 later steps

1 more

tests/test_toolchain.py:43 · its file's page

What it checks (3)

  1. assert config.index_globs == ("vendor/**", "third_party/**", "gen.c") observes load_toolchain_config via config
  2. assert set(config.gate_globs) == { "vendor/**", "third_party/**", "gen.c", "legacy/**", "doc_only/**", } observes load_toolchain_config via config
  3. assert config.sources(tmp_path) == "toolchain.toml, suppress.toml" observes load_toolchain_config via config

Where the product reaches it

  • main → _run → run_precommit → _validate_files → validate_file → gate_exclusion → _gate_matcher → load_toolchain_config (flow)

Call flow

test_index_takes_only_all_tool_statements→load_toolchain_config

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_index_takes_only_all_tool_statements · 3 checksload_toolchain_configREQ-DDB-CONFIG-009 · measuredload_toolchain_config_string_listallREQ-DDB-WIKI-054 · inferred

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-PIPE-011catalogunknown
Also reaches 2 requirements

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