Skip to content

Add collMod command tests#626

Open
danielfrankcom wants to merge 1 commit into
documentdb:mainfrom
danielfrankcom:pr/collMod
Open

Add collMod command tests#626
danielfrankcom wants to merge 1 commit into
documentdb:mainfrom
danielfrankcom:pr/collMod

Conversation

@danielfrankcom

@danielfrankcom danielfrankcom commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

This change adds tests for the collMod collection command.

Closes #350

Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
@danielfrankcom danielfrankcom requested a review from a team as a code owner June 18, 2026 23:28
@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 (6398+0 LOC, 25 files); LLM: Adds new test coverage for the collMod command, expanding compatibility test suite for an existing 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.

@documentdb-triage-tool documentdb-triage-tool Bot added compatibility test Compatibility test related enhancement New feature or request labels Jun 19, 2026
error_code=test.error_code,
msg=test.msg,
raw_res=True,
)

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 unknown field at case sensitive tests for top level field as well?

{"collMod": ctx.collection, "unknownField": "hello"}UNRECOGNIZED_COMMAND_FIELD_ERROR

{"collMod": ctx.collection, "CappedSize": 100000}UNRECOGNIZED_COMMAND_FIELD_ERROR

# concern (a number above 1, an unrecognized string tag, the empty string, or
# null) is rejected up front on a standalone with a BadValue error, since a
# standalone can never satisfy a quorum concern.
COLLMOD_WRITE_CONCERN_W_QUORUM_STANDALONE_ERROR_TESTS: list[CommandTestCase] = [

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

should this mark with standalone marker?

@@ -0,0 +1,410 @@
"""Tests for collMod validator."""

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

  1. $jsonSchema in validator to validate the real documents
  2. An empty validator {} clearing a previously-set validator (reset to no validation)

@@ -0,0 +1,353 @@
"""Tests for collMod index expireAfterSeconds."""

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 test to collmod expireAtseconds on special index types, including:

  1. Wildcard index
  2. hashed index
  3. geospatial index
  4. text index
  5. vector index

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.

Add compatibility test for collMod

2 participants