Skip to content

Add applyOps tests#624

Open
alinaliBQ wants to merge 15 commits into
documentdb:mainfrom
alinaliBQ:applyOps
Open

Add applyOps tests#624
alinaliBQ wants to merge 15 commits into
documentdb:mainfrom
alinaliBQ:applyOps

Conversation

@alinaliBQ

Copy link
Copy Markdown
Contributor

Add command operator tests for applyOps, including the smoke test. Tests database applyOps behavior, output collection, syntax, and errors. Add the ReplicationTestCase class definition.

alinaliBQ added 12 commits June 17, 2026 12:12
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
@documentdb-triage-tool documentdb-triage-tool Bot added compatibility test Compatibility test related enhancement New feature or request labels Jun 18, 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 L · Status In Progress
Confidence: 0.85 (mixed)

Reasoning

component from path globs (test-coverage, test-framework); effort from diff stats (1233+0 LOC, 11 files); LLM: Adds new applyOps command test coverage and a new ReplicationTestCase class, expanding compatibility test suite across multiple test files within one 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.

Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
@alinaliBQ alinaliBQ marked this pull request as ready for review June 18, 2026 21:18
@alinaliBQ alinaliBQ requested a review from a team as a code owner June 18, 2026 21:18
@alinaliBQ alinaliBQ changed the title Add applyOps tests Add applyOps tests Jun 18, 2026
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
docs=[{"_id": 1, "x": 1}],
command=lambda ctx: {
"applyOps": [
{"op": "i", "ns": ctx.namespace, "o": {"_id": 2, "x": 2}},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I believe in Mongo, duplicate insert doesn't fail, it upserts it, so allowAtomic true or false wouldnt matter.

Need a case where we have an op that actually fails, like maybe an 'u' instead of insert., and the earlier op still persists

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes you are right. I added a test doc_check_atomic_false_partial_commit where update (u) on non-existent id fails, and then checks doc from previous op perisists. atomic_false_partial_commit checks the error code is returned from invalid u command.

Signed-off-by: Alina (Xi) Li <Alina.Li@improving.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.

2 participants