test_the_pipeline_exiting_is_reported_rather_than_escaping

Tests › tests/test_mcp_server.py

passed Passed in the packaged run.

What this test is for

Why it exists

The pipeline refuses some inputs with `sys.exit`, which is a BaseException. Out of process that was an exit code; in-process, uncaught, it would escape the worker thread and read as a build that simply stopped.

Verifies REQ-DDB-MCP-001 REQ-DDB-MCP-003 REQ-DDB-QUERY-006 REQ-DDB-QUERY-008 REQ-DDB-QUERY-009

Given

  1. repo = tmp_path / "refused"
  2. repo.mkdir()
5 more
  1. (repo / "Doxyfile").write_text("GENERATE_SQLITE3 = YES\n", encoding="utf-8")
  2. target = st.Target( repo_path=str(repo), slug="refused-test", db_path=str(tmp_path / "state" / "clew.db") )
  3. def _refuse(**_kwargs): raise SystemExit(1)
  4. monkeypatch.setattr(cli_mod, "build_index", _refuse)
  5. result = DocsDbServer.__new__(DocsDbServer)._run_build(target, None)
→

When

  1. —
→

Then

  1. ✓ result["ok"] is False
  2. ✓ result["error"].startswith("SystemExit:") 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.

thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 17 of 142 steps

… 34 earlier steps

thread startthread startthread startthread startclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pytry (line 1664)try_first_build_worker35. target_for → state_home35state_home36. _first_build_worker → _run_build36_run_build37. _run_build → nested_tree_cache37nested_tree_cache▶ test enters38–39. _run_build → _run_build_walked38_run_build_walked +1 more40. _sub_index_rejection → first_party_sub_index40first_party_sub_index41. _sub_index_rejection → _buildable_sub_indexes41_buildable_sub_indexes

… 16 steps between

thread startthread startthread startthread startclew/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.pyother filesother filesother filesother filesopt (line 3215)opttry (line 3260)try_first_build_worker58. _offered_sub_indexes → list58list59. _run_build_walked → _buildable_sub_indexes59_buildable_sub_indexes60. _run_build_walked → discover_doxyfile60discover_doxyfile61. _run_build_walked → captured_output61captured_output62. _run_build_walked → build_lock62build_lock63–64. build_lock → _os_lock63_os_lock +1 more65. _run_build_walked → db_status65db_status66–67. db_status → _options_meta66_options_meta +1 more

… 29 steps between

thread startthread startthread startthread startclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/mcp_server/freshness.pyclew/mcp_server/freshness.pyclew/mcp_server/freshness.pyclew/mcp_server/freshness.pyclew/declaration.pyclew/declaration.pyclew/declaration.pyclew/declaration.pytry (line 3260)tryalt (line 1171)altopt (line 485)opt_first_build_worker97–98. notices → _derived_notice97_derived_notice +1 more99. _run_build_walked → declared_scope_rejection99declared_scope_rejection100. declared_scope_rejection → _declared_index_scope100_declared_index_scope101. _declared_index_scope → load_declaration_located101load_declaration_located102. load_declaration_located → _read_mapping102_read_mapping103. _read_mapping → _parsed_declaration103_parsed_declaration104. load_declaration_located → _checked_sections104_checked_sections

… 25 steps between

thread startthread startthread startthread startclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyloop (line 1416)looptry (line 3260)try_first_build_worker130. _existing_paths → _is_within130_is_within131. _declared_index_scope → _existing_paths131_existing_paths132. _run_build_walked → _sub_index_scope132_sub_index_scope133. _sub_index_scope → first_party_sub_index133first_party_sub_index134. _sub_index_scope → derive_sub_indexes134derive_sub_indexes

… 1 step between

thread startthread startthread startthread startclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/declaration.pyclew/declaration.pyclew/declaration.pyclew/declaration.pyother filesother filesother filesother filescatch (line 3328)catch_first_build_worker136. declared_sub_index_excludes → load_declaration136load_declaration137. load_declaration → load_declaration_located137load_declaration_located138. _run_build_walked → _bounded_output138_bounded_output139. _bounded_output → all139all140. _run_build_walked → _failure_result140_failure_result141. _run_build_walked → _bounded_output141_bounded_output142. _run_build_walked → 142… 2 calls not run
2 more

tests/test_mcp_server.py:1062 · its file's page

What it checks (2)

  1. assert result["ok"] is False not attributed
  2. assert result["error"].startswith("SystemExit:") not attributed

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.

Requirements it verifies (5)

requirementlinked byimplementers exercised
REQ-DDB-MCP-001catalogunknown
REQ-DDB-MCP-003catalogunknown
REQ-DDB-QUERY-006catalogunknown
REQ-DDB-QUERY-008catalogunknown
REQ-DDB-QUERY-009catalogunknown
Also reaches 5 requirements

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