Skip to content

Commit

Permalink
SPEC-1352 test omitting default write concern (#720)
Browse files Browse the repository at this point in the history
Adds a new spec test to the read/write concern tests that follow the transactions test format with minor additions.
  • Loading branch information
kevinAlbs committed Jan 31, 2020
1 parent 110db26 commit 4d3badb
Show file tree
Hide file tree
Showing 9 changed files with 1,403 additions and 0 deletions.
19 changes: 19 additions & 0 deletions source/read-write-concern/tests/README.rst
Expand Up @@ -52,6 +52,25 @@ array of test case objects, each of which have the following keys:
- ``isServerDefault:`` Indicates whether the read or write concern is considered the server's default.
- ``isAcknowledged:`` Indicates if the write concern should be considered acknowledged.

Operation
~~~~~~~~~

These tests check that the default write concern is omitted in operations.

The spec test format is an extension of `transactions spec tests <https://github.com/mongodb/specifications/blob/master/source/transactions/tests/README.rst>`_ with the following additions:

- ``writeConcern`` in the ``databaseOptions`` or ``collectionOptions`` may be an empty document to indicate a `server default write concern <https://github.com/mongodb/specifications/blob/master/source/read-write-concern/read-write-concern.rst#servers-default-writeconcern>`_. For example, in libmongoc:

.. code:: c
/* Create a default write concern, and set on a collection object. */
mongoc_write_concern_t *wc = mongoc_write_concern_new ();
mongoc_collection_set_write_concern (collection, wc);
If the driver has no way to explicitly set a default write concern on a database or collection, ignore the empty ``writeConcern`` document and continue with the test.
- The operations ``createIndex``, ``dropIndex`` are introduced.


Use as unit tests
=================

Expand Down

0 comments on commit 4d3badb

Please sign in to comment.