Skip to content

Added indexes tests for $createIndexes#139

Open
vic-tsang wants to merge 2 commits intodocumentdb:mainfrom
vic-tsang:indexes/createIndexes/tests
Open

Added indexes tests for $createIndexes#139
vic-tsang wants to merge 2 commits intodocumentdb:mainfrom
vic-tsang:indexes/createIndexes/tests

Conversation

@vic-tsang
Copy link
Copy Markdown
Collaborator

@vic-tsang vic-tsang commented Apr 24, 2026

This PR contains

  • indexes tests for $createIndexes

Assumptions: I didn't want to convolute the test with listIndexes to verify if the index is indeed created. I have assumed the numIndexesBefore and numIndexesAfter is working correctly after the api call.

Ref:

@vic-tsang vic-tsang requested a review from a team as a code owner April 24, 2026 00:56
indexes=({"key": {"a": 1}, "name": "a_cu", "unique": True, "collation": {"locale": "en"}},),
msg="Collation + unique should succeed",
),
]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing important coverage:

  • Compound index with partialFilterExpression — currently partial is only tested on single-field indexes.
  • partialFilterExpression with $nor / $not — not supported per docs; should error (currently missing from errors file).
  • partialFilterExpression referencing a field not in the index key — allowed, but worth testing.
  • Hidden index + dropIndexes — hidden indexes can still be dropped; no test.
  • Creating an index that matches an existing hidden one — behavior may differ.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

added

Copy link
Copy Markdown
Collaborator

@eerxuan eerxuan Apr 30, 2026

Choose a reason for hiding this comment

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

Hidden index + dropIndexes

it should be covered in dorpIndex test, and it already covered.Please remove it here

@documentdb-triage-tool documentdb-triage-tool Bot added compatibility test Compatibility test related enhancement New feature or request labels Apr 25, 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.85 (mixed)

Reasoning

component from path globs (test-coverage, test-framework); effort from diff stats (2114+0 LOC, 11 files); LLM: Adds new compatibility test cases for $createIndexes, expanding test coverage for an important index management feature.

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.

Signed-off-by: Victor Tsang <vitsangp@amazon.com>
@vic-tsang vic-tsang force-pushed the indexes/createIndexes/tests branch from 2ee51b0 to 829aabe Compare April 29, 2026 18:15
@vic-tsang vic-tsang requested a review from manojnks April 29, 2026 18:17
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.

3 participants