test_a_legitimate_sub_index_still_registers

Tests › tests/test_sub_index_refusal.py

passed Passed in the packaged run.

What this test is for

Why it exists

THE CONTROL. The check runs before registration, so getting it wrong would make every sub-index unbuildable rather than merely leaving litter behind.

Given

  1. repo = _split_repo(tmp_path / "repo")
  2. registry = st.TargetRegistry(tmp_path / "state")
3 more
  1. instance = srv.DocsDbServer.__new__(srv.DocsDbServer)
  2. instance.registry = registry
  3. resolved = asyncio.run(instance._build_subject(None, str(repo), "deps-tinyfsm"))
→

When

  1. —
→

Then

  1. ✓ resolved is not None
  2. ✓ resolved.name equals "deps-tinyfsm"
  3. ✓ [t.name for t in registry.targets()] equals ["deps-tinyfsm"]
  4. ✓ Path(resolved.db_path).parent.is_dir() holds

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.

Build, refresh and check the index · 50 of 153 steps

… 15 earlier steps

callercallercallercallerclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/routing.pyclew/mcp_server/routing.pyclew/mcp_server/routing.pyclew/mcp_server/routing.pyopt (line 352)optopt (line 169)optloop (line 169)loopopt (line 171)optopt (line 172)optindex16. ensure_target → adopt16adopt17. adopt → repo_indexes17repo_indexes18. repo_indexes → target_for18target_for19–20. target_for → _safe_index_name19_safe_index_name +1 more21. repo_indexes → target_for21target_for22. adopt → target_for22target_for

… 43 steps between

callercallercallercallerclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/wiki/themes/clew/static/web.jsclew/wiki/themes/clew/static/web.jsclew/wiki/themes/clew/static/web.jsclew/wiki/themes/clew/static/web.jsclew/mcp_server/routing.pyclew/mcp_server/routing.pyclew/mcp_server/routing.pyclew/mcp_server/routing.pyclew/mcp_server/freshness.pyclew/mcp_server/freshness.pyclew/mcp_server/freshness.pyclew/mcp_server/freshness.pyopt (line 1826)optopt (line 1874)optopt (line 1887)optopt (line 1904)optindex66–67. notices → _derived_notice66_derived_notice +1 more68. _build_subject → resolve_target68resolve_target▶ test enters69. resolve_target → _indexes_for69_indexes_for70. _indexes_for → repo_indexes70repo_indexes71. _indexes_for → repo_indexes71repo_indexes72. resolve_target → list72list73. resolve_target → target_for73target_for74–75. resolve_target → unknown_target_error74unknown_target_error +1 more

… 5 steps between

callercallercallercallercallerclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/wiki/themes/clew/static/web.jsclew/wiki/themes/clew/static/web.jsclew/wiki/themes/clew/static/web.jsclew/wiki/themes/clew/static/web.jsclew/wiki/themes/clew/static/web.jsclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyother filesother filesother filesother filesother filestry (line 1003)tryopt (line 847)optloop (line 746)looploop (line 205)looploop (line 286)loopindex81. describe_declaration → _parsed_declaration81_parsed_declaration82. resolve_target → 82… 1 call not run83. _build_subject → target_for83target_for▶ test enters84. _build_subject → _sub_index_rejection84_sub_index_rejection85. _sub_index_rejection → first_party_sub_index85first_party_sub_index86. first_party_sub_index → whole_repo_scope86whole_repo_scope87. whole_repo_scope → _gitignored_paths87_gitignored_paths88. _gitignored_paths → git_argv88git_argv89. git_argv → _no_ext_diff89_no_ext_diff90. git_argv → list90list91. _gitignored_paths → git_env91git_env92. whole_repo_scope → list92list93–97. whole_repo_scope → nested_repo_roots93nested_repo_roots +4 more98. nested_repo_roots → _nested_repos_under98_nested_repos_under99–109. whole_repo_scope → _gitignored_paths99_gitignored_paths +10 more110–112. first_party_sub_index → _under_any110_under_any +2 more113–114. _first_party → _own_ignores113_own_ignores +1 more115. first_party_sub_index → _gitignored_paths115_gitignored_paths116. _sub_index_rejection → _buildable_sub_indexes116_buildable_sub_indexes117. _buildable_sub_indexes → derive_sub_indexes117derive_sub_indexes118–121. derive_sub_indexes → whole_repo_scope118whole_repo_scope +3 more122. _nested_trees_recursive → list122list123–124. _nested_trees_recursive → _gitignored_paths123_gitignored_paths +1 more125–130. derive_sub_indexes → _direct_parent125_direct_parent +5 more131. _sub_index_rejection → _offered_sub_indexes131_offered_sub_indexes132. _offered_sub_indexes → derive_sub_indexes132derive_sub_indexes

… 21 later steps

6 more

tests/test_sub_index_refusal.py:326 · its file's page

What it checks (3)

  1. assert resolved is not None and resolved.name == "deps-tinyfsm" not attributed
  2. assert [t.name for t in registry.targets()] == ["deps-tinyfsm"] not attributed
  3. assert Path(resolved.db_path).parent.is_dir(), "the build still needs somewhere to write" 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_a_legitimate_sub_index_still_registers→_split_repo

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.

Also reaches 3 requirements

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