Skip to content

Add $planCacheStats stage tests#170

Open
danielfrankcom wants to merge 1 commit intodocumentdb:mainfrom
danielfrankcom:pr/planCacheStats
Open

Add $planCacheStats stage tests#170
danielfrankcom wants to merge 1 commit intodocumentdb:mainfrom
danielfrankcom:pr/planCacheStats

Conversation

@danielfrankcom
Copy link
Copy Markdown
Collaborator

This change adds test coverage for the $planCacheStats aggregation stage operator.

As part of this change I added target_collection and indexes to StageTestCase as I found I was needing them more than originally expected, and having to create too many custom StageTestCase derivations. For tests that don't need them they are optional, so this shouldn't cause any problems. They are also generally applicable, and while they may not be useful for many aggregation stage tests, they at least make sense still in the context of those stages.

As with tests like #166, I've used assertProperties to verify what I can about the expected output shape for this operator, but it is highly dependent on database engine internals. The main thing I focused on testing was the input/output spec, without trying to overreach and verify functionality of the operator.

Ref: #34

Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
@danielfrankcom danielfrankcom requested a review from a team as a code owner May 7, 2026 21:04
@documentdb-triage-tool documentdb-triage-tool Bot added compatibility test Compatibility test related enhancement New feature or request labels May 7, 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 L · Status Needs Review
Confidence: 0.85 (mixed)

Reasoning

component from path globs (test-coverage, test-framework); effort from diff stats (979+5 LOC, 8 files); LLM: Adds new test coverage for the $planCacheStats aggregation stage, including StageTestCase extensions for target_collection and indexes fields across one 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.

1 participant