Skip to content

Add search stage tests#645

Merged
eerxuan merged 23 commits into
documentdb:mainfrom
danielfrankcom:pr/search
Jul 13, 2026
Merged

Add search stage tests#645
eerxuan merged 23 commits into
documentdb:mainfrom
danielfrankcom:pr/search

Conversation

@danielfrankcom

Copy link
Copy Markdown
Collaborator

This change adds tests for the search aggregation stage.

The mongot sidecar change here overlaps with #638. Both contain the same commit that should merge cleanly regardless of which is merged first.

I defined a number of pytest fixtures to define the necessary indexed collections for these tests, as an index of this type is far more expensive to set up than the ones we use elsewhere (on the order of 30-60 secs). Using a module/package scoped fixture allows us to amortize this cost across the test cases rather than taking the hit each time.

Closes #374

Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
@danielfrankcom danielfrankcom requested a review from a team as a code owner June 25, 2026 00:33
@documentdb-triage-tool documentdb-triage-tool Bot added compatibility test Compatibility test related enhancement New feature or request labels Jun 25, 2026
@documentdb-triage-tool

Copy link
Copy Markdown

🤖 Auto-triaged by documentdb-triage-tool.

Applied: compatibility test, enhancement
Project fields suggested: Component test-coverage · Priority P2 · Effort XL · Status Needs Review
Confidence: 0.30 (deterministic)

Reasoning

component from path globs (test-coverage, test-framework); effort from diff stats (9360+6 LOC, 40 files); LLM failed: Invalid response body while trying to fetch https://api.anthropic.com/v1/messages: Premature close

If a label is wrong, remove it manually and ping @patty-chow so the rules can be tuned. The bot will not re-label items that already have component labels.

Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
@tonglyu

tonglyu commented Jun 26, 2026

Copy link
Copy Markdown

returnScope and searchNodePreference options are missing in the test

Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
@tonglyu

tonglyu commented Jun 29, 2026

Copy link
Copy Markdown
  1. three Atlas Search operators have no test file: queryString, moreLikeThis, and embeddedDocument.
  2. same as $searchMeta, can we add success case for returnScope as well?

…Source auth schema

Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
@danielfrankcom danielfrankcom requested a review from tonglyu July 1, 2026 19:22
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>

@eerxuan eerxuan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please check the test failure, failed on retry.

Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
The query_single_byte_run_over_cap and query_multi_byte_run_over_cap
cases embedded multi-megabyte query strings directly in the parametrized
test data, exceeding the 1,000,000-byte collection-time payload limit and
failing test validation. Wrap the oversized query values in lazy(...) so
they are built at test time instead of held in the collected data.

Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
@danielfrankcom danielfrankcom requested a review from eerxuan July 9, 2026 22:10
@eerxuan eerxuan merged commit 20dd886 into documentdb:main Jul 13, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compatibility test Compatibility test related enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add compatibility test for $search

3 participants