You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- ``outcome`` (optional): Document describing the expected state of the
124
-
collection after the operation is executed. Contains the following fields:
125
-
126
-
- ``collection``:
127
-
128
-
- ``name`` (optional): The name of the collection to verify. If this isn't
129
-
present then use the collection under test.
130
-
131
-
- ``data``: The data that should exist in the collection after the
132
-
operation has been run, sorted by "_id".
133
-
134
35
Legacy-v1 Test Format for Single Operations
135
36
-------------------------------------------
136
37
@@ -173,8 +74,8 @@ messages into the bulk write exception's top-level message.
173
74
Test Runner Implementation
174
75
==========================
175
76
176
-
This section provides guidance for implementing a test runner for legacy-v1 and
177
-
legacy-v2 tests. See the `unified test format spec <../../../../unified-test-format/unified-test-format.rst>`_ for how to run tests under
77
+
This section provides guidance for implementing a test runner for legacy-v1
78
+
tests. See the `unified test format spec <../../../../unified-test-format/unified-test-format.rst>`_ for how to run tests under
178
79
``unified/``.
179
80
180
81
Before running the tests:
@@ -219,8 +120,8 @@ For each test file:
219
120
220
121
- Activate command monitoring for ``localMongoClient`` and begin capturing
221
122
events. Note that some events may need to be filtered out if the driver
222
-
uses global listeners or reports internal commands (e.g. ``isMaster``,
223
-
authentication).
123
+
uses global listeners or reports internal commands (e.g. ``hello``, legacy
124
+
hello, authentication).
224
125
225
126
- For each element in the ``operations`` array:
226
127
@@ -313,9 +214,13 @@ Prose Tests
313
214
314
215
The following tests have not yet been automated, but MUST still be tested.
315
216
316
-
"errInfo" is propagated
317
-
-----------------------
318
-
Test that a writeConcernError "errInfo" is propagated to the user in whatever way is idiomatic to the driver (exception, error object, etc.). Using a 4.0+ server, set the following failpoint:
Test that ``writeConcernError.errInfo`` in a command response is propagated as
221
+
``WriteConcernError.details`` (or equivalent) in the driver.
222
+
223
+
Using a 4.0+ server, set the following failpoint:
319
224
320
225
.. code:: javascript
321
226
@@ -338,4 +243,34 @@ Test that a writeConcernError "errInfo" is propagated to the user in whatever wa
338
243
},
339
244
"mode": { "times":1 }
340
245
}
341
-
Then, perform an insert on the same database. Assert that an error occurs and that the "errInfo" is accessible and matches the one set in the failpoint.
246
+
247
+
Then, perform an insert operation and assert that a WriteConcernError occurs and
248
+
that its ``details`` property is both accessible and matches the ``errInfo``
0 commit comments