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
@@ -151,11 +52,13 @@ single operation. Notable differences from the legacy-v2 format are as follows:
151
52
fields.
152
53
153
54
- Instead of a top-level ``runOn`` field, server requirements are denoted by
154
-
separate top-level ``minServerVersion`` and ``maxServerVersion`` fields. The
155
-
minimum server version is an inclusive lower bound for running the test. The
156
-
maximum server version is an exclusive upper bound for running the test. If a
157
-
field is not present, it should be assumed that there is no corresponding bound
158
-
on the required server version.
55
+
separate top-level ``minServerVersion``, ``maxServerVersion``, and
56
+
``serverless`` fields. The minimum server version is an inclusive lower bound
57
+
for running the test. The maximum server version is an exclusive upper bound
58
+
for running the test. If a field is not present, it should be assumed that
59
+
there is no corresponding bound on the required server version. The
60
+
``serverless`` requirement behaves the same as the ``serverless`` field of the
61
+
`unified test format's runOnRequirement <../../unified-test-format/unified-test-format.rst#runonrequirement>`_.
159
62
160
63
The legacy-v1 format should not conflict with the newer, multi-operation format
161
64
used by other specs (e.g. Transactions). It is possible to create a unified test
@@ -173,8 +76,8 @@ messages into the bulk write exception's top-level message.
173
76
Test Runner Implementation
174
77
==========================
175
78
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
79
+
This section provides guidance for implementing a test runner for legacy-v1
80
+
tests. See the `unified test format spec <../../../../unified-test-format/unified-test-format.rst>`_ for how to run tests under
178
81
``unified/``.
179
82
180
83
Before running the tests:
@@ -219,8 +122,8 @@ For each test file:
219
122
220
123
- Activate command monitoring for ``localMongoClient`` and begin capturing
221
124
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).
125
+
uses global listeners or reports internal commands (e.g. ``hello``, legacy
126
+
hello, authentication).
224
127
225
128
- For each element in the ``operations`` array:
226
129
@@ -313,9 +216,13 @@ Prose Tests
313
216
314
217
The following tests have not yet been automated, but MUST still be tested.
315
218
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
223
+
``WriteConcernError.details`` (or equivalent) in the driver.
224
+
225
+
Using a 4.0+ server, set the following failpoint:
319
226
320
227
.. code:: javascript
321
228
@@ -338,4 +245,34 @@ Test that a writeConcernError "errInfo" is propagated to the user in whatever wa
338
245
},
339
246
"mode": { "times":1 }
340
247
}
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.
248
+
249
+
Then, perform an insert operation and assert that a WriteConcernError occurs and
250
+
that its ``details`` property is both accessible and matches the ``errInfo``
0 commit comments