Skip to content

Add $collStats aggregation stage tests#144

Open
danielfrankcom wants to merge 6 commits intodocumentdb:mainfrom
danielfrankcom:pr/collStats
Open

Add $collStats aggregation stage tests#144
danielfrankcom wants to merge 6 commits intodocumentdb:mainfrom
danielfrankcom:pr/collStats

Conversation

@danielfrankcom
Copy link
Copy Markdown
Collaborator

This change adds tests for the $collStats operator.

Due to the nature of the operator, I needed to take a different approach to the assertions here. We can't reliably capture the entire expected shape of the result, so I added some machinery for asserting properties of the result. This should let us provide the coverage we need for $collStats, but also be applicable to future operators with complex results structures.

I also tried to avoid implementation-specific logic, since these stats seem to expose different things depending on the engine internals. The tests here are focused on the operator spec as best as possible.

I had to move strict_equal to its own module to avoid a circular import issue. The content is exactly the same, I just pulled it out.

Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
@danielfrankcom danielfrankcom requested a review from a team as a code owner April 27, 2026 21:41
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>
@documentdb-triage-tool documentdb-triage-tool Bot added compatibility test Compatibility test related enhancement New feature or request labels Apr 29, 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.80 (mixed)

Reasoning

component from path globs (test-coverage, test-framework); effort from diff stats (2270+53 LOC, 19 files); LLM: Adds new test coverage for the $collStats aggregation stage, including new assertion machinery for complex result structures; touches test files and result-analyzer logic but is scoped to the test-coverage component.

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.

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.

2 participants