test_excluded_file

Tests › tests/guard/test_guard_main.py

passed Passed in the packaged run.

What this test is for

Why it exists

The test says nothing about why.

Given

  1. monkeypatch.chdir(tmp_path)
  2. c_file = tmp_path / "gen" / "auto.c"
3 more
  1. c_file.parent.mkdir()
  2. c_file.write_text("void Func(void) { }")
  3. config = { "validate": { **CONFIG_DEFAULTS["validate"], "exclude": ["gen/"], }, "impact": CONFIG_DEFAULTS["impact"], }
→

When

  1. violations = validate_file(str(c_file), config, no_git=True)
→

Then

  1. ✓ violations equals []

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

… 78 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.pyother filesother filesother filesother filestry (line 345)tryloop (line 326)looploop (line 69)loopmain79. load_failure_mode_ids → modes_of79modes_of80. _validate_files → validate_file80validate_file81. validate_file → get_validate81get_validate▶ test enters82. validate_file → excluded_by82excluded_by83–84. excluded_by → compile_globs83compile_globs +1 more85. validate_file → gate_exclusion85gate_exclusion86. gate_exclusion → _gate_matcher86_gate_matcher

… 271 later steps

tests/guard/test_guard_main.py:37 · its file's page

What it checks (1)

  1. assert violations == [] observes validate_file via violations

Where the product reaches it

  • main → _run → run_precommit → _validate_files → validate_file (flow)

Call flow

test_excluded_file→validate_file

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_excluded_file · 1 checksvalidate_fileget_file_at_revisionrun_gitgit_argvREQ-DDB-CONFIG-001 · inferredvalidate_filegate_exclusionREQ-DDB-CONFIG-009 · inferredvalidate_fileREQ-DDB-GUARD-001 · measuredvalidate_filecheck_version_stalenessREQ-DDB-GUARD-002 · inferredvalidate_filecheck_tagsREQ-DDB-GUARD-003 · inferredvalidate_filecheck_req_coverageREQ-DDB-GUARD-004 · inferredvalidate_filecheck_return_presenceREQ-DDB-GUARD-005 · inferredvalidate_filecheck_file_presenceREQ-DDB-GUARD-006 · inferredvalidate_filecheck_duplicate_tagsREQ-DDB-GUARD-007 · inferredvalidate_filecheck_req_coverage_has_active_requirementsfilter_requirements_by_versionREQ-DDB-GUARD-009 · inferredvalidate_filecheck_req_coverage_has_active_requirementsload_requirements_fullREQ-DDB-GUARD-011 · inferredvalidate_fileunconfigured_languageREQ-DDB-GUARD-013 · measured

and 13 more requirement paths, listed below.

Also reaches 25 requirements

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