test_scope_derived_roots_are_not_subject_to_the_guard

Tests › tests/test_extra_input_patterns.py

passed Passed in the packaged run.

What this test is for

Why it exists

`_apply_scope` PREPENDS the derived scope roots — and on the whole-repo fallback the repo root itself — into the same `args.extra_input` list the user's entries live in. Judging the mutated list would refuse builds over roots the user never named, so the guard must run against the user's own entries only.

Given

  1. doxyfile = _doxyfile(tmp_path, "FILE_PATTERNS = *.h")
  2. _write(tmp_path / "library" / "aes.c")
  3. args = argparse.Namespace( doxyfile=str(doxyfile), repo_root=str(tmp_path), ## from-guard, not doxyfile: gh#333 made this the default and removed the ## `index_whole_repo` back door that used to reach the same scope from the ## narrow setting — two paths to one scope being two things that can disagree. scope=cli.SCOPE_FROM_GUARD, guard_config=None, extra_input=None, extra_exclude=None, )
→

When

  1. cli._apply_scope(args, tmp_path)
  2. cli._verify_extra_input_is_read(doxyfile, None, None, tmp_path)
→

Then

  1. ✓ args.extra_input equals [str(tmp_path)]

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.

clew — `main` (clew/cli.py) · 24 of 400 steps

… 10 earlier steps

command-line usercommand-line usercommand-line usercommand-line userclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyother filesother filesother filesother filesalt (line 1171)altopt (line 485)optmain11. propose → build_context11build_context12. build_context → derive_scope12derive_scope13. derive_scope → _declared_index_scope13_declared_index_scope▶ test enters14. _declared_index_scope → load_declaration_located14load_declaration_located15. load_declaration_located → _read_mapping15_read_mapping16. _read_mapping → _parsed_declaration16_parsed_declaration17. load_declaration_located → _checked_sections17_checked_sections

… 26 steps between

command-line usercommand-line usercommand-line usercommand-line usercommand-line userclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyother filesother filesother filesother filesother filesopt (line 696)opttry (line 1003)tryopt (line 847)optloop (line 746)looploop (line 1055)loopopt (line 1075)optmain44. _declared_index_scope → _existing_paths44_existing_paths45. derive_scope → whole_repo_scope45whole_repo_scope46. whole_repo_scope → _gitignored_paths46_gitignored_paths47. _gitignored_paths → git_argv47git_argv48–49. git_argv → _no_ext_diff48_no_ext_diff +1 more50. _gitignored_paths → git_env50git_env51. whole_repo_scope → list51list52–56. whole_repo_scope → nested_repo_roots52nested_repo_roots +4 more57. nested_repo_roots → _nested_repos_under57_nested_repos_under58. whole_repo_scope → _gitignored_paths58_gitignored_paths59–60. whole_repo_scope → _pruned_dirs59_pruned_dirs +1 more61. _pruned_dirs → _skip_dir61_skip_dir62–64. _pruned_dirs → _descendable62_descendable +2 more65–68. whole_repo_scope → _declaration_note65_declaration_note +3 more69. derive_scope → whole_repo_scope69whole_repo_scope▶ test enters70–71. build_context → repo_source_files70repo_source_files +1 more

… 329 later steps

4 more

tests/test_extra_input_patterns.py:279 · its file's page

What it checks (1)

  1. assert args.extra_input == [str(tmp_path)], "the resolved scope injects the repo root" not attributed

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_scope_derived_roots_are_not_subject_to_the_guard→_doxyfile→_write→_apply_scope→_verify_extra_input_is_read

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_scope_derived_roots_are_not_subject_to_the_guard · 1 checks_verify_extra_input_is_readeffective_file_patternsREQ-DDB-CONFIG-001 · measured_apply_scope… 6 calls …_validate_nodeREQ-DDB-GUARD-012 · inferred_verify_extra_input_is_readeffective_file_patternsREQ-DDB-INDEX-001 · measured_apply_scope… 6 calls …allREQ-DDB-WIKI-054 · inferred
Also reaches 4 requirements

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