Skip to content

test: cover search no-Lance error path + multi-list RRF (#358)#369

Merged
HumanBean17 merged 3 commits into
masterfrom
chore/test-coverage-gaps
Jul 4, 2026
Merged

test: cover search no-Lance error path + multi-list RRF (#358)#369
HumanBean17 merged 3 commits into
masterfrom
chore/test-coverage-gaps

Conversation

@HumanBean17

@HumanBean17 HumanBean17 commented Jul 3, 2026

Copy link
Copy Markdown
Owner

What

Closes the two highest-value coverage gaps from #358. (No production code changed — tests only.)

search no-Lance error path (the #1 gap)

Every search test monkeypatched run_search, so search_v2's genuine except Exception envelope (mcp_v2.py) was never exercised in CI — a regression turning the graceful failure into a traceback would ship green. New test_search_no_lance_index_returns_failure_envelope runs search against an index dir with no Lance tables and no run_search monkeypatch, and asserts:

  • success is False with a non-empty message and no traceback, and
  • find still succeeds against the same graph (the failure is vector-specific, not a crash).

multi-list RRF

_rrf_merge was covered only for the weighted two-list case. New test_rrf_merge_reinforced_row_across_lists_outranks_singleton asserts a row reinforced across two ranked lists accumulates score and outranks a singleton, dedups by (filename, range_start, range_end), and orders by summed score.

Already covered / deferred

  • resolve no-match is already covered on master (test_resolve_status_none_returns_nonempty_message) — the issue was stale on this point.
  • Installer config-schema migration: deferred — handle_rerun has no explicit config-version marker to migrate on, so a test would be speculative/overfit. Worth revisiting if/when a config_version key is introduced.
  • Promoting the vectors flow / concurrent-optimize race guard into CI: deferred — that's a model-downloading CI policy decision (the tests are JAVA_CODEBASE_RAG_RUN_HEAVY-gated), better made by the maintainer than bundled here.
.venv/bin/python -m pytest tests/test_mcp_v2.py tests/test_search_lancedb.py -q   # 112 passed, 1 skipped

Addresses the top-2 highest-value coverage gaps from #358 (search no-Lance error path; multi-list RRF). resolve no-match was already covered on master; installer config-schema migration and CI vectors-flow promotion remain open (see Already covered / deferred above), so this PR intentionally does not auto-close #358.

🤖 Generated with Claude Code

HumanBean17 and others added 2 commits July 3, 2026 23:53
Two highest-value coverage gaps from #358:

- search no-Lance error path: every search test monkeypatched run_search, so
  search_v2's genuine `except Exception` envelope was never exercised. Add a test
  that runs search against an index dir with no Lance tables (no monkeypatch) and
  asserts success=False with a non-empty message and no traceback, while graph-
  only tools still succeed against the same graph.

- multi-list RRF: _rrf_merge was covered only for the weighted two-list case.
  Add a test that a row reinforced across two ranked lists accumulates score and
  outranks a singleton, dedups by row key, and orders by summed score.

resolve no-match is already covered (test_resolve_status_none_returns_nonempty_message).

Co-Authored-By: Claude <noreply@anthropic.com>
The two tests added by this PR were each followed by three blank lines
before the next top-level def; PEP8/ruff E303 allows at most two. The
repo's ruff config does not enable E3 today so this is latent, but it
would surface under a stricter lint gate.
@HumanBean17

Copy link
Copy Markdown
Owner Author

Addressed 2 review findings:

  1. E303 — the two new tests were each followed by 3 blank lines (max 2). Collapsed to 2. (Latent: the repo ruff config doesn't enable E3.)
  2. Closes #358 auto-close — the body would auto-close the issue on merge while 2 acceptance criteria are deferred. Replaced with non-closing wording ("Addresses the top-2 … intentionally does not auto-close test coverage & CI gaps: search no-Lance error path, resolve no-match, installer migration, ranking, heavy-gating #358").

@HumanBean17 HumanBean17 merged commit d1691db into master Jul 4, 2026
1 check passed
@HumanBean17 HumanBean17 deleted the chore/test-coverage-gaps branch July 4, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test coverage & CI gaps: search no-Lance error path, resolve no-match, installer migration, ranking, heavy-gating

1 participant