Skip to content

Add query and write tests for bulkWrite#630

Open
vic-tsang wants to merge 1 commit into
documentdb:mainfrom
vic-tsang:query/write/bulkWrite/tests
Open

Add query and write tests for bulkWrite#630
vic-tsang wants to merge 1 commit into
documentdb:mainfrom
vic-tsang:query/write/bulkWrite/tests

Conversation

@vic-tsang

Copy link
Copy Markdown
Collaborator

This PR contains:

  • query and write tests for bulkWrite

Ref:

Signed-off-by: Victor [C] Tsang <vitsangp@amazon.com>
@vic-tsang vic-tsang requested a review from a team as a code owner June 19, 2026 19:01
@documentdb-triage-tool documentdb-triage-tool Bot added compatibility test Compatibility test related enhancement New feature or request labels Jun 19, 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); effort from diff stats (3039+48 LOC, 12 files); LLM: Adds new query and write test cases for bulkWrite operations, expanding test coverage for an existing feature area.

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.

@SaiPradyumn

Copy link
Copy Markdown

Missing: delete on view. The "update_on_view" test verifies updates are rejected, but the delete path is a separate op discriminator and should also be validated.

},
expected={"ok": 1.0, "nMatched": 1, "nModified": 1},
msg="bulkWrite update should accept an aggregation pipeline",
),

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: replacement-style update (updateMods with no $ operators). The bulkWrite spec supports three update modes — operator ({$set: ...}), pipeline ([{$set: ...}]), and replacement ({x: 99}). Operator and pipeline are tested here, but replacement is absent. This is a distinct server code path where the entire document body is replaced (non-_id fields removed).

@@ -0,0 +1,608 @@
"""Tests for bulkWrite error and rejection cases."""

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: arrayFilters success path. test_bulkWrite_errors.py verifies invalid arrayFilters produce
errors, but there's no test proving that a valid arrayFilters + $[identifier] update modifies the
correct nested elements.

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.

2 participants