Skip to content

Added index type tests for text#252

Open
vic-tsang wants to merge 3 commits into
documentdb:mainfrom
vic-tsang:indexes/type/text/tests
Open

Added index type tests for text#252
vic-tsang wants to merge 3 commits into
documentdb:mainfrom
vic-tsang:indexes/type/text/tests

Conversation

@vic-tsang
Copy link
Copy Markdown
Collaborator

This PR contains:

  • indexes type tests for text
  • createIndexes tests didn't use bson_type_validator framework
    • in this PR we have validated the following: default_language, language_override, weights, textIndexVersion

Ref:

Signed-off-by: Victor [C] Tsang <vitsangp@amazon.com>
@vic-tsang vic-tsang requested a review from a team as a code owner May 29, 2026 00:29
Copy link
Copy Markdown
Collaborator

@fanyangv fanyangv left a comment

Choose a reason for hiding this comment

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

This PR covers BSON type validation and 3 error cases, but is missing success/behavior tests for text index creation. Consider adding (here or in follow-up):

  1. Compound text index creation succeeds ({"a": 1, "content": "text", "b": -1})
  2. Wildcard text index ({"$**": "text"}) creation succeeds
  3. Sparse behavior — documents without indexed field are excluded from $text results
  4. Collation restriction — text index on collection with non-simple collation requires {collation: {locale: "simple"}}

@documentdb-triage-tool documentdb-triage-tool Bot added compatibility test Compatibility test related enhancement New feature or request labels May 29, 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 M · Status Needs Review
Confidence: 0.85 (mixed)

Reasoning

component from path globs (test-coverage, test-framework); effort from diff stats (180+1 LOC, 3 files); LLM: Adds new index type tests for text and migrates existing createIndexes tests to use the bson_type_validator framework, expanding test coverage within the compatibility tests 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.

@vic-tsang
Copy link
Copy Markdown
Collaborator Author

vic-tsang commented May 29, 2026

  • Compound text index creation succeeds ({"a": 1, "content": "text", "b": -1})
  • Wildcard text index ({"$**": "text"}) creation succeeds
  • Sparse behavior — documents without indexed field are excluded from $text results
  • Collation restriction — text index on collection with non-simple collation requires {collation: {locale: "simple"}}
  1. already lives: text_wildcard in test_createIndexes_index_types.py.
    added the rests

Signed-off-by: Victor Tsang <vitsangp@amazon.com>
@vic-tsang vic-tsang requested a review from fanyangv May 29, 2026 23:33
Comment thread documentdb_tests/compatibility/tests/core/indexes/types/text/test_text_errors.py Outdated
Signed-off-by: Victor Tsang <vitsangp@amazon.com>
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