Add indexes type tests for wildcard#679
Conversation
Signed-off-by: Victor [C] Tsang <vitsangp@amazon.com>
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent from path globs (test-coverage, test-framework); effort from diff stats (1994+0 LOC, 7 files); LLM: Adds new wildcard index type test cases to the compatibility test suite, expanding test coverage for an existing feature. If a label is wrong, remove it manually and ping |
|
|
||
| pytestmark = pytest.mark.index | ||
|
|
||
|
|
There was a problem hiding this comment.
Can we also test all the other data types, including special, scalars, objects and arrays
| from documentdb_tests.framework.parametrize import pytest_params | ||
|
|
||
| pytestmark = pytest.mark.index | ||
|
|
There was a problem hiding this comment.
Can we include cases for path specific wildcard , wildcard projection , compound wildcard ?
| from documentdb_tests.framework.parametrize import pytest_params | ||
|
|
||
| pytestmark = pytest.mark.index | ||
|
|
There was a problem hiding this comment.
can we add, compound wildcard where the non-wildcard prefix field is multikey (array)
| ) | ||
| assertFailureCode(result, test.expected, msg=test.msg) | ||
|
|
||
|
|
There was a problem hiding this comment.
Can we add a test case for compound wildcard with an overlapping field in both wildcard scope and regular key, without wildcardProjection exclusion
| result, {"value": {"_id": 2, "a": 99}, "ok": 1.0}, msg="Hinted findAndModify via wildcard" | ||
| ) | ||
|
|
||
|
|
There was a problem hiding this comment.
Can we have a test case like, Overwrite an existing nested field via $set (not just adding a new field)` and check dynamic field is indexed after update
| expected=[{"_id": 1, "a": {}}], | ||
| msg="Empty-document equality served by wildcard (documented exception)", | ||
| ), | ||
| IndexQueryTestCase( |
There was a problem hiding this comment.
Can we also have a case for, Multikey dedup for array-of-subdocuments on $exists/range queries
| hint="wc_id", | ||
| expected=[{"_id": 2, "a": 2}], | ||
| msg="Hinted _id query works when _id included in wildcardProjection", | ||
| ), |
There was a problem hiding this comment.
can we add a test case, query on _id subfields via a scoped "_id.$**" index
| result = execute_command(collection, {"dropIndexes": collection.name, "index": test.input}) | ||
| assertSuccessPartial(result, {"nIndexesWas": 2, "ok": 1.0}, msg=test.msg) | ||
|
|
||
|
|
There was a problem hiding this comment.
can we also add a test case, Two compound wildcard indexes with same prefix but different/overlapping wildcard scopes (conflict/coexistence)
| pytestmark = pytest.mark.index | ||
|
|
||
|
|
||
| WILDCARD_BSON_PARAMS = [ |
There was a problem hiding this comment.
can we have case , BSON type validation of values inside wildcardProjection (e.g. {"a": "yes"} instead of 0/1), may be in error case ?
This PR contains:
Ref: