Skip to content

RUBY-3566 Sync retryable writes unified spec tests from specifications repo#3044

Open
jamis wants to merge 1 commit intomongodb:masterfrom
jamis:3566-convert-prose-to-spec
Open

RUBY-3566 Sync retryable writes unified spec tests from specifications repo#3044
jamis wants to merge 1 commit intomongodb:masterfrom
jamis:3566-convert-prose-to-spec

Conversation

@jamis
Copy link
Copy Markdown
Contributor

@jamis jamis commented May 8, 2026

Adds 22 new YAML spec files and updates 3 existing ones from the MongoDB specifications repository (DRIVERS-943), converting prose tests for retryable write command construction to unified spec format.

Also fixes the unified spec runner to handle returnDocument in findOneAndReplace, adds sort support to findOneAndReplace and findOneAndDelete, skips unsupported clientBulkWrite operations, and handles camelCase-to-snake_case key mapping in result assertions.

…s repo

Adds 22 new YAML spec files and updates 3 existing ones from the MongoDB
specifications repository (DRIVERS-943), converting prose tests for
retryable write command construction to unified spec format.

Also fixes the unified spec runner to handle returnDocument in
findOneAndReplace, adds sort support to findOneAndReplace and
findOneAndDelete, skips unsupported clientBulkWrite operations,
and handles camelCase-to-snake_case key mapping in result assertions.
Copilot AI review requested due to automatic review settings May 8, 2026 20:12
@jamis jamis requested a review from a team as a code owner May 8, 2026 20:12
@jamis jamis requested a review from comandeo-mongo May 8, 2026 20:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Syncs retryable writes unified spec tests from the MongoDB specifications repository and updates the Ruby unified spec runner to support new unified-spec behaviors required by these tests.

Changes:

  • Added unified-spec YAML coverage for retryable write command construction across CRUD write operations (including error-label and server-error scenarios).
  • Updated the unified runner to support returnDocument for findOneAndReplace, sort for findOneAndReplace/findOneAndDelete, and camelCase→snake_case key mapping in result assertions.
  • Skips unsupported unified operation clientBulkWrite in the runner.

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated no comments.

Show a summary per file
File Description
spec/spec_tests/data/retryable_writes/unified/updateOne.yml Adds unified specs for updateOne retryable write commit/abort scenarios and expected txnNumber behavior.
spec/spec_tests/data/retryable_writes/unified/updateOne-serverErrors.yml Adds server-error focused unified spec coverage for updateOne connection failures and error labels.
spec/spec_tests/data/retryable_writes/unified/updateOne-errorLabels.yml Adds unified specs asserting driver retry behavior based on server-provided/missing RetryableWriteError labels.
spec/spec_tests/data/retryable_writes/unified/updateMany.yml Adds unified spec asserting updateMany does not use txnNumber (non-retryable).
spec/spec_tests/data/retryable_writes/unified/unacknowledged-write-concern.yml Adds unified spec asserting unacknowledged writes (w: 0) do not set txnNumber.
spec/spec_tests/data/retryable_writes/unified/replaceOne.yml Adds unified specs for replaceOne retryable write commit/abort scenarios and txnNumber presence.
spec/spec_tests/data/retryable_writes/unified/replaceOne-serverErrors.yml Adds server-error focused unified spec coverage for replaceOne connection failures and error labels.
spec/spec_tests/data/retryable_writes/unified/replaceOne-errorLabels.yml Adds label-driven retry behavior tests for replaceOne.
spec/spec_tests/data/retryable_writes/unified/insertOne.yml Adds unified specs for insertOne retryable write commit/abort scenarios and txnNumber presence.
spec/spec_tests/data/retryable_writes/unified/insertOne-serverErrors.yml Updates/expands insertOne server error scenarios including label derivation rules and connection failures.
spec/spec_tests/data/retryable_writes/unified/handshakeError.yml Expands handshake failure retry coverage, including tests involving clientBulkWrite (to be skipped if unsupported).
spec/spec_tests/data/retryable_writes/unified/findOneAndUpdate.yml Adds unified specs for retryable findOneAndUpdate (findAndModify) with returnDocument.
spec/spec_tests/data/retryable_writes/unified/findOneAndUpdate-serverErrors.yml Adds findOneAndUpdate connection failure / label behavior unified specs.
spec/spec_tests/data/retryable_writes/unified/findOneAndUpdate-errorLabels.yml Adds label-driven retry behavior tests for findOneAndUpdate.
spec/spec_tests/data/retryable_writes/unified/findOneAndReplace.yml Adds unified specs for retryable findOneAndReplace with returnDocument.
spec/spec_tests/data/retryable_writes/unified/findOneAndReplace-serverErrors.yml Adds findOneAndReplace connection failure / label behavior unified specs.
spec/spec_tests/data/retryable_writes/unified/findOneAndReplace-errorLabels.yml Adds label-driven retry behavior tests for findOneAndReplace.
spec/spec_tests/data/retryable_writes/unified/findOneAndDelete.yml Adds unified specs for retryable findOneAndDelete, including sort usage.
spec/spec_tests/data/retryable_writes/unified/findOneAndDelete-serverErrors.yml Adds findOneAndDelete connection failure / label behavior unified specs.
spec/spec_tests/data/retryable_writes/unified/findOneAndDelete-errorLabels.yml Adds label-driven retry behavior tests for findOneAndDelete.
spec/spec_tests/data/retryable_writes/unified/deleteOne.yml Adds unified specs for deleteOne retryable write commit/abort scenarios and txnNumber presence.
spec/spec_tests/data/retryable_writes/unified/deleteOne-serverErrors.yml Adds deleteOne connection failure / label behavior unified specs.
spec/spec_tests/data/retryable_writes/unified/deleteOne-errorLabels.yml Adds label-driven retry behavior tests for deleteOne.
spec/spec_tests/data/retryable_writes/unified/deleteMany.yml Adds unified spec asserting deleteMany does not use txnNumber (non-retryable).
spec/spec_tests/data/retryable_writes/unified/bulkWrite.yml Adds unified specs for retryable behavior across bulkWrite command sequencing and txnNumber rules.
spec/spec_tests/data/retryable_writes/unified/bulkWrite-serverErrors.yml Updates/adds bulkWrite server error scenarios including connection failures and label behavior.
spec/spec_tests/data/retryable_writes/unified/bulkWrite-errorLabels.yml Adds label-driven retry behavior tests for bulkWrite.
spec/spec_tests/data/retryable_writes/unified/aggregate-out-merge.yml Adds unified specs asserting $out/$merge pipelines do not set txnNumber.
spec/runners/unified/test.rb Skips unsupported unified operation clientBulkWrite (underscored to client_bulk_write).
spec/runners/unified/crud_operations.rb Adds sort handling for find-and-modify delete/replace and implements returnDocument mapping for findOneAndReplace.
spec/runners/unified/assertions.rb Implements camelCase→snake_case mapping when asserting values from Mongo::Operation::Result.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants