@@ -12,18 +12,6 @@ define and setup. Therefore, these YAML tests are in no way a replacement for
1212more thorough testing. However, they can provide an initial verification of your
1313implementation.
1414
15- Converting to JSON
16- ==================
17-
18- The tests are written in YAML because it is easier for humans to write and read,
19- and because YAML includes a standard comment format. A JSONified version of each
20- YAML file is included in this repository. Whenever a YAML file is modified, the
21- corresponding JSON file should be regenerated. One method to convert to JSON is
22- using `yamljs <https://www.npmjs.com/package/yamljs >`_::
23-
24- npm install -g yamljs
25- yaml2json -s -p -r .
26-
2715Version
2816=======
2917
@@ -44,13 +32,14 @@ Each YAML file has the following keys:
4432- ``data ``: The data that should exist in the collection under test before each
4533 test run.
4634
47- - ``minServerVersion `` (optional): The minimum server version required to
48- successfully run the test. If this field is not present, it should be assumed
49- that there is no lower bound on the server version required .
35+ - ``minServerVersion `` (optional): The minimum server version (inclusive)
36+ required to successfully run the test. If this field is not present, it should
37+ be assumed that there is no lower bound on the required server version.
5038
51- - ``maxServerVersion `` (optional): The max server version against which this
52- test can run successfully. If this field is not present, it should be assumed
53- that there is no upper bound on the server version required.
39+ - ``maxServerVersion `` (optional): The maximum server version (exclusive)
40+ against which this test can run successfully. If this field is not present,
41+ it should be assumed that there is no upper bound on the required server
42+ version.
5443
5544- ``tests ``: An array of tests that are to be run independently of each other.
5645 Each test will have some or all of the following fields:
@@ -68,7 +57,11 @@ Each YAML file has the following keys:
6857 the collection after the operation is executed. This will have some or all
6958 of the following fields:
7059
71- - ``result ``: The return value from the operation.
60+ - ``result ``: The return value from the operation. Note that some tests
61+ specify an ``upsertedCount `` field when the server does not provide
62+ one in the result document. In these cases, an ``upsertedCount `` field
63+ with a value of 0 should be manually added to the document received
64+ from the server to facilitate comparison.
7265
7366 - ``collection ``:
7467
@@ -83,6 +76,5 @@ Use as integration tests
8376
8477Running these as integration tests will require a running mongod server. Each of
8578these tests is valid against a standalone mongod, a replica set, and a sharded
86- system for server version 3.0.0. Many of them will run against 2.4 and 2.6, but
87- some will require conditional code. For instance, ``$out `` is not supported in
88- an aggregation pipeline in server 2.4, so that test must be skipped.
79+ system for server version 3.0 and later. Many of them will run against 2.6, but
80+ some will require conditional code.
0 commit comments