test_the_whole_repo_scope_indexes_a_nested_repository

Tests › tests/test_index_scope_inheritance.py

passed Passed in the packaged run.

What this test is for

Why it exists

The same reversal at the tier that reaches FURTHEST — its single root is the repo itself, so it is the tier a foreign clone is most certain to sit inside, and it is what a repo lands on by saying nothing, which is the common case.

Given

  1. root = tmp_path / "repo"
  2. nested = _undeclared_repo_with_nested_clone(root)
  3. args = argparse.Namespace( scope=sc.SCOPE_FROM_GUARD, guard_config=None, extra_input=None, extra_exclude=None, )
→

When

  1. cli._apply_scope(args, root)
  2. external_roots(root)
→

Then

  1. ✓ args.replace_input is True
  2. ✓ args.extra_input equals [str(root.resolve())]
  3. ✓ args.extra_exclude or [] does not contain str(nested.resolve())
  4. ✓ external_roots(root) contains "evidence/other_project"

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) · 26 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 userclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyother filesother filesother filesother filesopt (line 696)opttry (line 1003)tryopt (line 847)optloop (line 746)loopmain44. _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–68. whole_repo_scope → _gitignored_paths58_gitignored_paths +10 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_index_scope_inheritance.py:238 · its file's page

What it checks (4)

  1. assert args.replace_input is True not attributed
  2. assert args.extra_input == [str(root.resolve())], "the whole-repo root is the INPUT" not attributed
  3. assert str(nested.resolve()) not in (args.extra_exclude or []), ( "gh#333: a nested repository inside the whole-repo root is indexed and tagged" ) observes _undeclared_repo_with_nested_clone via nested
  4. assert "evidence/other_project" in external_roots(root) observes external_roots

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_the_whole_repo_scope_indexes_a_nested_repository→_undeclared_repo_with_nested_clone→_apply_scope→external_roots

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_the_whole_repo_scope_indexes_a_nested_repository · 4 checksexternal_rootsdependency_rootsREQ-DDB-CONFIG-001 · measured_apply_scope… 6 calls …_validate_nodeREQ-DDB-GUARD-012 · inferredexternal_rootsREQ-DDB-INDEX-005 · measured_apply_scope… 6 calls …allREQ-DDB-WIKI-054 · inferred
Also reaches 4 requirements

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