test: cover search no-Lance error path + multi-list RRF (#358)#369
Merged
Conversation
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.
Owner
Author
|
Addressed 2 review findings:
|
…-gaps # Conflicts: # tests/test_mcp_v2.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
searchtest monkeypatchedrun_search, sosearch_v2's genuineexcept Exceptionenvelope (mcp_v2.py) was never exercised in CI — a regression turning the graceful failure into a traceback would ship green. Newtest_search_no_lance_index_returns_failure_enveloperunssearchagainst an index dir with no Lance tables and norun_searchmonkeypatch, and asserts:success is Falsewith a non-emptymessageand no traceback, andfindstill succeeds against the same graph (the failure is vector-specific, not a crash).multi-list RRF
_rrf_mergewas covered only for the weighted two-list case. Newtest_rrf_merge_reinforced_row_across_lists_outranks_singletonasserts 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
master(test_resolve_status_none_returns_nonempty_message) — the issue was stale on this point.handle_rerunhas no explicit config-version marker to migrate on, so a test would be speculative/overfit. Worth revisiting if/when aconfig_versionkey is introduced.JAVA_CODEBASE_RAG_RUN_HEAVY-gated), better made by the maintainer than bundled here.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