Add $planCacheListFilters command tests#588
Conversation
b86c43c to
1ec7016
Compare
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent 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 If a label is wrong, remove it manually and ping |
| # filters when two different query shapes are set. | ||
| LIST_FILTERS_MULTIPLE_TESTS: list[CommandTestCase] = [ | ||
| CommandTestCase( | ||
| "two_shapes", |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
added test same_shape_different_value for this case
alinaliBQ
left a comment
There was a problem hiding this comment.
@Rishabh998 comments are addressed
| # filters when two different query shapes are set. | ||
| LIST_FILTERS_MULTIPLE_TESTS: list[CommandTestCase] = [ | ||
| CommandTestCase( | ||
| "two_shapes", |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
added test same_shape_different_value for this case
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>
4048d40 to
3dff088
Compare
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
setupfield inCommandTestCase.