Skip to content

Add $planCacheListFilters command tests#588

Open
alinaliBQ wants to merge 11 commits into
documentdb:mainfrom
alinaliBQ:planCacheListFilters
Open

Add $planCacheListFilters command tests#588
alinaliBQ wants to merge 11 commits into
documentdb:mainfrom
alinaliBQ:planCacheListFilters

Conversation

@alinaliBQ

Copy link
Copy Markdown
Contributor

This change adds tests for the $planCacheListFilters command operator.

Add command operator tests for $planCacheListFilters. Tests database $planCacheListFilters behavior, syntax, and expected errors.

This PR adds setup field in CommandTestCase.

@alinaliBQ alinaliBQ force-pushed the planCacheListFilters branch from b86c43c to 1ec7016 Compare June 9, 2026 23:47
@alinaliBQ alinaliBQ marked this pull request as ready for review June 9, 2026 23:48
@alinaliBQ alinaliBQ requested a review from a team as a code owner June 9, 2026 23:48
@documentdb-triage-tool documentdb-triage-tool Bot added compatibility test Compatibility test related enhancement New feature or request labels Jun 10, 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.82 (mixed)

Reasoning

component from path globs (test-coverage); effort from diff stats (1031+0 LOC, 6 files); LLM: Adds new functional test coverage for the $planCacheListFilters command, including a minor test framework extension (adding a setup field to CommandTestCase).

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.

# filters when two different query shapes are set.
LIST_FILTERS_MULTIPLE_TESTS: list[CommandTestCase] = [
CommandTestCase(
"two_shapes",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A query shape is the combination of query + sort + projection + collation, but all the multi-filter tests here only change the query. Could we add a case where the query stays the same but the sort (or projection/collation) differs? That should produce two separate filters, and right now nothing checks that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added same_query_different_sort to check for case where the query stays the same but the sort differs

# contains one entry with matching query, sort, projection, and indexes.
LIST_FILTERS_SINGLE_ENTRY_TESTS: list[CommandTestCase] = [
CommandTestCase(
"single_filter_entry",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

can we add a test of two queries that differ only in their values map to the same shape (e.g. {a: 1} and {a: 999}), one test that sets a filter, sets it again with a different value for the same field, and confirms we still only get 1 filter back.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added test same_shape_different_value for this case

@alinaliBQ alinaliBQ left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@Rishabh998 comments are addressed

# filters when two different query shapes are set.
LIST_FILTERS_MULTIPLE_TESTS: list[CommandTestCase] = [
CommandTestCase(
"two_shapes",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added same_query_different_sort to check for case where the query stays the same but the sort differs

# contains one entry with matching query, sort, projection, and indexes.
LIST_FILTERS_SINGLE_ENTRY_TESTS: list[CommandTestCase] = [
CommandTestCase(
"single_filter_entry",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added test same_shape_different_value for this case

alinaliBQ added 11 commits June 12, 2026 14:41
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
@alinaliBQ alinaliBQ force-pushed the planCacheListFilters branch from 4048d40 to 3dff088 Compare June 12, 2026 21:42
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