[JAVA-2849] Spec tests should use the same format for bulk writes Created: 02/May/18  Updated: 28/Oct/23  Resolved: 20/Sep/18

Status: Closed
Project: Java Driver
Component/s: Test Coverage
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Rathi Gnanasekaran Assignee: Jonathan Ma
Resolution: Fixed Votes: 0
Labels: newgrad
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by DRIVERS-480 Spec tests should use the same format... Closed

 Description   

There are three changes, the first two are breaking.

The two breaking changes are in three command-monitoring tests: "bulkWrite.yml", "unacknowledgedBulkWrite.yml" and "insertMany.yml":

https://github.com/mongodb/specifications/commit/bebf9b688f64afdec46a860f102bad0841b04c02

The format of the "requests" array and "ordered" option changes from this:

    operation:
      name: "bulkWrite"
      arguments:
        requests:
          - insertOne: 
              document: { _id: 4, x: 44 }
        ordered: false

To this:

    operation:
      name: "bulkWrite"
      arguments:
        requests:
          - name: "insertOne"
            arguments:
              document: { _id: 4, x: 44 }
        options:
          ordered: false

This brings Command Monitoring tests in line with the Retryable Writes and forthcoming Transactions tests.

The non-breaking change is in the Retryable Writes tests:

https://github.com/mongodb/specifications/commit/c0ce96daac5661f2603bfa52c9b3f683c176a292

Before, the tests said in prose that all MongoClients should be created with retryWrites=true. Now, the tests include the following YAML:

        clientOptions:
            retryWrites: true

The clientOptions are the same for all Retryable Writes tests. Interpreting this field now will prepare you for the Transactions tests, which make real use of the field.



 Comments   
Comment by Githook User [ 20/Sep/18 ]

Author:

{'name': 'Jonathan', 'email': 'thejonathanma@gmail.com', 'username': 'thejonathanma'}

Message: Update bulkwrite spec tests

This commit updates the bulkwrite spec tests, including adding a
new spec test 'unacknowledgedBulkWrite.json'. CommandMonitoringTest
was updated to account for the new bulkwrite spec tests format.

JAVA-2849
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/ccd74b3a6954b22843f5601ed76c52154e85c428

Comment by Jonathan Ma [ 18/Sep/18 ]

Retryable Writes spec tests were already updated and the Java tests were already updated to account for the format changes in the spec tests. 

Generated at Thu Feb 08 08:58:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.