Skip to content

test: cover successful findAndRerank through the Nvidia HTTP client - #2605

Merged
erichare merged 2 commits into
mainfrom
fix/rerank-integration-coverage
Oct 7, 2026
Merged

erichare merged 2 commits into
mainfrom
fix/rerank-integration-coverage

Conversation

@erichare

@erichare erichare commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does:

Adds integration tests that complete findAndRerank using a local HTTP reranker and the production Nvidia client.

  • Checks ordering, query and passage defaults/overrides, projection, limits, optional scores, deduplication, and empty results.
  • Verifies all 60 candidates reach the reranker across batches.
  • Updates the MCP test to check reranked results.

This is the test foundation for #2606 and #2607. Unit tests and DSE/HCD integration tests pass in CI.

Which issue(s) this PR fixes:

Fixes #2600.

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

📈 Unit Test Coverage Delta vs Main Branch

Metric Value
Main Branch 54.58%
This PR 54.71%
Delta 🟢 +0.14%
✅ Coverage improved!

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Unit Test Coverage Report

Overall Project 54.71% 🍏

There is no coverage information present for the Files changed

@erichare
erichare marked this pull request as ready for review October 2, 2026 19:19
@erichare
erichare requested a review from a team as a code owner October 2, 2026 19:19
DocumentScoresDesc serializes per-document scores under "scores", not
"$scores". The wrong path made every $rerank assertion see an empty list
and let the $vectorRank/$bm25Rank checks pass vacuously.
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

📈 Integration Test Coverage Delta vs Main Branch (dse69-it)

Metric Value
Main Branch 72.03%
This PR 72.99%
Delta 🟢 +0.96%
✅ Coverage improved!

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Integration Test Coverage Report (dse69-it)

Overall Project 72.99% 🍏

There is no coverage information present for the Files changed

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

📈 Integration Test Coverage Delta vs Main Branch (hcd-it)

Metric Value
Main Branch 73.27%
This PR 74.27%
Delta 🟢 +1.00%
✅ Coverage improved!

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Integration Test Coverage Report (hcd-it)

Overall Project 74.27% 🍏

There is no coverage information present for the Files changed

@erichare
erichare added this pull request to stack #2608 October 5, 2026 20:35
}

@Test
void explicitOverridesRerankBeforeProjectionAndApplyFinalLimit() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: explicitOverridesRerankBeforeProjectionAndApplyFinalLimit shows that all three candidates are reranked before limit: 2 applies, since three passages are sent. But the top two by score, high and middle, are also the first two documents before sorting (ScoredDocumentMerger keeps candidates in a HashMap keyed by _id, which yields high, middle, low for these ids). So this test alone would still pass if the result were cut before sorting.

Could the scores be chosen so the top two differ from that order? For example, ids a, b, c with passage scores 1, 8 and 4 should return b, c, while the order before sorting is a, b, c.

@Hazel-Datastax Hazel-Datastax left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@erichare
erichare merged commit 0982ea7 into main Oct 7, 2026
3 checks passed
@erichare
erichare deleted the fix/rerank-integration-coverage branch October 7, 2026 01:09
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.

Add integration test runs a real rerank

2 participants