RUBY-3566 Sync retryable writes unified spec tests from specifications repo#3044
Open
jamis wants to merge 1 commit intomongodb:masterfrom
Open
RUBY-3566 Sync retryable writes unified spec tests from specifications repo#3044jamis wants to merge 1 commit intomongodb:masterfrom
jamis wants to merge 1 commit intomongodb:masterfrom
Conversation
…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.
Contributor
There was a problem hiding this comment.
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
returnDocumentforfindOneAndReplace,sortforfindOneAndReplace/findOneAndDelete, and camelCase→snake_case key mapping in result assertions. - Skips unsupported unified operation
clientBulkWritein 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.