From d4aa44ec5137a79e38f89eaa17c37e5d1751f46c Mon Sep 17 00:00:00 2001 From: Divjot Arora Date: Mon, 12 Apr 2021 22:04:43 -0400 Subject: [PATCH 01/11] DRIVERS-555 Unified test format changes for CSOT --- .../{schema-1.4.json => schema-1.5.json} | 27 ++- source/unified-test-format/tests/Makefile | 2 +- ...ctionOrDatabaseOptions-timeoutMS-type.json | 27 +++ ...ectionOrDatabaseOptions-timeoutMS-type.yml | 17 ++ .../expectedError-isTimeoutError-type.json | 25 +++ .../expectedError-isTimeoutError-type.yml | 15 ++ ...lCollectionData-additionalProperties.json} | 5 +- ...alCollectionData-additionalProperties.yml} | 3 +- ...llectionData-collectionName-required.json} | 5 +- ...ollectionData-collectionName-required.yml} | 3 +- ...alCollectionData-collectionName-type.json} | 5 +- ...ialCollectionData-collectionName-type.yml} | 3 +- ...CollectionData-collectionOptions-type.json | 39 +++++ ...lCollectionData-collectionOptions-type.yml | 25 +++ ...CollectionData-databaseName-required.json} | 5 +- ...lCollectionData-databaseName-required.yml} | 3 +- ...tialCollectionData-databaseName-type.json} | 5 +- ...itialCollectionData-databaseName-type.yml} | 3 +- ...nitialCollectionData-documents-items.json} | 5 +- ...initialCollectionData-documents-items.yml} | 3 +- ...ialCollectionData-documents-required.json} | 5 +- ...tialCollectionData-documents-required.yml} | 3 +- ...initialCollectionData-documents-type.json} | 5 +- ... initialCollectionData-documents-type.yml} | 3 +- ...meCollectionData-additionalProperties.json | 39 +++++ ...omeCollectionData-additionalProperties.yml | 24 +++ ...ollectionData-collectionName-required.json | 37 ++++ ...CollectionData-collectionName-required.yml | 22 +++ ...omeCollectionData-collectionName-type.json | 38 ++++ ...comeCollectionData-collectionName-type.yml | 23 +++ ...eCollectionData-databaseName-required.json | 37 ++++ ...meCollectionData-databaseName-required.yml | 22 +++ ...tcomeCollectionData-databaseName-type.json | 38 ++++ ...utcomeCollectionData-databaseName-type.yml | 23 +++ ...outcomeCollectionData-documents-items.json | 40 +++++ .../outcomeCollectionData-documents-items.yml | 23 +++ ...comeCollectionData-documents-required.json | 37 ++++ ...tcomeCollectionData-documents-required.yml | 22 +++ .../outcomeCollectionData-documents-type.json | 38 ++++ .../outcomeCollectionData-documents-type.yml | 23 +++ .../valid-pass/entity-cursor-iterateOnce.json | 108 ++++++++++++ .../valid-pass/entity-cursor-iterateOnce.yml | 58 +++++++ ...itialCollectionData-collectionOptions.json | 63 +++++++ ...nitialCollectionData-collectionOptions.yml | 39 +++++ .../valid-pass/matches-lte-operator.json | 78 +++++++++ .../tests/valid-pass/matches-lte-operator.yml | 40 +++++ .../unified-test-format.rst | 162 +++++++++++++----- 47 files changed, 1190 insertions(+), 85 deletions(-) rename source/unified-test-format/{schema-1.4.json => schema-1.5.json} (94%) create mode 100644 source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.json create mode 100644 source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.yml create mode 100644 source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.json create mode 100644 source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.yml rename source/unified-test-format/tests/invalid/{collectionData-additionalProperties.json => initialCollectionData-additionalProperties.json} (84%) rename source/unified-test-format/tests/invalid/{collectionData-additionalProperties.yml => initialCollectionData-additionalProperties.yml} (88%) rename source/unified-test-format/tests/invalid/{collectionData-collectionName-required.json => initialCollectionData-collectionName-required.json} (82%) rename source/unified-test-format/tests/invalid/{collectionData-collectionName-required.yml => initialCollectionData-collectionName-required.yml} (86%) rename source/unified-test-format/tests/invalid/{collectionData-collectionName-type.json => initialCollectionData-collectionName-type.json} (83%) rename source/unified-test-format/tests/invalid/{collectionData-collectionName-type.yml => initialCollectionData-collectionName-type.yml} (87%) create mode 100644 source/unified-test-format/tests/invalid/initialCollectionData-collectionOptions-type.json create mode 100644 source/unified-test-format/tests/invalid/initialCollectionData-collectionOptions-type.yml rename source/unified-test-format/tests/invalid/{collectionData-databaseName-required.json => initialCollectionData-databaseName-required.json} (82%) rename source/unified-test-format/tests/invalid/{collectionData-databaseName-required.yml => initialCollectionData-databaseName-required.yml} (87%) rename source/unified-test-format/tests/invalid/{collectionData-databaseName-type.json => initialCollectionData-databaseName-type.json} (84%) rename source/unified-test-format/tests/invalid/{collectionData-databaseName-type.yml => initialCollectionData-databaseName-type.yml} (88%) rename source/unified-test-format/tests/invalid/{collectionData-documents-items.json => initialCollectionData-documents-items.json} (84%) rename source/unified-test-format/tests/invalid/{collectionData-documents-items.yml => initialCollectionData-documents-items.yml} (88%) rename source/unified-test-format/tests/invalid/{collectionData-documents-required.json => initialCollectionData-documents-required.json} (83%) rename source/unified-test-format/tests/invalid/{collectionData-documents-required.yml => initialCollectionData-documents-required.yml} (87%) rename source/unified-test-format/tests/invalid/{collectionData-documents-type.json => initialCollectionData-documents-type.json} (84%) rename source/unified-test-format/tests/invalid/{collectionData-documents-type.yml => initialCollectionData-documents-type.yml} (88%) create mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-additionalProperties.json create mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-additionalProperties.yml create mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-required.json create mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-required.yml create mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-type.json create mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-type.yml create mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-required.json create mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-required.yml create mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-type.json create mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-type.yml create mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-documents-items.json create mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-documents-items.yml create mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-documents-required.json create mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-documents-required.yml create mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-documents-type.json create mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-documents-type.yml create mode 100644 source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.json create mode 100644 source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.yml create mode 100644 source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.json create mode 100644 source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.yml create mode 100644 source/unified-test-format/tests/valid-pass/matches-lte-operator.json create mode 100644 source/unified-test-format/tests/valid-pass/matches-lte-operator.yml diff --git a/source/unified-test-format/schema-1.4.json b/source/unified-test-format/schema-1.5.json similarity index 94% rename from source/unified-test-format/schema-1.4.json rename to source/unified-test-format/schema-1.5.json index b5f9f38eee..beb77f29c6 100644 --- a/source/unified-test-format/schema-1.4.json +++ b/source/unified-test-format/schema-1.5.json @@ -21,7 +21,7 @@ "initialData": { "type": "array", "minItems": 1, - "items": { "$ref": "#/definitions/collectionData" } + "items": { "$ref": "#/definitions/initialCollectionData" } }, "tests": { "type": "array", @@ -194,7 +194,22 @@ } }, - "collectionData": { + "initialCollectionData": { + "type": "object", + "additionalProperties": false, + "required": ["collectionName", "databaseName", "documents"], + "properties": { + "collectionName": { "type": "string" }, + "databaseName": { "type": "string" }, + "collectionOptions": { "type": "object" }, + "documents": { + "type": "array", + "items": { "type": "object" } + } + } + }, + + "outcomeCollectionData": { "type": "object", "additionalProperties": false, "required": ["collectionName", "databaseName", "documents"], @@ -366,7 +381,8 @@ "properties": { "readConcern": { "type": "object" }, "readPreference": { "type": "object" }, - "writeConcern": { "type": "object" } + "writeConcern": { "type": "object" }, + "timeoutMS": { "type": "number" } } }, @@ -426,7 +442,8 @@ "minItems": 1, "items": { "type": "string" } }, - "expectResult": {} + "expectResult": {}, + "isTimeoutError": { "type": "boolean" } } }, @@ -453,7 +470,7 @@ "outcome": { "type": "array", "minItems": 1, - "items": { "$ref": "#/definitions/collectionData" } + "items": { "$ref": "#/definitions/outcomeCollectionData" } } } } diff --git a/source/unified-test-format/tests/Makefile b/source/unified-test-format/tests/Makefile index a12a0e2ce9..205946c1b6 100644 --- a/source/unified-test-format/tests/Makefile +++ b/source/unified-test-format/tests/Makefile @@ -1,4 +1,4 @@ -SCHEMA=../schema-1.4.json +SCHEMA=../schema-1.5.json .PHONY: all invalid valid-fail valid-pass versioned-api load-balancers gridfs transactions crud HAS_AJV diff --git a/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.json b/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.json new file mode 100644 index 0000000000..c1159092af --- /dev/null +++ b/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.json @@ -0,0 +1,27 @@ +{ + "description": "collectionOrDatabaseOptions-timeoutMS-type", + "schemaVersion": "1.5", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo", + "databaseOptions": { + "timeoutMS": {} + } + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.yml b/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.yml new file mode 100644 index 0000000000..d022096fbd --- /dev/null +++ b/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.yml @@ -0,0 +1,17 @@ +description: "collectionOrDatabaseOptions-timeoutMS-type" + +schemaVersion: "1.5" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: "foo" + databaseOptions: + timeoutMS: {} + +tests: + - description: "foo" + operations: [] diff --git a/source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.json b/source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.json new file mode 100644 index 0000000000..bf537668db --- /dev/null +++ b/source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.json @@ -0,0 +1,25 @@ +{ + "description": "expectedError-isTimeoutError-type", + "schemaVersion": "1.5", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectError": { + "isTimeoutError": 0 + } + } + ] + } + ] +} diff --git a/source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.yml b/source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.yml new file mode 100644 index 0000000000..3585efbc92 --- /dev/null +++ b/source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.yml @@ -0,0 +1,15 @@ +description: "expectedError-isTimeoutError-type" + +schemaVersion: "1.5" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectError: + isTimeoutError: 0 diff --git a/source/unified-test-format/tests/invalid/collectionData-additionalProperties.json b/source/unified-test-format/tests/invalid/initialCollectionData-additionalProperties.json similarity index 84% rename from source/unified-test-format/tests/invalid/collectionData-additionalProperties.json rename to source/unified-test-format/tests/invalid/initialCollectionData-additionalProperties.json index 2d85093109..656fa841ea 100644 --- a/source/unified-test-format/tests/invalid/collectionData-additionalProperties.json +++ b/source/unified-test-format/tests/invalid/initialCollectionData-additionalProperties.json @@ -1,5 +1,5 @@ { - "description": "collectionData-additionalProperties", + "description": "initialCollectionData-additionalProperties", "schemaVersion": "1.0", "createEntities": [ { @@ -18,8 +18,7 @@ "collection": { "id": "collection0", "database": "database0", - "collectionName": "foo", - "foo": 0 + "collectionName": "foo" } } ], diff --git a/source/unified-test-format/tests/invalid/collectionData-additionalProperties.yml b/source/unified-test-format/tests/invalid/initialCollectionData-additionalProperties.yml similarity index 88% rename from source/unified-test-format/tests/invalid/collectionData-additionalProperties.yml rename to source/unified-test-format/tests/invalid/initialCollectionData-additionalProperties.yml index 6a2256a639..d46a6084d4 100644 --- a/source/unified-test-format/tests/invalid/collectionData-additionalProperties.yml +++ b/source/unified-test-format/tests/invalid/initialCollectionData-additionalProperties.yml @@ -1,4 +1,4 @@ -description: "collectionData-additionalProperties" +description: "initialCollectionData-additionalProperties" schemaVersion: "1.0" @@ -13,7 +13,6 @@ createEntities: id: &collection0 "collection0" database: *database0 collectionName: &collection0Name "foo" - foo: 0 initialData: - collectionName: *collection0Name diff --git a/source/unified-test-format/tests/invalid/collectionData-collectionName-required.json b/source/unified-test-format/tests/invalid/initialCollectionData-collectionName-required.json similarity index 82% rename from source/unified-test-format/tests/invalid/collectionData-collectionName-required.json rename to source/unified-test-format/tests/invalid/initialCollectionData-collectionName-required.json index 040dd86a1c..7a84199439 100644 --- a/source/unified-test-format/tests/invalid/collectionData-collectionName-required.json +++ b/source/unified-test-format/tests/invalid/initialCollectionData-collectionName-required.json @@ -1,5 +1,5 @@ { - "description": "collectionData-collectionName-required", + "description": "initialCollectionData-collectionName-required", "schemaVersion": "1.0", "createEntities": [ { @@ -18,8 +18,7 @@ "collection": { "id": "collection0", "database": "database0", - "collectionName": "foo", - "foo": 0 + "collectionName": "foo" } } ], diff --git a/source/unified-test-format/tests/invalid/collectionData-collectionName-required.yml b/source/unified-test-format/tests/invalid/initialCollectionData-collectionName-required.yml similarity index 86% rename from source/unified-test-format/tests/invalid/collectionData-collectionName-required.yml rename to source/unified-test-format/tests/invalid/initialCollectionData-collectionName-required.yml index 2f20805581..5ea6b9a863 100644 --- a/source/unified-test-format/tests/invalid/collectionData-collectionName-required.yml +++ b/source/unified-test-format/tests/invalid/initialCollectionData-collectionName-required.yml @@ -1,4 +1,4 @@ -description: "collectionData-collectionName-required" +description: "initialCollectionData-collectionName-required" schemaVersion: "1.0" @@ -13,7 +13,6 @@ createEntities: id: &collection0 "collection0" database: *database0 collectionName: &collection0Name "foo" - foo: 0 initialData: - databaseName: *database0Name diff --git a/source/unified-test-format/tests/invalid/collectionData-collectionName-type.json b/source/unified-test-format/tests/invalid/initialCollectionData-collectionName-type.json similarity index 83% rename from source/unified-test-format/tests/invalid/collectionData-collectionName-type.json rename to source/unified-test-format/tests/invalid/initialCollectionData-collectionName-type.json index 676d822e5e..aba8ee935c 100644 --- a/source/unified-test-format/tests/invalid/collectionData-collectionName-type.json +++ b/source/unified-test-format/tests/invalid/initialCollectionData-collectionName-type.json @@ -1,5 +1,5 @@ { - "description": "collectionData-collectionName-type", + "description": "initialCollectionData-collectionName-type", "schemaVersion": "1.0", "createEntities": [ { @@ -18,8 +18,7 @@ "collection": { "id": "collection0", "database": "database0", - "collectionName": "foo", - "foo": 0 + "collectionName": "foo" } } ], diff --git a/source/unified-test-format/tests/invalid/collectionData-collectionName-type.yml b/source/unified-test-format/tests/invalid/initialCollectionData-collectionName-type.yml similarity index 87% rename from source/unified-test-format/tests/invalid/collectionData-collectionName-type.yml rename to source/unified-test-format/tests/invalid/initialCollectionData-collectionName-type.yml index a9da0e0129..bcf0d4a520 100644 --- a/source/unified-test-format/tests/invalid/collectionData-collectionName-type.yml +++ b/source/unified-test-format/tests/invalid/initialCollectionData-collectionName-type.yml @@ -1,4 +1,4 @@ -description: "collectionData-collectionName-type" +description: "initialCollectionData-collectionName-type" schemaVersion: "1.0" @@ -13,7 +13,6 @@ createEntities: id: &collection0 "collection0" database: *database0 collectionName: &collection0Name "foo" - foo: 0 initialData: - collectionName: 0 diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-collectionOptions-type.json b/source/unified-test-format/tests/invalid/initialCollectionData-collectionOptions-type.json new file mode 100644 index 0000000000..99911129b7 --- /dev/null +++ b/source/unified-test-format/tests/invalid/initialCollectionData-collectionOptions-type.json @@ -0,0 +1,39 @@ +{ + "description": "initialCollectionData-collectionOptions-type", + "schemaVersion": "1.5", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "foo" + } + } + ], + "initialData": [ + { + "collectionName": "foo", + "databaseName": "foo", + "collectionOptions": 0, + "documents": [] + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-collectionOptions-type.yml b/source/unified-test-format/tests/invalid/initialCollectionData-collectionOptions-type.yml new file mode 100644 index 0000000000..1e23e4b774 --- /dev/null +++ b/source/unified-test-format/tests/invalid/initialCollectionData-collectionOptions-type.yml @@ -0,0 +1,25 @@ +description: "initialCollectionData-collectionOptions-type" + +schemaVersion: "1.5" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: &database0Name "foo" + - collection: + id: &collection0 "collection0" + database: *database0 + collectionName: &collection0Name "foo" + +initialData: + - collectionName: *collection0Name + databaseName: *database0Name + collectionOptions: 0 + documents: [] + +tests: + - description: "foo" + operations: [] diff --git a/source/unified-test-format/tests/invalid/collectionData-databaseName-required.json b/source/unified-test-format/tests/invalid/initialCollectionData-databaseName-required.json similarity index 82% rename from source/unified-test-format/tests/invalid/collectionData-databaseName-required.json rename to source/unified-test-format/tests/invalid/initialCollectionData-databaseName-required.json index 7548f9d5be..29dcf37111 100644 --- a/source/unified-test-format/tests/invalid/collectionData-databaseName-required.json +++ b/source/unified-test-format/tests/invalid/initialCollectionData-databaseName-required.json @@ -1,5 +1,5 @@ { - "description": "collectionData-databaseName-required", + "description": "initialCollectionData-databaseName-required", "schemaVersion": "1.0", "createEntities": [ { @@ -18,8 +18,7 @@ "collection": { "id": "collection0", "database": "database0", - "collectionName": "foo", - "foo": 0 + "collectionName": "foo" } } ], diff --git a/source/unified-test-format/tests/invalid/collectionData-databaseName-required.yml b/source/unified-test-format/tests/invalid/initialCollectionData-databaseName-required.yml similarity index 87% rename from source/unified-test-format/tests/invalid/collectionData-databaseName-required.yml rename to source/unified-test-format/tests/invalid/initialCollectionData-databaseName-required.yml index d8d6e4d571..65b1a72d1c 100644 --- a/source/unified-test-format/tests/invalid/collectionData-databaseName-required.yml +++ b/source/unified-test-format/tests/invalid/initialCollectionData-databaseName-required.yml @@ -1,4 +1,4 @@ -description: "collectionData-databaseName-required" +description: "initialCollectionData-databaseName-required" schemaVersion: "1.0" @@ -13,7 +13,6 @@ createEntities: id: &collection0 "collection0" database: *database0 collectionName: &collection0Name "foo" - foo: 0 initialData: - collectionName: *collection0Name diff --git a/source/unified-test-format/tests/invalid/collectionData-databaseName-type.json b/source/unified-test-format/tests/invalid/initialCollectionData-databaseName-type.json similarity index 84% rename from source/unified-test-format/tests/invalid/collectionData-databaseName-type.json rename to source/unified-test-format/tests/invalid/initialCollectionData-databaseName-type.json index ef719bbf6a..daf8c44242 100644 --- a/source/unified-test-format/tests/invalid/collectionData-databaseName-type.json +++ b/source/unified-test-format/tests/invalid/initialCollectionData-databaseName-type.json @@ -1,5 +1,5 @@ { - "description": "collectionData-databaseName-type", + "description": "initialCollectionData-databaseName-type", "schemaVersion": "1.0", "createEntities": [ { @@ -18,8 +18,7 @@ "collection": { "id": "collection0", "database": "database0", - "collectionName": "foo", - "foo": 0 + "collectionName": "foo" } } ], diff --git a/source/unified-test-format/tests/invalid/collectionData-databaseName-type.yml b/source/unified-test-format/tests/invalid/initialCollectionData-databaseName-type.yml similarity index 88% rename from source/unified-test-format/tests/invalid/collectionData-databaseName-type.yml rename to source/unified-test-format/tests/invalid/initialCollectionData-databaseName-type.yml index 27dfaafee1..5d0907554b 100644 --- a/source/unified-test-format/tests/invalid/collectionData-databaseName-type.yml +++ b/source/unified-test-format/tests/invalid/initialCollectionData-databaseName-type.yml @@ -1,4 +1,4 @@ -description: "collectionData-databaseName-type" +description: "initialCollectionData-databaseName-type" schemaVersion: "1.0" @@ -13,7 +13,6 @@ createEntities: id: &collection0 "collection0" database: *database0 collectionName: &collection0Name "foo" - foo: 0 initialData: - collectionName: *collection0Name diff --git a/source/unified-test-format/tests/invalid/collectionData-documents-items.json b/source/unified-test-format/tests/invalid/initialCollectionData-documents-items.json similarity index 84% rename from source/unified-test-format/tests/invalid/collectionData-documents-items.json rename to source/unified-test-format/tests/invalid/initialCollectionData-documents-items.json index 2916718d50..2c8071bacf 100644 --- a/source/unified-test-format/tests/invalid/collectionData-documents-items.json +++ b/source/unified-test-format/tests/invalid/initialCollectionData-documents-items.json @@ -1,5 +1,5 @@ { - "description": "collectionData-documents-items", + "description": "initialCollectionData-documents-items", "schemaVersion": "1.0", "createEntities": [ { @@ -18,8 +18,7 @@ "collection": { "id": "collection0", "database": "database0", - "collectionName": "foo", - "foo": 0 + "collectionName": "foo" } } ], diff --git a/source/unified-test-format/tests/invalid/collectionData-documents-items.yml b/source/unified-test-format/tests/invalid/initialCollectionData-documents-items.yml similarity index 88% rename from source/unified-test-format/tests/invalid/collectionData-documents-items.yml rename to source/unified-test-format/tests/invalid/initialCollectionData-documents-items.yml index 6e860e896f..44523a7bc3 100644 --- a/source/unified-test-format/tests/invalid/collectionData-documents-items.yml +++ b/source/unified-test-format/tests/invalid/initialCollectionData-documents-items.yml @@ -1,4 +1,4 @@ -description: "collectionData-documents-items" +description: "initialCollectionData-documents-items" schemaVersion: "1.0" @@ -13,7 +13,6 @@ createEntities: id: &collection0 "collection0" database: *database0 collectionName: &collection0Name "foo" - foo: 0 initialData: - collectionName: *collection0Name diff --git a/source/unified-test-format/tests/invalid/collectionData-documents-required.json b/source/unified-test-format/tests/invalid/initialCollectionData-documents-required.json similarity index 83% rename from source/unified-test-format/tests/invalid/collectionData-documents-required.json rename to source/unified-test-format/tests/invalid/initialCollectionData-documents-required.json index 7b8a7ead2a..f45a9d711d 100644 --- a/source/unified-test-format/tests/invalid/collectionData-documents-required.json +++ b/source/unified-test-format/tests/invalid/initialCollectionData-documents-required.json @@ -1,5 +1,5 @@ { - "description": "collectionData-documents-required", + "description": "initialCollectionData-documents-required", "schemaVersion": "1.0", "createEntities": [ { @@ -18,8 +18,7 @@ "collection": { "id": "collection0", "database": "database0", - "collectionName": "foo", - "foo": 0 + "collectionName": "foo" } } ], diff --git a/source/unified-test-format/tests/invalid/collectionData-documents-required.yml b/source/unified-test-format/tests/invalid/initialCollectionData-documents-required.yml similarity index 87% rename from source/unified-test-format/tests/invalid/collectionData-documents-required.yml rename to source/unified-test-format/tests/invalid/initialCollectionData-documents-required.yml index 0452842bc7..e83315933a 100644 --- a/source/unified-test-format/tests/invalid/collectionData-documents-required.yml +++ b/source/unified-test-format/tests/invalid/initialCollectionData-documents-required.yml @@ -1,4 +1,4 @@ -description: "collectionData-documents-required" +description: "initialCollectionData-documents-required" schemaVersion: "1.0" @@ -13,7 +13,6 @@ createEntities: id: &collection0 "collection0" database: *database0 collectionName: &collection0Name "foo" - foo: 0 initialData: - collectionName: *collection0Name diff --git a/source/unified-test-format/tests/invalid/collectionData-documents-type.json b/source/unified-test-format/tests/invalid/initialCollectionData-documents-type.json similarity index 84% rename from source/unified-test-format/tests/invalid/collectionData-documents-type.json rename to source/unified-test-format/tests/invalid/initialCollectionData-documents-type.json index 953cabae6e..1ce6041a9a 100644 --- a/source/unified-test-format/tests/invalid/collectionData-documents-type.json +++ b/source/unified-test-format/tests/invalid/initialCollectionData-documents-type.json @@ -1,5 +1,5 @@ { - "description": "collectionData-documents-type", + "description": "initialCollectionData-documents-type", "schemaVersion": "1.0", "createEntities": [ { @@ -18,8 +18,7 @@ "collection": { "id": "collection0", "database": "database0", - "collectionName": "foo", - "foo": 0 + "collectionName": "foo" } } ], diff --git a/source/unified-test-format/tests/invalid/collectionData-documents-type.yml b/source/unified-test-format/tests/invalid/initialCollectionData-documents-type.yml similarity index 88% rename from source/unified-test-format/tests/invalid/collectionData-documents-type.yml rename to source/unified-test-format/tests/invalid/initialCollectionData-documents-type.yml index db6d8b417a..bfea6cbb8f 100644 --- a/source/unified-test-format/tests/invalid/collectionData-documents-type.yml +++ b/source/unified-test-format/tests/invalid/initialCollectionData-documents-type.yml @@ -1,4 +1,4 @@ -description: "collectionData-documents-type" +description: "initialCollectionData-documents-type" schemaVersion: "1.0" @@ -13,7 +13,6 @@ createEntities: id: &collection0 "collection0" database: *database0 collectionName: &collection0Name "foo" - foo: 0 initialData: - collectionName: *collection0Name diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-additionalProperties.json b/source/unified-test-format/tests/invalid/outcomeCollectionData-additionalProperties.json new file mode 100644 index 0000000000..302013ee18 --- /dev/null +++ b/source/unified-test-format/tests/invalid/outcomeCollectionData-additionalProperties.json @@ -0,0 +1,39 @@ +{ + "description": "outcomeCollectionData-additionalProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "foo" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [], + "outcome": [ + { + "collectionName": "foo", + "databaseName": "foo", + "documents": [], + "foo": 0 + } + ] + } + ] +} diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-additionalProperties.yml b/source/unified-test-format/tests/invalid/outcomeCollectionData-additionalProperties.yml new file mode 100644 index 0000000000..7f7343044e --- /dev/null +++ b/source/unified-test-format/tests/invalid/outcomeCollectionData-additionalProperties.yml @@ -0,0 +1,24 @@ +description: "outcomeCollectionData-additionalProperties" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: &database0Name "foo" + - collection: + id: &collection0 "collection0" + database: *database0 + collectionName: &collection0Name "foo" + +tests: + - description: "foo" + operations: [] + outcome: + - collectionName: *collection0Name + databaseName: *database0Name + documents: [] + foo: 0 diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-required.json b/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-required.json new file mode 100644 index 0000000000..c0ba9aabb2 --- /dev/null +++ b/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-required.json @@ -0,0 +1,37 @@ +{ + "description": "outcomeCollectionData-collectionName-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "foo" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [], + "outcome": [ + { + "databaseName": "foo", + "documents": [] + } + ] + } + ] +} diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-required.yml b/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-required.yml new file mode 100644 index 0000000000..669e557be7 --- /dev/null +++ b/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-required.yml @@ -0,0 +1,22 @@ +description: "outcomeCollectionData-collectionName-required" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: &database0Name "foo" + - collection: + id: &collection0 "collection0" + database: *database0 + collectionName: &collection0Name "foo" + +tests: + - description: "foo" + operations: [] + outcome: + - databaseName: *database0Name + documents: [] diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-type.json b/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-type.json new file mode 100644 index 0000000000..6f8f82dd1b --- /dev/null +++ b/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-type.json @@ -0,0 +1,38 @@ +{ + "description": "outcomeCollectionData-collectionName-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "foo" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [], + "outcome": [ + { + "collectionName": 0, + "databaseName": "foo", + "documents": [] + } + ] + } + ] +} diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-type.yml b/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-type.yml new file mode 100644 index 0000000000..59af07d31f --- /dev/null +++ b/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-type.yml @@ -0,0 +1,23 @@ +description: "outcomeCollectionData-collectionName-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: &database0Name "foo" + - collection: + id: &collection0 "collection0" + database: *database0 + collectionName: &collection0Name "foo" + +tests: + - description: "foo" + operations: [] + outcome: + - collectionName: 0 + databaseName: *database0Name + documents: [] diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-required.json b/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-required.json new file mode 100644 index 0000000000..76c9fbacde --- /dev/null +++ b/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-required.json @@ -0,0 +1,37 @@ +{ + "description": "outcomeCollectionData-databaseName-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "foo" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [], + "outcome": [ + { + "collectionName": "foo", + "documents": [] + } + ] + } + ] +} diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-required.yml b/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-required.yml new file mode 100644 index 0000000000..f6f560e016 --- /dev/null +++ b/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-required.yml @@ -0,0 +1,22 @@ +description: "outcomeCollectionData-databaseName-required" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: &database0Name "foo" + - collection: + id: &collection0 "collection0" + database: *database0 + collectionName: &collection0Name "foo" + +tests: + - description: "foo" + operations: [] + outcome: + - collectionName: *collection0Name + documents: [] diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-type.json b/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-type.json new file mode 100644 index 0000000000..72560fdfaf --- /dev/null +++ b/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-type.json @@ -0,0 +1,38 @@ +{ + "description": "outcomeCollectionData-databaseName-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "foo" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [], + "outcome": [ + { + "collectionName": "foo", + "databaseName": 0, + "documents": [] + } + ] + } + ] +} diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-type.yml b/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-type.yml new file mode 100644 index 0000000000..1dd9c3f5a5 --- /dev/null +++ b/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-type.yml @@ -0,0 +1,23 @@ +description: "outcomeCollectionData-databaseName-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: &database0Name "foo" + - collection: + id: &collection0 "collection0" + database: *database0 + collectionName: &collection0Name "foo" + +tests: + - description: "foo" + operations: [] + outcome: + - collectionName: *collection0Name + databaseName: 0 + documents: [] diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-items.json b/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-items.json new file mode 100644 index 0000000000..507202ea9f --- /dev/null +++ b/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-items.json @@ -0,0 +1,40 @@ +{ + "description": "outcomeCollectionData-documents-items", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "foo" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [], + "outcome": [ + { + "collectionName": "foo", + "databaseName": "foo", + "documents": [ + 0 + ] + } + ] + } + ] +} diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-items.yml b/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-items.yml new file mode 100644 index 0000000000..c20ec8b220 --- /dev/null +++ b/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-items.yml @@ -0,0 +1,23 @@ +description: "outcomeCollectionData-documents-items" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: &database0Name "foo" + - collection: + id: &collection0 "collection0" + database: *database0 + collectionName: &collection0Name "foo" + +tests: + - description: "foo" + operations: [] + outcome: + - collectionName: *collection0Name + databaseName: *database0Name + documents: [0] diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-required.json b/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-required.json new file mode 100644 index 0000000000..1ceee96aba --- /dev/null +++ b/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-required.json @@ -0,0 +1,37 @@ +{ + "description": "outcomeCollectionData-documents-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "foo" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [], + "outcome": [ + { + "collectionName": "foo", + "databaseName": "foo" + } + ] + } + ] +} diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-required.yml b/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-required.yml new file mode 100644 index 0000000000..d047c2aa0c --- /dev/null +++ b/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-required.yml @@ -0,0 +1,22 @@ +description: "outcomeCollectionData-documents-required" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: &database0Name "foo" + - collection: + id: &collection0 "collection0" + database: *database0 + collectionName: &collection0Name "foo" + +tests: + - description: "foo" + operations: [] + outcome: + - collectionName: *collection0Name + databaseName: *database0Name diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-type.json b/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-type.json new file mode 100644 index 0000000000..f55e793018 --- /dev/null +++ b/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-type.json @@ -0,0 +1,38 @@ +{ + "description": "outcomeCollectionData-documents-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "foo" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [], + "outcome": [ + { + "collectionName": "foo", + "databaseName": "foo", + "documents": 0 + } + ] + } + ] +} diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-type.yml b/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-type.yml new file mode 100644 index 0000000000..dfca60d13d --- /dev/null +++ b/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-type.yml @@ -0,0 +1,23 @@ +description: "outcomeCollectionData-documents-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: &database0Name "foo" + - collection: + id: &collection0 "collection0" + database: *database0 + collectionName: &collection0Name "foo" + +tests: + - description: "foo" + operations: [] + outcome: + - collectionName: *collection0Name + databaseName: *database0Name + documents: 0 diff --git a/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.json b/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.json new file mode 100644 index 0000000000..dd9db29799 --- /dev/null +++ b/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.json @@ -0,0 +1,108 @@ +{ + "description": "entity-cursor-iterateOnce", + "schemaVersion": "1.5", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "database0" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "initialData": [ + { + "databaseName": "database0", + "collectionName": "coll0", + "documents": [ + { + "_id": 1 + }, + { + "_id": 2 + }, + { + "_id": 3 + } + ] + } + ], + "tests": [ + { + "description": "iterateOnce", + "operations": [ + { + "name": "createFindCursor", + "object": "collection0", + "arguments": { + "filter": {}, + "batchSize": 2 + }, + "saveResultAsEntity": "cursor0" + }, + { + "name": "iterateUntilDocumentOrError", + "object": "cursor0", + "expectResult": { + "_id": 1 + } + }, + { + "name": "iterateUntilDocumentOrError", + "object": "cursor0", + "expectResult": { + "_id": 2 + } + }, + { + "name": "iterateOnce", + "object": "cursor0" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll0", + "filter": {}, + "batchSize": 2 + }, + "commandName": "find", + "databaseName": "database0" + } + }, + { + "commandStartedEvent": { + "command": { + "getMore": { + "$$type": "long" + }, + "collection": "coll0" + }, + "commandName": "getMore" + } + } + ] + } + ] + } + ] +} diff --git a/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.yml b/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.yml new file mode 100644 index 0000000000..bc8b9240a5 --- /dev/null +++ b/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.yml @@ -0,0 +1,58 @@ +description: entity-cursor-iterateOnce + +schemaVersion: '1.5' + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name database0 + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +initialData: + - databaseName: *database0Name + collectionName: *collection0Name + documents: + - _id: 1 + - _id: 2 + - _id: 3 + +tests: + - description: iterateOnce + operations: + - name: createFindCursor + object: *collection0 + arguments: + filter: {} + batchSize: 2 + saveResultAsEntity: &cursor0 cursor0 + - name: iterateUntilDocumentOrError + object: *cursor0 + expectResult: { _id: 1 } + - name: iterateUntilDocumentOrError + object: *cursor0 + expectResult: { _id: 2 } + # This operation could be iterateUntilDocumentOrError, but we use iterateOne to ensure that drivers support it. + - name: iterateOnce + object: *cursor0 + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + find: *collection0Name + filter: {} + batchSize: 2 + commandName: find + databaseName: *database0Name + - commandStartedEvent: + command: + getMore: { $$type: long } + collection: *collection0Name + commandName: getMore diff --git a/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.json b/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.json new file mode 100644 index 0000000000..b24e80a37b --- /dev/null +++ b/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.json @@ -0,0 +1,63 @@ +{ + "description": "initialCollectionData-collectionOptions", + "schemaVersion": "1.5", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "database0" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "initialData": [ + { + "collectionName": "coll0", + "databaseName": "database0", + "collectionOptions": { + "capped": true, + "size": 512 + }, + "documents": [ + { + "_id": 1, + "x": 11 + } + ] + } + ], + "tests": [ + { + "description": "collection is created with the correct options", + "operations": [ + { + "name": "runCommand", + "object": "database0", + "arguments": { + "commandName": "collStats", + "command": { + "collStats": "coll0", + "scale": 1 + } + }, + "expectResult": { + "capped": true, + "maxSize": 512 + } + } + ] + } + ] +} diff --git a/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.yml b/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.yml new file mode 100644 index 0000000000..ac5425f9ec --- /dev/null +++ b/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.yml @@ -0,0 +1,39 @@ +description: initialCollectionData-collectionOptions + +schemaVersion: '1.5' + +createEntities: + - client: + id: &client0 client0 + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name database0 + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +initialData: + - collectionName: *collection0Name + databaseName: *database0Name + collectionOptions: + capped: true + size: &cappedSize 512 + documents: + - { _id: 1, x: 11 } + +tests: + - description: collection is created with the correct options + operations: + # Execute a collStats command to ensure the collection was created with the correct options. + - name: runCommand + object: *database0 + arguments: + commandName: collStats + command: + collStats: *collection0Name + scale: 1 + expectResult: + capped: true + maxSize: *cappedSize diff --git a/source/unified-test-format/tests/valid-pass/matches-lte-operator.json b/source/unified-test-format/tests/valid-pass/matches-lte-operator.json new file mode 100644 index 0000000000..04136c17e0 --- /dev/null +++ b/source/unified-test-format/tests/valid-pass/matches-lte-operator.json @@ -0,0 +1,78 @@ +{ + "description": "matches-lte-operator", + "schemaVersion": "1.5", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "database0Name" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "initialData": [ + { + "collectionName": "coll0", + "databaseName": "database0Name", + "documents": [] + } + ], + "tests": [ + { + "description": "special lte matching operator", + "operations": [ + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "document": { + "_id": 1, + "y": 1 + } + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "insert": "coll0", + "documents": [ + { + "_id": { + "$$lte": 1 + }, + "y": { + "$$lte": 2 + } + } + ] + }, + "commandName": "insert", + "databaseName": "database0Name" + } + } + ] + } + ] + } + ] +} diff --git a/source/unified-test-format/tests/valid-pass/matches-lte-operator.yml b/source/unified-test-format/tests/valid-pass/matches-lte-operator.yml new file mode 100644 index 0000000000..598f1056cc --- /dev/null +++ b/source/unified-test-format/tests/valid-pass/matches-lte-operator.yml @@ -0,0 +1,40 @@ +description: matches-lte-operator + +schemaVersion: '1.5' + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name database0Name + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + +initialData: + - collectionName: *collection0Name + databaseName: *database0Name + documents: [] + +tests: + - description: special lte matching operator + operations: + - name: insertOne + object: *collection0 + arguments: + document: { _id : 1, y: 1 } + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + insert: *collection0Name + documents: + # We can make exact assertions here but we use the $$lte operator to ensure drivers support it. + - { _id: { $$lte: 1 }, y: { $$lte: 2 } } + commandName: insert + databaseName: *database0Name diff --git a/source/unified-test-format/unified-test-format.rst b/source/unified-test-format/unified-test-format.rst index 15ab46aeb3..a43a0dfeab 100644 --- a/source/unified-test-format/unified-test-format.rst +++ b/source/unified-test-format/unified-test-format.rst @@ -3,13 +3,13 @@ Unified Test Format =================== :Spec Title: Unified Test Format -:Spec Version: 1.4.0 +:Spec Version: 1.5.0 :Author: Jeremy Mikola :Advisors: Prashant Mital, Isabel Atkinson, Thomas Reggi :Status: Accepted :Type: Standards :Minimum Server Version: N/A -:Last Modified: 2021-04-19 +:Last Modified: 2021-04-29 .. contents:: @@ -340,13 +340,9 @@ The top-level fields of a test file are as follows: .. _initialData: -- ``initialData``: Optional array of one or more `collectionData`_ objects. Data - that will exist in collections before each test case is executed. - - Before each test and for each `collectionData`_, the test runner MUST drop the - collection and insert the specified documents (if any) using a "majority" - write concern. If no documents are specified, the test runner MUST create the - collection with a "majority" write concern. +- ``initialData``: Optional array of one or more `initialCollectionData`_ + objects. Data that will exist in collections before each test case is + executed. .. _tests: @@ -736,12 +732,34 @@ See the `Versioned API <../versioned-api/versioned-api.rst>`__ spec for more details on these fields. -collectionData -~~~~~~~~~~~~~~ +initialCollectionData +~~~~~~~~~~~~~~~~~~~~~ -List of documents corresponding to the contents of a collection. This structure -is used by both `initialData`_ and `test.outcome `_, which insert -and read documents, respectively. +List of documents corresponding to the contents of a collection. This +structure is used by `initialData`_. + +The structure of this object is as follows: + +- ``collectionName``: Required string. See `commonOptions_collectionName`_. + +- ``databaseName``: Required string. See `commonOptions_databaseName`_. + +- ``collectionOptions``: Optional object. Options that MUST be passed to the + `create `_ command + when creating the collection. Test files SHOULD NOT specify ``writeConcern`` + in this options document as that could conflict with the use of the + ``majority`` write concern when the collection is created during test + execution. + +- ``documents``: Required array of objects. List of documents corresponding to + the contents of the collection. This list may be empty. + + +outcomeCollectionData +~~~~~~~~~~~~~~~~~~~~~ + +List of documents corresponding to the contents of a collection. This +structure is used by `test.outcome `_. The structure of this object is as follows: @@ -806,8 +824,9 @@ The structure of this object is as follows: .. _test_outcome: -- ``outcome``: Optional array of one or more `collectionData`_ objects. Data - that is expected to exist in collections after each test case is executed. +- ``outcome``: Optional array of one or more `outcomeCollectionData`_ + objects. Data that is expected to exist in collections after each test case + is executed. The list of documents herein SHOULD be sorted ascendingly by the ``_id`` field to allow for deterministic comparisons. The procedure for asserting collection @@ -913,6 +932,11 @@ The structure of this object is as follows: Client errors include, but are not limited to: parameter validation errors before a command is sent to the server; network errors. +- ``isTimeoutError``: Optional boolean. If true, the test runner MUST assert + that the error represents a timeout due to use of the ``timeoutMS`` option. + If false, the test runner MUST assert that the error does not represent a + timeout. + - ``errorContains``: Optional string. A substring of the expected error message (e.g. "errmsg" field in a server error document). The test runner MUST assert that the error message contains this string using a case-insensitive match. @@ -1740,6 +1764,14 @@ mechanisms for iteration may differ between synchronous and asynchronous drivers. To account for this, this section explicitly defines the supported operations for the ``ChangeStream`` and ``FindCursor`` entity types. +Test runners MUST ensure that the iteration operations defined in this +section will not inadvertently skip the first document for a cursor. Albeit +rare, this could happen if an operation were to blindly invoke ``next`` (or +equivalent) on a cursor in a driver where newly created cursors are already +positioned at their first element and the cursor had a non-empty +``firstBatch``. Alternatively, some drivers may use a different iterator +method for advancing a cursor to its first position (e.g. ``rewind`` in PHP). + iterateUntilDocumentOrError ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1755,14 +1787,19 @@ to block indefinitely. This should not be a concern for ``iterateUntilDocumentOrError`` as iteration only continues until either a document or error is encountered. -Test runners MUST ensure that this operation will not inadvertently skip the -first document in a cursor. Albeit rare, this could happen if -``iterateUntilDocumentOrError`` were to blindly invoke ``next`` (or -equivalent) on a cursor in a driver where newly created cursors are already -positioned at their first element and the cursor had a non-empty -``firstBatch`` (i.e. ``resumeAfter`` or ``startAfter`` used). Alternatively, -some drivers may use a different iterator method for advancing a cursor to -its first position (e.g. ``rewind`` in PHP). +iterateOnce +~~~~~~~~~~~ + +Performs a single iteration of the cursor. If the cursor's current batch is +empty, one ``getMore`` MUST be attempted to get more results. This operation +takes no arguments. If `expectResult `_ is +specified, it SHOULD be a single document. + +Due to the non-deterministic nature of some cursor types (e.g. change streams +on sharded clusters), test files SHOULD only use this operation to perform +command monitoring assertions on the ``getMore`` command. Tests that perform +assertions about the result of iteration should use +`iterateUntilDocumentOrError`_ instead. close ~~~~~ @@ -2137,6 +2174,29 @@ An example of this operation follows:: Use a ``listIndexes`` command to check whether the index exists. Note that it is currently not possible to run ``listIndexes`` from within a transaction. +createEntities +~~~~~~~~~~~~~~ + +The ``createEntities`` operation instructs the test runner to create the +provided entities and store them in the current test's `Entity Map`_. + +- ``entities``: Required array of one or more `entity`_ objects. As with the + file-level `createEntities`_ directive, test files SHOULD declare entities in + dependency order, such that all referenced entities are defined before any of + their dependent entities. + +An example of this operation follows:: + + - name: createEntities + object: testRunner + arguments: + entities: + - client: + id: &client0 client0 + - database: + id: &database0 database0 + client: *client0 + databaseName: &databaseName test loop ~~~~ @@ -2637,6 +2697,21 @@ An example of this operator follows:: lsid: { $$sessionLsid: *session0 } +$$lte +````` + +Syntax:: + + { $$lte: 5 } + +This operator can be used anywhere a matched value is expected (including +`expectResult `_). The test runner MUST assert that +the actual value is less than or equal to the specified value. Test runners +MUST also apply the rules specified in `Flexible Numeric Comparisons`_ for +this operator. For example, an expected value of ``1`` would match an actual +value of ``1.0`` and ``0.0`` but would not match ``1.1``. + + Test Runner Implementation -------------------------- @@ -2722,11 +2797,14 @@ If `test.runOnRequirements `_ is specified, the test runner MUST skip the test unless one or more `runOnRequirement`_ objects are satisfied. -If `initialData`_ is specified, for each `collectionData`_ therein the test -runner MUST drop the collection and insert the specified documents (if any) -using a "majority" write concern. If no documents are specified, the test runner -MUST create the collection with a "majority" write concern. The test runner -MUST use the internal MongoClient for these operations. +If `initialData`_ is specified, for each `initialCollectionData`_ therein the +test runner MUST set up the collection. All setup operations MUST use the +internal MongoClient and a "majority" write concern. The test runner MUST +first drop the collection. If a ``collectionOptions`` document is present, +the test runner MUST execute a ``create`` command to create the collection +with the specified options. The test runner MUST then insert the specified +documents (if any). If no documents are present and ``collectionOptions`` is +not set, the test runner MUST create the collection. Create a new `Entity Map`_ that will be used for this test. If `createEntities`_ is specified, the test runner MUST create each `entity`_ accordingly and add it @@ -2787,15 +2865,16 @@ client. If the list of expected events is empty, the test runner MUST assert that no events were observed on the client. The process for matching events is described in `expectedEvent`_. -If `test.outcome `_ is specified, for each `collectionData`_ -therein the test runner MUST assert that the collection contains exactly the -expected data. The test runner MUST query each collection using the internal -MongoClient, an ascending sort order on the ``_id`` field (i.e. ``{ _id: 1 }``), -a "primary" read preference, a "local" read concern. When comparing collection -data, the rules in `Evaluating Matches`_ do not apply and the documents MUST -match exactly; however, test runners MUST permit variations in document key -order or otherwise normalize the documents before comparison. If the list of -documents is empty, the test runner MUST assert that the collection is empty. +If `test.outcome `_ is specified, for each +`outcomeCollectionData`_ therein the test runner MUST assert that the +collection contains exactly the expected data. The test runner MUST query +each collection using the internal MongoClient, an ascending sort order on +the ``_id`` field (i.e. ``{ _id: 1 }``), a "primary" read preference, and a +"local" read concern. When comparing collection data, the rules in +`Evaluating Matches`_ do not apply and the documents MUST match exactly; +however, test runners MUST permit variations in document key order or +otherwise normalize the documents before comparison. If the list of documents +is empty, the test runner MUST assert that the collection is empty. Before clearing the entity map at the end of each test, the test runner MUST allow its entities to be accessed externally. The exact mechanism for @@ -2811,7 +2890,8 @@ the test runner MUST end the session (e.g. call `endSession <../sessions/driver-sessions.rst#endsession>`_). For each ChangeStream and FindCursor in the entity map, the test runner MUST close the cursor. -If the test started a transaction, the test runner MUST terminate any open +If the test started a transaction (i.e. executed a ``startTransaction`` or +``withTransaction`` operation), the test runner MUST terminate any open transactions (see: `Terminating Open Transactions`_). Proceed to the subsequent test. @@ -3212,6 +3292,10 @@ spec changes developed in parallel or during the same release cycle. Change Log ========== +:2020-04-29: Added ``collectionOptions`` field to ``initialData``, introduced a + new ``timeoutMS`` field in ``collectionOrDatabaseOptions``, and + added an ``isTimeoutError`` field to ``expectedError``. + :2021-04-19: Introduce ``serverless`` `runOnRequirement`_. :2021-04-12: Added a ``FindCursor`` entity type, defined a set of cursor From c2ca520250a1db7ce3f6ccb6a8ddb865096c583c Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Fri, 22 Apr 2022 12:28:21 -0700 Subject: [PATCH 02/11] DRIVERS-555 rename schema-1.8.json --- .../{schema-1.5.json => schema-1.8.json} | 23 ++++++++++++------- source/unified-test-format/tests/Makefile | 2 +- ...ctionOrDatabaseOptions-timeoutMS-type.json | 2 +- ...ectionOrDatabaseOptions-timeoutMS-type.yml | 2 +- .../expectedError-isTimeoutError-type.json | 2 +- .../expectedError-isTimeoutError-type.yml | 2 +- ...CollectionData-collectionOptions-type.json | 2 +- ...lCollectionData-collectionOptions-type.yml | 2 +- .../unified-test-format.rst | 6 ++--- 9 files changed, 25 insertions(+), 18 deletions(-) rename source/unified-test-format/{schema-1.5.json => schema-1.8.json} (95%) diff --git a/source/unified-test-format/schema-1.5.json b/source/unified-test-format/schema-1.8.json similarity index 95% rename from source/unified-test-format/schema-1.5.json rename to source/unified-test-format/schema-1.8.json index beb77f29c6..a699fc983d 100644 --- a/source/unified-test-format/schema-1.5.json +++ b/source/unified-test-format/schema-1.8.json @@ -114,7 +114,8 @@ "minItems": 1, "items": { "$ref": "#/definitions/storeEventsAsEntity" } }, - "serverApi": { "$ref": "#/definitions/serverApi" } + "serverApi": { "$ref": "#/definitions/serverApi" }, + "observeSensitiveCommands": { "type": "boolean" } } }, "database": { @@ -233,7 +234,8 @@ "type": "string", "enum": ["command", "cmap"] }, - "events": { "type": "array" } + "events": { "type": "array" }, + "ignoreExtraEvents": { "type": "boolean" } }, "oneOf": [ { @@ -263,7 +265,8 @@ "events": { "type": "array", "items": { "$ref": "#/definitions/expectedCommandEvent" } - } + }, + "ignoreExtraEvents": { "type": "boolean" } } } ] @@ -282,7 +285,8 @@ "command": { "type": "object" }, "commandName": { "type": "string" }, "databaseName": { "type": "string" }, - "hasServiceId": { "type": "boolean" } + "hasServiceId": { "type": "boolean" }, + "hasServerConnectionId": { "type": "boolean" } } }, "commandSucceededEvent": { @@ -291,7 +295,8 @@ "properties": { "reply": { "type": "object" }, "commandName": { "type": "string" }, - "hasServiceId": { "type": "boolean" } + "hasServiceId": { "type": "boolean" }, + "hasServerConnectionId": { "type": "boolean" } } }, "commandFailedEvent": { @@ -299,7 +304,8 @@ "additionalProperties": false, "properties": { "commandName": { "type": "string" }, - "hasServiceId": { "type": "boolean" } + "hasServiceId": { "type": "boolean" }, + "hasServerConnectionId": { "type": "boolean" } } } } @@ -429,6 +435,7 @@ "const": true }, "isClientError": { "type": "boolean" }, + "isTimeoutError": { "type": "boolean" }, "errorContains": { "type": "string" }, "errorCode": { "type": "integer" }, "errorCodeName": { "type": "string" }, @@ -442,8 +449,7 @@ "minItems": 1, "items": { "type": "string" } }, - "expectResult": {}, - "isTimeoutError": { "type": "boolean" } + "expectResult": {} } }, @@ -465,6 +471,7 @@ }, "expectEvents": { "type": "array", + "minItems": 1, "items": { "$ref": "#/definitions/expectedEventsForClient" } }, "outcome": { diff --git a/source/unified-test-format/tests/Makefile b/source/unified-test-format/tests/Makefile index 205946c1b6..622eaadaa6 100644 --- a/source/unified-test-format/tests/Makefile +++ b/source/unified-test-format/tests/Makefile @@ -1,4 +1,4 @@ -SCHEMA=../schema-1.5.json +SCHEMA=../schema-1.8.json .PHONY: all invalid valid-fail valid-pass versioned-api load-balancers gridfs transactions crud HAS_AJV diff --git a/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.json b/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.json index c1159092af..184fdbb477 100644 --- a/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.json +++ b/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.json @@ -1,6 +1,6 @@ { "description": "collectionOrDatabaseOptions-timeoutMS-type", - "schemaVersion": "1.5", + "schemaVersion": "1.8", "createEntities": [ { "client": { diff --git a/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.yml b/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.yml index d022096fbd..cd75f2f977 100644 --- a/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.yml +++ b/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.yml @@ -1,6 +1,6 @@ description: "collectionOrDatabaseOptions-timeoutMS-type" -schemaVersion: "1.5" +schemaVersion: "1.8" createEntities: - client: diff --git a/source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.json b/source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.json index bf537668db..62d9a8f5b3 100644 --- a/source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.json +++ b/source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.json @@ -1,6 +1,6 @@ { "description": "expectedError-isTimeoutError-type", - "schemaVersion": "1.5", + "schemaVersion": "1.8", "createEntities": [ { "client": { diff --git a/source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.yml b/source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.yml index 3585efbc92..8b15d643b6 100644 --- a/source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.yml +++ b/source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.yml @@ -1,6 +1,6 @@ description: "expectedError-isTimeoutError-type" -schemaVersion: "1.5" +schemaVersion: "1.8" createEntities: - client: diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-collectionOptions-type.json b/source/unified-test-format/tests/invalid/initialCollectionData-collectionOptions-type.json index 99911129b7..86fe4f18cd 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-collectionOptions-type.json +++ b/source/unified-test-format/tests/invalid/initialCollectionData-collectionOptions-type.json @@ -1,6 +1,6 @@ { "description": "initialCollectionData-collectionOptions-type", - "schemaVersion": "1.5", + "schemaVersion": "1.8", "createEntities": [ { "client": { diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-collectionOptions-type.yml b/source/unified-test-format/tests/invalid/initialCollectionData-collectionOptions-type.yml index 1e23e4b774..dbfc75cd1d 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-collectionOptions-type.yml +++ b/source/unified-test-format/tests/invalid/initialCollectionData-collectionOptions-type.yml @@ -1,6 +1,6 @@ description: "initialCollectionData-collectionOptions-type" -schemaVersion: "1.5" +schemaVersion: "1.8" createEntities: - client: diff --git a/source/unified-test-format/unified-test-format.rst b/source/unified-test-format/unified-test-format.rst index a43a0dfeab..7eafdfae5e 100644 --- a/source/unified-test-format/unified-test-format.rst +++ b/source/unified-test-format/unified-test-format.rst @@ -3,13 +3,13 @@ Unified Test Format =================== :Spec Title: Unified Test Format -:Spec Version: 1.5.0 +:Spec Version: 1.8.0 :Author: Jeremy Mikola :Advisors: Prashant Mital, Isabel Atkinson, Thomas Reggi :Status: Accepted :Type: Standards :Minimum Server Version: N/A -:Last Modified: 2021-04-29 +:Last Modified: 2022-04-22 .. contents:: @@ -3292,7 +3292,7 @@ spec changes developed in parallel or during the same release cycle. Change Log ========== -:2020-04-29: Added ``collectionOptions`` field to ``initialData``, introduced a +:2022-04-22: Added ``collectionOptions`` field to ``initialData``, introduced a new ``timeoutMS`` field in ``collectionOrDatabaseOptions``, and added an ``isTimeoutError`` field to ``expectedError``. From 48136eee25e60ff2e7b964a17d81c8fe5d5a5c97 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Fri, 22 Apr 2022 14:08:37 -0700 Subject: [PATCH 03/11] DRIVERS-555 Restore schema-1.4.json --- source/unified-test-format/schema-1.4.json | 462 +++++++++++++++++++++ 1 file changed, 462 insertions(+) create mode 100644 source/unified-test-format/schema-1.4.json diff --git a/source/unified-test-format/schema-1.4.json b/source/unified-test-format/schema-1.4.json new file mode 100644 index 0000000000..f259b629d1 --- /dev/null +++ b/source/unified-test-format/schema-1.4.json @@ -0,0 +1,462 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + + "title": "Unified Test Format", + "type": "object", + "additionalProperties": false, + "required": ["description", "schemaVersion", "tests"], + "properties": { + "description": { "type": "string" }, + "schemaVersion": { "$ref": "#/definitions/version" }, + "runOnRequirements": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#/definitions/runOnRequirement" } + }, + "createEntities": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#/definitions/entity" } + }, + "initialData": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#/definitions/collectionData" } + }, + "tests": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#/definitions/test" } + }, + "_yamlAnchors": { + "type": "object", + "additionalProperties": true + } + }, + + "definitions": { + "version": { + "type": "string", + "pattern": "^[0-9]+(\\.[0-9]+){1,2}$" + }, + + "runOnRequirement": { + "type": "object", + "additionalProperties": false, + "minProperties": 1, + "properties": { + "maxServerVersion": { "$ref": "#/definitions/version" }, + "minServerVersion": { "$ref": "#/definitions/version" }, + "topologies": { + "type": "array", + "minItems": 1, + "items": { + "type": "string", + "enum": ["single", "replicaset", "sharded", "sharded-replicaset", "load-balanced"] + } + }, + "serverless": { + "type": "string", + "enum": ["require", "forbid", "allow"] + }, + "serverParameters": { + "type": "object", + "minProperties": 1 + }, + "auth": { "type": "boolean" } + } + }, + + "entity": { + "type": "object", + "additionalProperties": false, + "maxProperties": 1, + "minProperties": 1, + "properties": { + "client": { + "type": "object", + "additionalProperties": false, + "required": ["id"], + "properties": { + "id": { "type": "string" }, + "uriOptions": { "type": "object" }, + "useMultipleMongoses": { "type": "boolean" }, + "observeEvents": { + "type": "array", + "minItems": 1, + "items": { + "type": "string", + "enum": [ + "commandStartedEvent", + "commandSucceededEvent", + "commandFailedEvent", + "poolCreatedEvent", + "poolReadyEvent", + "poolClearedEvent", + "poolClosedEvent", + "connectionCreatedEvent", + "connectionReadyEvent", + "connectionClosedEvent", + "connectionCheckOutStartedEvent", + "connectionCheckOutFailedEvent", + "connectionCheckedOutEvent", + "connectionCheckedInEvent" + ] + } + }, + "ignoreCommandMonitoringEvents": { + "type": "array", + "minItems": 1, + "items": { "type": "string" } + }, + "storeEventsAsEntities": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#/definitions/storeEventsAsEntity" } + }, + "serverApi": { "$ref": "#/definitions/serverApi" } + } + }, + "database": { + "type": "object", + "additionalProperties": false, + "required": ["id", "client", "databaseName"], + "properties": { + "id": { "type": "string" }, + "client": { "type": "string" }, + "databaseName": { "type": "string" }, + "databaseOptions": { "$ref": "#/definitions/collectionOrDatabaseOptions" } + } + }, + "collection": { + "type": "object", + "additionalProperties": false, + "required": ["id", "database", "collectionName"], + "properties": { + "id": { "type": "string" }, + "database": { "type": "string" }, + "collectionName": { "type": "string" }, + "collectionOptions": { "$ref": "#/definitions/collectionOrDatabaseOptions" } + } + }, + "session": { + "type": "object", + "additionalProperties": false, + "required": ["id", "client"], + "properties": { + "id": { "type": "string" }, + "client": { "type": "string" }, + "sessionOptions": { "type": "object" } + } + }, + "bucket": { + "type": "object", + "additionalProperties": false, + "required": ["id", "database"], + "properties": { + "id": { "type": "string" }, + "database": { "type": "string" }, + "bucketOptions": { "type": "object" } + } + } + } + }, + + "storeEventsAsEntity": { + "type": "object", + "additionalProperties": false, + "required": ["id", "events"], + "properties": { + "id": { "type": "string" }, + "events": { + "type": "array", + "minItems": 1, + "items": { + "type": "string", + "enum": [ + "PoolCreatedEvent", + "PoolReadyEvent", + "PoolClearedEvent", + "PoolClosedEvent", + "ConnectionCreatedEvent", + "ConnectionReadyEvent", + "ConnectionClosedEvent", + "ConnectionCheckOutStartedEvent", + "ConnectionCheckOutFailedEvent", + "ConnectionCheckedOutEvent", + "ConnectionCheckedInEvent", + "CommandStartedEvent", + "CommandSucceededEvent", + "CommandFailedEvent" + ] + } + } + } + }, + + "collectionData": { + "type": "object", + "additionalProperties": false, + "required": ["collectionName", "databaseName", "documents"], + "properties": { + "collectionName": { "type": "string" }, + "databaseName": { "type": "string" }, + "documents": { + "type": "array", + "items": { "type": "object" } + } + } + }, + + "expectedEventsForClient": { + "type": "object", + "additionalProperties": false, + "required": ["client", "events"], + "properties": { + "client": { "type": "string" }, + "eventType": { + "type": "string", + "enum": ["command", "cmap"] + }, + "events": { "type": "array" } + }, + "oneOf": [ + { + "required": ["eventType"], + "properties": { + "eventType": { "const": "command" }, + "events": { + "type": "array", + "items": { "$ref": "#/definitions/expectedCommandEvent" } + } + } + }, + { + "required": ["eventType"], + "properties": { + "eventType": { "const": "cmap" }, + "events": { + "type": "array", + "items": { "$ref": "#/definitions/expectedCmapEvent" } + } + } + }, + { + "additionalProperties": false, + "properties": { + "client": { "type": "string" }, + "events": { + "type": "array", + "items": { "$ref": "#/definitions/expectedCommandEvent" } + } + } + } + ] + }, + + "expectedCommandEvent": { + "type": "object", + "additionalProperties": false, + "maxProperties": 1, + "minProperties": 1, + "properties": { + "commandStartedEvent": { + "type": "object", + "additionalProperties": false, + "properties": { + "command": { "type": "object" }, + "commandName": { "type": "string" }, + "databaseName": { "type": "string" }, + "hasServiceId": { "type": "boolean" } + } + }, + "commandSucceededEvent": { + "type": "object", + "additionalProperties": false, + "properties": { + "reply": { "type": "object" }, + "commandName": { "type": "string" }, + "hasServiceId": { "type": "boolean" } + } + }, + "commandFailedEvent": { + "type": "object", + "additionalProperties": false, + "properties": { + "commandName": { "type": "string" }, + "hasServiceId": { "type": "boolean" } + } + } + } + }, + + "expectedCmapEvent": { + "type": "object", + "additionalProperties": false, + "maxProperties": 1, + "minProperties": 1, + "properties": { + "poolCreatedEvent": { + "type": "object", + "additionalProperties": false, + "properties": {} + }, + "poolReadyEvent": { + "type": "object", + "additionalProperties": false, + "properties": {} + }, + "poolClearedEvent": { + "type": "object", + "additionalProperties": false, + "properties": { + "hasServiceId": { "type": "boolean" } + } + }, + "poolClosedEvent": { + "type": "object", + "additionalProperties": false, + "properties": {} + }, + "connectionCreatedEvent": { + "type": "object", + "additionalProperties": false, + "properties": {} + }, + "connectionReadyEvent": { + "type": "object", + "additionalProperties": false, + "properties": {} + }, + "connectionClosedEvent": { + "type": "object", + "additionalProperties": false, + "properties": { + "reason": { "type": "string" } + } + }, + "connectionCheckOutStartedEvent": { + "type": "object", + "additionalProperties": false, + "properties": {} + }, + "connectionCheckOutFailedEvent": { + "type": "object", + "additionalProperties": false, + "properties": { + "reason": { "type": "string" } + } + }, + "connectionCheckedOutEvent": { + "type": "object", + "additionalProperties": false, + "properties": {} + }, + "connectionCheckedInEvent": { + "type": "object", + "additionalProperties": false, + "properties": {} + } + } + }, + + "collectionOrDatabaseOptions": { + "type": "object", + "additionalProperties": false, + "properties": { + "readConcern": { "type": "object" }, + "readPreference": { "type": "object" }, + "writeConcern": { "type": "object" } + } + }, + + "serverApi": { + "type": "object", + "additionalProperties": false, + "required": ["version"], + "properties": { + "version": { "type": "string" }, + "strict": { "type": "boolean" }, + "deprecationErrors": { "type": "boolean" } + } + }, + + "operation": { + "type": "object", + "additionalProperties": false, + "required": ["name", "object"], + "properties": { + "name": { "type": "string" }, + "object": { "type": "string" }, + "arguments": { "type": "object" }, + "ignoreResultAndError": { "type": "boolean" }, + "expectError": { "$ref": "#/definitions/expectedError" }, + "expectResult": {}, + "saveResultAsEntity": { "type": "string" } + }, + "allOf": [ + { "not": { "required": ["expectError", "expectResult"] } }, + { "not": { "required": ["expectError", "saveResultAsEntity"] } }, + { "not": { "required": ["ignoreResultAndError", "expectResult"] } }, + { "not": { "required": ["ignoreResultAndError", "expectError"] } }, + { "not": { "required": ["ignoreResultAndError", "saveResultAsEntity"] } } + ] + }, + + "expectedError": { + "type": "object", + "additionalProperties": false, + "minProperties": 1, + "properties": { + "isError": { + "type": "boolean", + "const": true + }, + "isClientError": { "type": "boolean" }, + "errorContains": { "type": "string" }, + "errorCode": { "type": "integer" }, + "errorCodeName": { "type": "string" }, + "errorLabelsContain": { + "type": "array", + "minItems": 1, + "items": { "type": "string" } + }, + "errorLabelsOmit": { + "type": "array", + "minItems": 1, + "items": { "type": "string" } + }, + "expectResult": {} + } + }, + + "test": { + "type": "object", + "additionalProperties": false, + "required": ["description", "operations"], + "properties": { + "description": { "type": "string" }, + "runOnRequirements": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#/definitions/runOnRequirement" } + }, + "skipReason": { "type": "string" }, + "operations": { + "type": "array", + "items": { "$ref": "#/definitions/operation" } + }, + "expectEvents": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#/definitions/expectedEventsForClient" } + }, + "outcome": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#/definitions/collectionData" } + } + } + } + } +} From c80874d1f434102ce221bb540f55e89cfd53023e Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Fri, 22 Apr 2022 14:14:30 -0700 Subject: [PATCH 04/11] DRIVERS-555 Require 3.6 for collStats test --- .../valid-pass/initialCollectionData-collectionOptions.json | 5 +++++ .../valid-pass/initialCollectionData-collectionOptions.yml | 3 +++ 2 files changed, 8 insertions(+) diff --git a/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.json b/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.json index b24e80a37b..9aef3d87d5 100644 --- a/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.json +++ b/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.json @@ -1,6 +1,11 @@ { "description": "initialCollectionData-collectionOptions", "schemaVersion": "1.5", + "runOnRequirements": [ + { + "minServerVersion": "3.6" + } + ], "createEntities": [ { "client": { diff --git a/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.yml b/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.yml index ac5425f9ec..690ac24cc6 100644 --- a/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.yml +++ b/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.yml @@ -2,6 +2,9 @@ description: initialCollectionData-collectionOptions schemaVersion: '1.5' +runOnRequirements: + - minServerVersion: "3.6" + createEntities: - client: id: &client0 client0 From ff0b3c94e42ce9ce56200994ec07fa4ac758b8c8 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Fri, 22 Apr 2022 14:30:45 -0700 Subject: [PATCH 05/11] DRIVERS-555 Add valid-pass test for createEntities operation --- .../valid-pass/createEntities-operation.json | 96 +++++++++++++++++++ .../valid-pass/createEntities-operation.yml | 52 ++++++++++ .../valid-pass/entity-cursor-iterateOnce.json | 2 +- .../valid-pass/entity-cursor-iterateOnce.yml | 2 +- ...itialCollectionData-collectionOptions.json | 2 +- ...nitialCollectionData-collectionOptions.yml | 2 +- .../valid-pass/matches-lte-operator.json | 2 +- .../tests/valid-pass/matches-lte-operator.yml | 2 +- 8 files changed, 154 insertions(+), 6 deletions(-) create mode 100644 source/unified-test-format/tests/valid-pass/createEntities-operation.json create mode 100644 source/unified-test-format/tests/valid-pass/createEntities-operation.yml diff --git a/source/unified-test-format/tests/valid-pass/createEntities-operation.json b/source/unified-test-format/tests/valid-pass/createEntities-operation.json new file mode 100644 index 0000000000..52bf2eabe1 --- /dev/null +++ b/source/unified-test-format/tests/valid-pass/createEntities-operation.json @@ -0,0 +1,96 @@ +{ + "description": "createEntities-operation", + "schemaVersion": "1.8", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "database0" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "collection0" + } + } + ], + "initialData": [ + { + "collectionName": "collection0", + "databaseName": "database0", + "documents": [] + } + ], + "tests": [ + { + "description": "createEntities operation", + "operations": [ + { + "name": "createEntities", + "object": "testRunner", + "arguments": { + "entities": [ + { + "client": { + "id": "client1" + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "database1" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "collection1" + } + } + ] + } + }, + { + "name": "insertOne", + "object": "collection1", + "arguments": { + "document": { + "_id": 1 + } + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "insert": "collection1", + "documents": [ + { + "_id": 1 + } + ] + }, + "commandName": "insert", + "databaseName": "database1" + } + } + ] + } + ] + } + ] +} diff --git a/source/unified-test-format/tests/valid-pass/createEntities-operation.yml b/source/unified-test-format/tests/valid-pass/createEntities-operation.yml new file mode 100644 index 0000000000..9ea000fce0 --- /dev/null +++ b/source/unified-test-format/tests/valid-pass/createEntities-operation.yml @@ -0,0 +1,52 @@ +description: createEntities-operation + +schemaVersion: "1.8" + +createEntities: + - client: + id: client0 + - database: + id: database0 + client: client0 + databaseName: database0 + - collection: + id: collection0 + database: database0 + collectionName: collection0 + +initialData: + - collectionName: collection0 + databaseName: database0 + documents: [] + +tests: + - description: createEntities operation + operations: + - name: createEntities + object: testRunner + arguments: + entities: + - client: + id: client1 + - database: + id: database1 + client: client1 + databaseName: database1 + - collection: + id: collection1 + database: database1 + collectionName: collection1 + - name: insertOne + object: collection1 + arguments: + document: { _id : 1 } + expectEvents: + - client: client1 + events: + - commandStartedEvent: + command: + insert: collection1 + documents: + - { _id: 1 } + commandName: insert + databaseName: database1 diff --git a/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.json b/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.json index dd9db29799..ee864d9b73 100644 --- a/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.json +++ b/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.json @@ -1,6 +1,6 @@ { "description": "entity-cursor-iterateOnce", - "schemaVersion": "1.5", + "schemaVersion": "1.8", "createEntities": [ { "client": { diff --git a/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.yml b/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.yml index bc8b9240a5..bf1265e28b 100644 --- a/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.yml +++ b/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.yml @@ -1,6 +1,6 @@ description: entity-cursor-iterateOnce -schemaVersion: '1.5' +schemaVersion: "1.8" createEntities: - client: diff --git a/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.json b/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.json index 9aef3d87d5..8f07e399a4 100644 --- a/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.json +++ b/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.json @@ -1,6 +1,6 @@ { "description": "initialCollectionData-collectionOptions", - "schemaVersion": "1.5", + "schemaVersion": "1.8", "runOnRequirements": [ { "minServerVersion": "3.6" diff --git a/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.yml b/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.yml index 690ac24cc6..471423f742 100644 --- a/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.yml +++ b/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.yml @@ -1,6 +1,6 @@ description: initialCollectionData-collectionOptions -schemaVersion: '1.5' +schemaVersion: "1.8" runOnRequirements: - minServerVersion: "3.6" diff --git a/source/unified-test-format/tests/valid-pass/matches-lte-operator.json b/source/unified-test-format/tests/valid-pass/matches-lte-operator.json index 04136c17e0..54973b2846 100644 --- a/source/unified-test-format/tests/valid-pass/matches-lte-operator.json +++ b/source/unified-test-format/tests/valid-pass/matches-lte-operator.json @@ -1,6 +1,6 @@ { "description": "matches-lte-operator", - "schemaVersion": "1.5", + "schemaVersion": "1.8", "createEntities": [ { "client": { diff --git a/source/unified-test-format/tests/valid-pass/matches-lte-operator.yml b/source/unified-test-format/tests/valid-pass/matches-lte-operator.yml index 598f1056cc..681c8700ae 100644 --- a/source/unified-test-format/tests/valid-pass/matches-lte-operator.yml +++ b/source/unified-test-format/tests/valid-pass/matches-lte-operator.yml @@ -1,6 +1,6 @@ description: matches-lte-operator -schemaVersion: '1.5' +schemaVersion: "1.8" createEntities: - client: From 8ff24eec0d1ff699d630a379a2e93120d17f5a51 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Fri, 22 Apr 2022 15:25:41 -0700 Subject: [PATCH 06/11] DRIVERS-555 Fix createEntities test --- .../valid-pass/createEntities-operation.json | 20 ++++++++++++------- .../valid-pass/createEntities-operation.yml | 14 +++++++------ 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/source/unified-test-format/tests/valid-pass/createEntities-operation.json b/source/unified-test-format/tests/valid-pass/createEntities-operation.json index 52bf2eabe1..013ea58909 100644 --- a/source/unified-test-format/tests/valid-pass/createEntities-operation.json +++ b/source/unified-test-format/tests/valid-pass/createEntities-operation.json @@ -40,7 +40,10 @@ "entities": [ { "client": { - "id": "client1" + "id": "client1", + "observeEvents": [ + "commandStartedEvent" + ] } }, { @@ -61,10 +64,10 @@ } }, { - "name": "insertOne", + "name": "deleteOne", "object": "collection1", "arguments": { - "document": { + "filter": { "_id": 1 } } @@ -77,14 +80,17 @@ { "commandStartedEvent": { "command": { - "insert": "collection1", - "documents": [ + "delete": "collection1", + "deletes": [ { - "_id": 1 + "q": { + "_id": 1 + }, + "limit": 1 } ] }, - "commandName": "insert", + "commandName": "delete", "databaseName": "database1" } } diff --git a/source/unified-test-format/tests/valid-pass/createEntities-operation.yml b/source/unified-test-format/tests/valid-pass/createEntities-operation.yml index 9ea000fce0..61fdb5f38a 100644 --- a/source/unified-test-format/tests/valid-pass/createEntities-operation.yml +++ b/source/unified-test-format/tests/valid-pass/createEntities-operation.yml @@ -28,6 +28,7 @@ tests: entities: - client: id: client1 + observeEvents: [ commandStartedEvent ] - database: id: database1 client: client1 @@ -36,17 +37,18 @@ tests: id: collection1 database: database1 collectionName: collection1 - - name: insertOne + - name: deleteOne object: collection1 arguments: - document: { _id : 1 } + filter: { _id : 1 } expectEvents: - client: client1 events: - commandStartedEvent: command: - insert: collection1 - documents: - - { _id: 1 } - commandName: insert + delete: collection1 + deletes: + - q: { _id: 1 } + limit: 1 + commandName: delete databaseName: database1 From f60cc1a6a000b4f1368f89c1697ec5e814b3cbc0 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Tue, 26 Apr 2022 15:38:10 -0700 Subject: [PATCH 07/11] DRIVERS-555 Merge outcomeCollectionData and initialCollectionData, make timeoutMS an integer, other fixes --- source/unified-test-format/schema-1.8.json | 29 +++----- ...ctionOrDatabaseOptions-timeoutMS-type.json | 2 +- ...ectionOrDatabaseOptions-timeoutMS-type.yml | 2 +- ...ialCollectionData-createOptions-type.json} | 4 +- ...tialCollectionData-createOptions-type.yml} | 4 +- .../valid-pass/createEntities-operation.yml | 1 + .../valid-pass/entity-cursor-iterateOnce.yml | 1 + ... initialCollectionData-createOptions.json} | 4 +- ...> initialCollectionData-createOptions.yml} | 4 +- .../tests/valid-pass/matches-lte-operator.yml | 1 + .../unified-test-format.rst | 71 +++++++------------ 11 files changed, 50 insertions(+), 73 deletions(-) rename source/unified-test-format/tests/invalid/{initialCollectionData-collectionOptions-type.json => initialCollectionData-createOptions-type.json} (85%) rename source/unified-test-format/tests/invalid/{initialCollectionData-collectionOptions-type.yml => initialCollectionData-createOptions-type.yml} (84%) rename source/unified-test-format/tests/valid-pass/{initialCollectionData-collectionOptions.json => initialCollectionData-createOptions.json} (93%) rename source/unified-test-format/tests/valid-pass/{initialCollectionData-collectionOptions.yml => initialCollectionData-createOptions.yml} (92%) diff --git a/source/unified-test-format/schema-1.8.json b/source/unified-test-format/schema-1.8.json index a699fc983d..d529ce44be 100644 --- a/source/unified-test-format/schema-1.8.json +++ b/source/unified-test-format/schema-1.8.json @@ -21,7 +21,7 @@ "initialData": { "type": "array", "minItems": 1, - "items": { "$ref": "#/definitions/initialCollectionData" } + "items": { "$ref": "#/definitions/collectionData" } }, "tests": { "type": "array", @@ -195,28 +195,19 @@ } }, - "initialCollectionData": { - "type": "object", - "additionalProperties": false, - "required": ["collectionName", "databaseName", "documents"], - "properties": { - "collectionName": { "type": "string" }, - "databaseName": { "type": "string" }, - "collectionOptions": { "type": "object" }, - "documents": { - "type": "array", - "items": { "type": "object" } - } - } - }, - - "outcomeCollectionData": { + "collectionData": { "type": "object", "additionalProperties": false, "required": ["collectionName", "databaseName", "documents"], "properties": { "collectionName": { "type": "string" }, "databaseName": { "type": "string" }, + "createOptions": { + "type": "object", + "properties": { + "writeConcern": false + } + }, "documents": { "type": "array", "items": { "type": "object" } @@ -388,7 +379,7 @@ "readConcern": { "type": "object" }, "readPreference": { "type": "object" }, "writeConcern": { "type": "object" }, - "timeoutMS": { "type": "number" } + "timeoutMS": { "type": "integer" } } }, @@ -477,7 +468,7 @@ "outcome": { "type": "array", "minItems": 1, - "items": { "$ref": "#/definitions/outcomeCollectionData" } + "items": { "$ref": "#/definitions/collectionData" } } } } diff --git a/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.json b/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.json index 184fdbb477..52981bc776 100644 --- a/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.json +++ b/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.json @@ -13,7 +13,7 @@ "client": "client0", "databaseName": "foo", "databaseOptions": { - "timeoutMS": {} + "timeoutMS": 4.5 } } } diff --git a/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.yml b/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.yml index cd75f2f977..c2c9a54378 100644 --- a/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.yml +++ b/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.yml @@ -10,7 +10,7 @@ createEntities: client: *client0 databaseName: "foo" databaseOptions: - timeoutMS: {} + timeoutMS: 4.5 # Must be an integer, not a float. tests: - description: "foo" diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-collectionOptions-type.json b/source/unified-test-format/tests/invalid/initialCollectionData-createOptions-type.json similarity index 85% rename from source/unified-test-format/tests/invalid/initialCollectionData-collectionOptions-type.json rename to source/unified-test-format/tests/invalid/initialCollectionData-createOptions-type.json index 86fe4f18cd..042cf6be1f 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-collectionOptions-type.json +++ b/source/unified-test-format/tests/invalid/initialCollectionData-createOptions-type.json @@ -1,5 +1,5 @@ { - "description": "initialCollectionData-collectionOptions-type", + "description": "initialCollectionData-createOptions-type", "schemaVersion": "1.8", "createEntities": [ { @@ -26,7 +26,7 @@ { "collectionName": "foo", "databaseName": "foo", - "collectionOptions": 0, + "createOptions": 0, "documents": [] } ], diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-collectionOptions-type.yml b/source/unified-test-format/tests/invalid/initialCollectionData-createOptions-type.yml similarity index 84% rename from source/unified-test-format/tests/invalid/initialCollectionData-collectionOptions-type.yml rename to source/unified-test-format/tests/invalid/initialCollectionData-createOptions-type.yml index dbfc75cd1d..76a32ced47 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-collectionOptions-type.yml +++ b/source/unified-test-format/tests/invalid/initialCollectionData-createOptions-type.yml @@ -1,4 +1,4 @@ -description: "initialCollectionData-collectionOptions-type" +description: "initialCollectionData-createOptions-type" schemaVersion: "1.8" @@ -17,7 +17,7 @@ createEntities: initialData: - collectionName: *collection0Name databaseName: *database0Name - collectionOptions: 0 + createOptions: 0 documents: [] tests: diff --git a/source/unified-test-format/tests/valid-pass/createEntities-operation.yml b/source/unified-test-format/tests/valid-pass/createEntities-operation.yml index 61fdb5f38a..950748bcb4 100644 --- a/source/unified-test-format/tests/valid-pass/createEntities-operation.yml +++ b/source/unified-test-format/tests/valid-pass/createEntities-operation.yml @@ -1,5 +1,6 @@ description: createEntities-operation +# Note: createEntities is not technically in the 1.8 schema but was introduced at the same time. schemaVersion: "1.8" createEntities: diff --git a/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.yml b/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.yml index bf1265e28b..b3a7877cab 100644 --- a/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.yml +++ b/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.yml @@ -1,5 +1,6 @@ description: entity-cursor-iterateOnce +# Note: iterateOnce is not technically in the 1.8 schema but was introduced at the same time. schemaVersion: "1.8" createEntities: diff --git a/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.json b/source/unified-test-format/tests/valid-pass/initialCollectionData-createOptions.json similarity index 93% rename from source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.json rename to source/unified-test-format/tests/valid-pass/initialCollectionData-createOptions.json index 8f07e399a4..262b3eb651 100644 --- a/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.json +++ b/source/unified-test-format/tests/valid-pass/initialCollectionData-createOptions.json @@ -1,5 +1,5 @@ { - "description": "initialCollectionData-collectionOptions", + "description": "initialCollectionData-createOptions", "schemaVersion": "1.8", "runOnRequirements": [ { @@ -31,7 +31,7 @@ { "collectionName": "coll0", "databaseName": "database0", - "collectionOptions": { + "createOptions": { "capped": true, "size": 512 }, diff --git a/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.yml b/source/unified-test-format/tests/valid-pass/initialCollectionData-createOptions.yml similarity index 92% rename from source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.yml rename to source/unified-test-format/tests/valid-pass/initialCollectionData-createOptions.yml index 471423f742..0ed2d93edd 100644 --- a/source/unified-test-format/tests/valid-pass/initialCollectionData-collectionOptions.yml +++ b/source/unified-test-format/tests/valid-pass/initialCollectionData-createOptions.yml @@ -1,4 +1,4 @@ -description: initialCollectionData-collectionOptions +description: initialCollectionData-createOptions schemaVersion: "1.8" @@ -20,7 +20,7 @@ createEntities: initialData: - collectionName: *collection0Name databaseName: *database0Name - collectionOptions: + createOptions: capped: true size: &cappedSize 512 documents: diff --git a/source/unified-test-format/tests/valid-pass/matches-lte-operator.yml b/source/unified-test-format/tests/valid-pass/matches-lte-operator.yml index 681c8700ae..9cdc9df265 100644 --- a/source/unified-test-format/tests/valid-pass/matches-lte-operator.yml +++ b/source/unified-test-format/tests/valid-pass/matches-lte-operator.yml @@ -1,5 +1,6 @@ description: matches-lte-operator +# Note: $$lte is not technically in the 1.8 schema but was introduced at the same time. schemaVersion: "1.8" createEntities: diff --git a/source/unified-test-format/unified-test-format.rst b/source/unified-test-format/unified-test-format.rst index e33ea0652c..fbd42d3873 100644 --- a/source/unified-test-format/unified-test-format.rst +++ b/source/unified-test-format/unified-test-format.rst @@ -340,9 +340,8 @@ The top-level fields of a test file are as follows: .. _initialData: -- ``initialData``: Optional array of one or more `initialCollectionData`_ - objects. Data that will exist in collections before each test case is - executed. +- ``initialData``: Optional array of one or more `collectionData`_ objects. + Data that will exist in collections before each test case is executed. .. _tests: @@ -750,11 +749,12 @@ See the `Stable API <../versioned-api/versioned-api.rst>`__ spec for more details on these fields. -initialCollectionData -~~~~~~~~~~~~~~~~~~~~~ +collectionData +~~~~~~~~~~~~~~ -List of documents corresponding to the contents of a collection. This -structure is used by `initialData`_. +List of documents corresponding to the contents of a collection. This structure +is used by both `initialData`_ and `test.outcome `_, which insert +and read documents, respectively. The structure of this object is as follows: @@ -762,9 +762,10 @@ The structure of this object is as follows: - ``databaseName``: Required string. See `commonOptions_databaseName`_. -- ``collectionOptions``: Optional object. Options that MUST be passed to the +- ``createOptions``: Optional object. When used in `initialData`_, these options + MUST be passed to the `create `_ command - when creating the collection. Test files SHOULD NOT specify ``writeConcern`` + when creating the collection. Test files MUST NOT specify ``writeConcern`` in this options document as that could conflict with the use of the ``majority`` write concern when the collection is created during test execution. @@ -773,22 +774,6 @@ The structure of this object is as follows: the contents of the collection. This list may be empty. -outcomeCollectionData -~~~~~~~~~~~~~~~~~~~~~ - -List of documents corresponding to the contents of a collection. This -structure is used by `test.outcome `_. - -The structure of this object is as follows: - -- ``collectionName``: Required string. See `commonOptions_collectionName`_. - -- ``databaseName``: Required string. See `commonOptions_databaseName`_. - -- ``documents``: Required array of objects. List of documents corresponding to - the contents of the collection. This list may be empty. - - test ~~~~ @@ -842,9 +827,8 @@ The structure of this object is as follows: .. _test_outcome: -- ``outcome``: Optional array of one or more `outcomeCollectionData`_ - objects. Data that is expected to exist in collections after each test case - is executed. +- ``outcome``: Optional array of one or more `collectionData`_ objects. Data + that is expected to exist in collections after each test case is executed. The list of documents herein SHOULD be sorted ascendingly by the ``_id`` field to allow for deterministic comparisons. The procedure for asserting collection @@ -2241,7 +2225,7 @@ An example of this operation follows:: - database: id: &database0 database0 client: *client0 - databaseName: &databaseName test + databaseName: &database0Name test loop ~~~~ @@ -2847,13 +2831,13 @@ If `test.runOnRequirements `_ is specified, the test runner MUST skip the test unless one or more `runOnRequirement`_ objects are satisfied. -If `initialData`_ is specified, for each `initialCollectionData`_ therein the -test runner MUST set up the collection. All setup operations MUST use the +If `initialData`_ is specified, for each `collectionData`_ therein the test +runner MUST set up the collection. All setup operations MUST use the internal MongoClient and a "majority" write concern. The test runner MUST -first drop the collection. If a ``collectionOptions`` document is present, +first drop the collection. If a ``createOptions`` document is present, the test runner MUST execute a ``create`` command to create the collection with the specified options. The test runner MUST then insert the specified -documents (if any). If no documents are present and ``collectionOptions`` is +documents (if any). If no documents are present and ``createOptions`` is not set, the test runner MUST create the collection. If the topology is sharded, the test runner SHOULD use a single mongos for handling `initialData`_ to avoid possible runtime errors. @@ -2923,16 +2907,15 @@ client. If the list of expected events is empty, the test runner MUST assert that no events were observed on the client. The process for matching events is described in `expectedEvent`_. -If `test.outcome `_ is specified, for each -`outcomeCollectionData`_ therein the test runner MUST assert that the -collection contains exactly the expected data. The test runner MUST query -each collection using the internal MongoClient, an ascending sort order on -the ``_id`` field (i.e. ``{ _id: 1 }``), a "primary" read preference, and a -"local" read concern. When comparing collection data, the rules in -`Evaluating Matches`_ do not apply and the documents MUST match exactly; -however, test runners MUST permit variations in document key order or -otherwise normalize the documents before comparison. If the list of documents -is empty, the test runner MUST assert that the collection is empty. +If `test.outcome `_ is specified, for each `collectionData`_ +therein the test runner MUST assert that the collection contains exactly the +expected data. The test runner MUST query each collection using the internal +MongoClient, an ascending sort order on the ``_id`` field (i.e. ``{ _id: 1 }``), +a "primary" read preference, and a "local" read concern. When comparing collection +data, the rules in `Evaluating Matches`_ do not apply and the documents MUST +match exactly; however, test runners MUST permit variations in document key +order or otherwise normalize the documents before comparison. If the list of +documents is empty, the test runner MUST assert that the collection is empty. Before clearing the entity map at the end of each test, the test runner MUST allow its entities to be accessed externally. The exact mechanism for @@ -3367,7 +3350,7 @@ spec changes developed in parallel or during the same release cycle. Change Log ========== -:2022-04-22: Added ``collectionOptions`` field to ``initialData``, introduced a +:2022-04-22: Added ``createOptions`` field to ``initialData``, introduced a new ``timeoutMS`` field in ``collectionOrDatabaseOptions``, and added an ``isTimeoutError`` field to ``expectedError``. From 39d3f348738f80d5be0a64a7dedd0ed640f87d4d Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Tue, 26 Apr 2022 15:53:32 -0700 Subject: [PATCH 08/11] DRIVERS-555 bump 1.9 --- .../{schema-1.8.json => schema-1.9.json} | 0 source/unified-test-format/tests/Makefile | 2 +- .../invalid/collectionOrDatabaseOptions-timeoutMS-type.json | 2 +- .../invalid/collectionOrDatabaseOptions-timeoutMS-type.yml | 2 +- .../tests/invalid/expectedError-isTimeoutError-type.json | 2 +- .../tests/invalid/expectedError-isTimeoutError-type.yml | 2 +- .../invalid/initialCollectionData-createOptions-type.json | 2 +- .../invalid/initialCollectionData-createOptions-type.yml | 2 +- .../tests/valid-pass/createEntities-operation.json | 2 +- .../tests/valid-pass/createEntities-operation.yml | 4 ++-- .../tests/valid-pass/entity-cursor-iterateOnce.json | 2 +- .../tests/valid-pass/entity-cursor-iterateOnce.yml | 4 ++-- .../valid-pass/initialCollectionData-createOptions.json | 2 +- .../valid-pass/initialCollectionData-createOptions.yml | 2 +- .../tests/valid-pass/matches-lte-operator.json | 2 +- .../tests/valid-pass/matches-lte-operator.yml | 2 +- source/unified-test-format/unified-test-format.rst | 6 +++--- 17 files changed, 20 insertions(+), 20 deletions(-) rename source/unified-test-format/{schema-1.8.json => schema-1.9.json} (100%) diff --git a/source/unified-test-format/schema-1.8.json b/source/unified-test-format/schema-1.9.json similarity index 100% rename from source/unified-test-format/schema-1.8.json rename to source/unified-test-format/schema-1.9.json diff --git a/source/unified-test-format/tests/Makefile b/source/unified-test-format/tests/Makefile index f183a50d69..872781e9ea 100644 --- a/source/unified-test-format/tests/Makefile +++ b/source/unified-test-format/tests/Makefile @@ -1,4 +1,4 @@ -SCHEMA=../schema-1.8.json +SCHEMA=../schema-1.9.json .PHONY: all invalid valid-fail valid-pass versioned-api load-balancers gridfs transactions crud collection-management sessions command-monitoring HAS_AJV diff --git a/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.json b/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.json index 52981bc776..088e9d1eb2 100644 --- a/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.json +++ b/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.json @@ -1,6 +1,6 @@ { "description": "collectionOrDatabaseOptions-timeoutMS-type", - "schemaVersion": "1.8", + "schemaVersion": "1.9", "createEntities": [ { "client": { diff --git a/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.yml b/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.yml index c2c9a54378..6a24053583 100644 --- a/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.yml +++ b/source/unified-test-format/tests/invalid/collectionOrDatabaseOptions-timeoutMS-type.yml @@ -1,6 +1,6 @@ description: "collectionOrDatabaseOptions-timeoutMS-type" -schemaVersion: "1.8" +schemaVersion: "1.9" createEntities: - client: diff --git a/source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.json b/source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.json index 62d9a8f5b3..5683911d0d 100644 --- a/source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.json +++ b/source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.json @@ -1,6 +1,6 @@ { "description": "expectedError-isTimeoutError-type", - "schemaVersion": "1.8", + "schemaVersion": "1.9", "createEntities": [ { "client": { diff --git a/source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.yml b/source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.yml index 8b15d643b6..9d9db95350 100644 --- a/source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.yml +++ b/source/unified-test-format/tests/invalid/expectedError-isTimeoutError-type.yml @@ -1,6 +1,6 @@ description: "expectedError-isTimeoutError-type" -schemaVersion: "1.8" +schemaVersion: "1.9" createEntities: - client: diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-createOptions-type.json b/source/unified-test-format/tests/invalid/initialCollectionData-createOptions-type.json index 042cf6be1f..6d68a8dc22 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-createOptions-type.json +++ b/source/unified-test-format/tests/invalid/initialCollectionData-createOptions-type.json @@ -1,6 +1,6 @@ { "description": "initialCollectionData-createOptions-type", - "schemaVersion": "1.8", + "schemaVersion": "1.9", "createEntities": [ { "client": { diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-createOptions-type.yml b/source/unified-test-format/tests/invalid/initialCollectionData-createOptions-type.yml index 76a32ced47..bb26d5b3ff 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-createOptions-type.yml +++ b/source/unified-test-format/tests/invalid/initialCollectionData-createOptions-type.yml @@ -1,6 +1,6 @@ description: "initialCollectionData-createOptions-type" -schemaVersion: "1.8" +schemaVersion: "1.9" createEntities: - client: diff --git a/source/unified-test-format/tests/valid-pass/createEntities-operation.json b/source/unified-test-format/tests/valid-pass/createEntities-operation.json index 013ea58909..18a9ecd6fe 100644 --- a/source/unified-test-format/tests/valid-pass/createEntities-operation.json +++ b/source/unified-test-format/tests/valid-pass/createEntities-operation.json @@ -1,6 +1,6 @@ { "description": "createEntities-operation", - "schemaVersion": "1.8", + "schemaVersion": "1.9", "createEntities": [ { "client": { diff --git a/source/unified-test-format/tests/valid-pass/createEntities-operation.yml b/source/unified-test-format/tests/valid-pass/createEntities-operation.yml index 950748bcb4..500e1b7f17 100644 --- a/source/unified-test-format/tests/valid-pass/createEntities-operation.yml +++ b/source/unified-test-format/tests/valid-pass/createEntities-operation.yml @@ -1,7 +1,7 @@ description: createEntities-operation -# Note: createEntities is not technically in the 1.8 schema but was introduced at the same time. -schemaVersion: "1.8" +# Note: createEntities is not technically in the 1.9 schema but was introduced at the same time. +schemaVersion: "1.9" createEntities: - client: diff --git a/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.json b/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.json index ee864d9b73..88fc28e34e 100644 --- a/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.json +++ b/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.json @@ -1,6 +1,6 @@ { "description": "entity-cursor-iterateOnce", - "schemaVersion": "1.8", + "schemaVersion": "1.9", "createEntities": [ { "client": { diff --git a/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.yml b/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.yml index b3a7877cab..d84fd76891 100644 --- a/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.yml +++ b/source/unified-test-format/tests/valid-pass/entity-cursor-iterateOnce.yml @@ -1,7 +1,7 @@ description: entity-cursor-iterateOnce -# Note: iterateOnce is not technically in the 1.8 schema but was introduced at the same time. -schemaVersion: "1.8" +# Note: iterateOnce is not technically in the 1.9 schema but was introduced at the same time. +schemaVersion: "1.9" createEntities: - client: diff --git a/source/unified-test-format/tests/valid-pass/initialCollectionData-createOptions.json b/source/unified-test-format/tests/valid-pass/initialCollectionData-createOptions.json index 262b3eb651..3c92cfb08e 100644 --- a/source/unified-test-format/tests/valid-pass/initialCollectionData-createOptions.json +++ b/source/unified-test-format/tests/valid-pass/initialCollectionData-createOptions.json @@ -1,6 +1,6 @@ { "description": "initialCollectionData-createOptions", - "schemaVersion": "1.8", + "schemaVersion": "1.9", "runOnRequirements": [ { "minServerVersion": "3.6" diff --git a/source/unified-test-format/tests/valid-pass/initialCollectionData-createOptions.yml b/source/unified-test-format/tests/valid-pass/initialCollectionData-createOptions.yml index 0ed2d93edd..5286998b5a 100644 --- a/source/unified-test-format/tests/valid-pass/initialCollectionData-createOptions.yml +++ b/source/unified-test-format/tests/valid-pass/initialCollectionData-createOptions.yml @@ -1,6 +1,6 @@ description: initialCollectionData-createOptions -schemaVersion: "1.8" +schemaVersion: "1.9" runOnRequirements: - minServerVersion: "3.6" diff --git a/source/unified-test-format/tests/valid-pass/matches-lte-operator.json b/source/unified-test-format/tests/valid-pass/matches-lte-operator.json index 54973b2846..4de65c5838 100644 --- a/source/unified-test-format/tests/valid-pass/matches-lte-operator.json +++ b/source/unified-test-format/tests/valid-pass/matches-lte-operator.json @@ -1,6 +1,6 @@ { "description": "matches-lte-operator", - "schemaVersion": "1.8", + "schemaVersion": "1.9", "createEntities": [ { "client": { diff --git a/source/unified-test-format/tests/valid-pass/matches-lte-operator.yml b/source/unified-test-format/tests/valid-pass/matches-lte-operator.yml index 9cdc9df265..4bec571f02 100644 --- a/source/unified-test-format/tests/valid-pass/matches-lte-operator.yml +++ b/source/unified-test-format/tests/valid-pass/matches-lte-operator.yml @@ -1,7 +1,7 @@ description: matches-lte-operator # Note: $$lte is not technically in the 1.8 schema but was introduced at the same time. -schemaVersion: "1.8" +schemaVersion: "1.9" createEntities: - client: diff --git a/source/unified-test-format/unified-test-format.rst b/source/unified-test-format/unified-test-format.rst index fbd42d3873..e7e90a82fb 100644 --- a/source/unified-test-format/unified-test-format.rst +++ b/source/unified-test-format/unified-test-format.rst @@ -3,13 +3,13 @@ Unified Test Format =================== :Spec Title: Unified Test Format -:Spec Version: 1.8 +:Spec Version: 1.9 :Author: Jeremy Mikola :Advisors: Prashant Mital, Isabel Atkinson, Thomas Reggi :Status: Accepted :Type: Standards :Minimum Server Version: N/A -:Last Modified: 2022-04-22 +:Last Modified: 2022-04-26 .. contents:: @@ -3350,7 +3350,7 @@ spec changes developed in parallel or during the same release cycle. Change Log ========== -:2022-04-22: Added ``createOptions`` field to ``initialData``, introduced a +:2022-04-29: Added ``createOptions`` field to ``initialData``, introduced a new ``timeoutMS`` field in ``collectionOrDatabaseOptions``, and added an ``isTimeoutError`` field to ``expectedError``. From a6b57456b208ff66e7e590486a1183c58291c33c Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Wed, 27 Apr 2022 14:06:04 -0700 Subject: [PATCH 09/11] DRIVERS-555 rename initialCollectionData -> collectionData --- ... collectionData-additionalProperties.json} | 2 +- ...> collectionData-additionalProperties.yml} | 2 +- ...llectionData-collectionName-required.json} | 2 +- ...ollectionData-collectionName-required.yml} | 2 +- ...> collectionData-collectionName-type.json} | 2 +- ...=> collectionData-collectionName-type.yml} | 2 +- ...=> collectionData-createOptions-type.json} | 2 +- ... => collectionData-createOptions-type.yml} | 2 +- ...collectionData-databaseName-required.json} | 2 +- ... collectionData-databaseName-required.yml} | 2 +- ... => collectionData-databaseName-type.json} | 2 +- ...l => collectionData-databaseName-type.yml} | 2 +- ...on => collectionData-documents-items.json} | 2 +- ...yml => collectionData-documents-items.yml} | 2 +- ...=> collectionData-documents-required.json} | 2 +- ... => collectionData-documents-required.yml} | 2 +- ...son => collectionData-documents-type.json} | 2 +- ....yml => collectionData-documents-type.yml} | 2 +- ...meCollectionData-additionalProperties.json | 39 ------------------ ...omeCollectionData-additionalProperties.yml | 24 ----------- ...ollectionData-collectionName-required.json | 37 ----------------- ...CollectionData-collectionName-required.yml | 22 ---------- ...omeCollectionData-collectionName-type.json | 38 ------------------ ...comeCollectionData-collectionName-type.yml | 23 ----------- ...eCollectionData-databaseName-required.json | 37 ----------------- ...meCollectionData-databaseName-required.yml | 22 ---------- ...tcomeCollectionData-databaseName-type.json | 38 ------------------ ...utcomeCollectionData-databaseName-type.yml | 23 ----------- ...outcomeCollectionData-documents-items.json | 40 ------------------- .../outcomeCollectionData-documents-items.yml | 23 ----------- ...comeCollectionData-documents-required.json | 37 ----------------- ...tcomeCollectionData-documents-required.yml | 22 ---------- .../outcomeCollectionData-documents-type.json | 38 ------------------ .../outcomeCollectionData-documents-type.yml | 23 ----------- ...json => collectionData-createOptions.json} | 2 +- ...s.yml => collectionData-createOptions.yml} | 2 +- 36 files changed, 20 insertions(+), 506 deletions(-) rename source/unified-test-format/tests/invalid/{initialCollectionData-additionalProperties.json => collectionData-additionalProperties.json} (90%) rename source/unified-test-format/tests/invalid/{initialCollectionData-additionalProperties.yml => collectionData-additionalProperties.yml} (89%) rename source/unified-test-format/tests/invalid/{initialCollectionData-collectionName-required.json => collectionData-collectionName-required.json} (89%) rename source/unified-test-format/tests/invalid/{initialCollectionData-collectionName-required.yml => collectionData-collectionName-required.yml} (87%) rename source/unified-test-format/tests/invalid/{initialCollectionData-collectionName-type.json => collectionData-collectionName-type.json} (90%) rename source/unified-test-format/tests/invalid/{initialCollectionData-collectionName-type.yml => collectionData-collectionName-type.yml} (88%) rename source/unified-test-format/tests/invalid/{initialCollectionData-createOptions-type.json => collectionData-createOptions-type.json} (90%) rename source/unified-test-format/tests/invalid/{initialCollectionData-createOptions-type.yml => collectionData-createOptions-type.yml} (89%) rename source/unified-test-format/tests/invalid/{initialCollectionData-databaseName-required.json => collectionData-databaseName-required.json} (89%) rename source/unified-test-format/tests/invalid/{initialCollectionData-databaseName-required.yml => collectionData-databaseName-required.yml} (88%) rename source/unified-test-format/tests/invalid/{initialCollectionData-databaseName-type.json => collectionData-databaseName-type.json} (90%) rename source/unified-test-format/tests/invalid/{initialCollectionData-databaseName-type.yml => collectionData-databaseName-type.yml} (89%) rename source/unified-test-format/tests/invalid/{initialCollectionData-documents-items.json => collectionData-documents-items.json} (91%) rename source/unified-test-format/tests/invalid/{initialCollectionData-documents-items.yml => collectionData-documents-items.yml} (89%) rename source/unified-test-format/tests/invalid/{initialCollectionData-documents-required.json => collectionData-documents-required.json} (90%) rename source/unified-test-format/tests/invalid/{initialCollectionData-documents-required.yml => collectionData-documents-required.yml} (88%) rename source/unified-test-format/tests/invalid/{initialCollectionData-documents-type.json => collectionData-documents-type.json} (91%) rename source/unified-test-format/tests/invalid/{initialCollectionData-documents-type.yml => collectionData-documents-type.yml} (89%) delete mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-additionalProperties.json delete mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-additionalProperties.yml delete mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-required.json delete mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-required.yml delete mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-type.json delete mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-type.yml delete mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-required.json delete mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-required.yml delete mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-type.json delete mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-type.yml delete mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-documents-items.json delete mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-documents-items.yml delete mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-documents-required.json delete mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-documents-required.yml delete mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-documents-type.json delete mode 100644 source/unified-test-format/tests/invalid/outcomeCollectionData-documents-type.yml rename source/unified-test-format/tests/valid-pass/{initialCollectionData-createOptions.json => collectionData-createOptions.json} (95%) rename source/unified-test-format/tests/valid-pass/{initialCollectionData-createOptions.yml => collectionData-createOptions.yml} (95%) diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-additionalProperties.json b/source/unified-test-format/tests/invalid/collectionData-additionalProperties.json similarity index 90% rename from source/unified-test-format/tests/invalid/initialCollectionData-additionalProperties.json rename to source/unified-test-format/tests/invalid/collectionData-additionalProperties.json index 656fa841ea..1f4ed4c154 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-additionalProperties.json +++ b/source/unified-test-format/tests/invalid/collectionData-additionalProperties.json @@ -1,5 +1,5 @@ { - "description": "initialCollectionData-additionalProperties", + "description": "collectionData-additionalProperties", "schemaVersion": "1.0", "createEntities": [ { diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-additionalProperties.yml b/source/unified-test-format/tests/invalid/collectionData-additionalProperties.yml similarity index 89% rename from source/unified-test-format/tests/invalid/initialCollectionData-additionalProperties.yml rename to source/unified-test-format/tests/invalid/collectionData-additionalProperties.yml index d46a6084d4..62a4a81b6a 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-additionalProperties.yml +++ b/source/unified-test-format/tests/invalid/collectionData-additionalProperties.yml @@ -1,4 +1,4 @@ -description: "initialCollectionData-additionalProperties" +description: "collectionData-additionalProperties" schemaVersion: "1.0" diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-collectionName-required.json b/source/unified-test-format/tests/invalid/collectionData-collectionName-required.json similarity index 89% rename from source/unified-test-format/tests/invalid/initialCollectionData-collectionName-required.json rename to source/unified-test-format/tests/invalid/collectionData-collectionName-required.json index 7a84199439..5426418c88 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-collectionName-required.json +++ b/source/unified-test-format/tests/invalid/collectionData-collectionName-required.json @@ -1,5 +1,5 @@ { - "description": "initialCollectionData-collectionName-required", + "description": "collectionData-collectionName-required", "schemaVersion": "1.0", "createEntities": [ { diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-collectionName-required.yml b/source/unified-test-format/tests/invalid/collectionData-collectionName-required.yml similarity index 87% rename from source/unified-test-format/tests/invalid/initialCollectionData-collectionName-required.yml rename to source/unified-test-format/tests/invalid/collectionData-collectionName-required.yml index 5ea6b9a863..f8da422eab 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-collectionName-required.yml +++ b/source/unified-test-format/tests/invalid/collectionData-collectionName-required.yml @@ -1,4 +1,4 @@ -description: "initialCollectionData-collectionName-required" +description: "collectionData-collectionName-required" schemaVersion: "1.0" diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-collectionName-type.json b/source/unified-test-format/tests/invalid/collectionData-collectionName-type.json similarity index 90% rename from source/unified-test-format/tests/invalid/initialCollectionData-collectionName-type.json rename to source/unified-test-format/tests/invalid/collectionData-collectionName-type.json index aba8ee935c..2a922de13e 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-collectionName-type.json +++ b/source/unified-test-format/tests/invalid/collectionData-collectionName-type.json @@ -1,5 +1,5 @@ { - "description": "initialCollectionData-collectionName-type", + "description": "collectionData-collectionName-type", "schemaVersion": "1.0", "createEntities": [ { diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-collectionName-type.yml b/source/unified-test-format/tests/invalid/collectionData-collectionName-type.yml similarity index 88% rename from source/unified-test-format/tests/invalid/initialCollectionData-collectionName-type.yml rename to source/unified-test-format/tests/invalid/collectionData-collectionName-type.yml index bcf0d4a520..d14ecb5fab 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-collectionName-type.yml +++ b/source/unified-test-format/tests/invalid/collectionData-collectionName-type.yml @@ -1,4 +1,4 @@ -description: "initialCollectionData-collectionName-type" +description: "collectionData-collectionName-type" schemaVersion: "1.0" diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-createOptions-type.json b/source/unified-test-format/tests/invalid/collectionData-createOptions-type.json similarity index 90% rename from source/unified-test-format/tests/invalid/initialCollectionData-createOptions-type.json rename to source/unified-test-format/tests/invalid/collectionData-createOptions-type.json index 6d68a8dc22..5b78bbcbb6 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-createOptions-type.json +++ b/source/unified-test-format/tests/invalid/collectionData-createOptions-type.json @@ -1,5 +1,5 @@ { - "description": "initialCollectionData-createOptions-type", + "description": "collectionData-createOptions-type", "schemaVersion": "1.9", "createEntities": [ { diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-createOptions-type.yml b/source/unified-test-format/tests/invalid/collectionData-createOptions-type.yml similarity index 89% rename from source/unified-test-format/tests/invalid/initialCollectionData-createOptions-type.yml rename to source/unified-test-format/tests/invalid/collectionData-createOptions-type.yml index bb26d5b3ff..5bc17a15f9 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-createOptions-type.yml +++ b/source/unified-test-format/tests/invalid/collectionData-createOptions-type.yml @@ -1,4 +1,4 @@ -description: "initialCollectionData-createOptions-type" +description: "collectionData-createOptions-type" schemaVersion: "1.9" diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-databaseName-required.json b/source/unified-test-format/tests/invalid/collectionData-databaseName-required.json similarity index 89% rename from source/unified-test-format/tests/invalid/initialCollectionData-databaseName-required.json rename to source/unified-test-format/tests/invalid/collectionData-databaseName-required.json index 29dcf37111..8417801390 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-databaseName-required.json +++ b/source/unified-test-format/tests/invalid/collectionData-databaseName-required.json @@ -1,5 +1,5 @@ { - "description": "initialCollectionData-databaseName-required", + "description": "collectionData-databaseName-required", "schemaVersion": "1.0", "createEntities": [ { diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-databaseName-required.yml b/source/unified-test-format/tests/invalid/collectionData-databaseName-required.yml similarity index 88% rename from source/unified-test-format/tests/invalid/initialCollectionData-databaseName-required.yml rename to source/unified-test-format/tests/invalid/collectionData-databaseName-required.yml index 65b1a72d1c..595ae798e8 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-databaseName-required.yml +++ b/source/unified-test-format/tests/invalid/collectionData-databaseName-required.yml @@ -1,4 +1,4 @@ -description: "initialCollectionData-databaseName-required" +description: "collectionData-databaseName-required" schemaVersion: "1.0" diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-databaseName-type.json b/source/unified-test-format/tests/invalid/collectionData-databaseName-type.json similarity index 90% rename from source/unified-test-format/tests/invalid/initialCollectionData-databaseName-type.json rename to source/unified-test-format/tests/invalid/collectionData-databaseName-type.json index daf8c44242..d3480e8034 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-databaseName-type.json +++ b/source/unified-test-format/tests/invalid/collectionData-databaseName-type.json @@ -1,5 +1,5 @@ { - "description": "initialCollectionData-databaseName-type", + "description": "collectionData-databaseName-type", "schemaVersion": "1.0", "createEntities": [ { diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-databaseName-type.yml b/source/unified-test-format/tests/invalid/collectionData-databaseName-type.yml similarity index 89% rename from source/unified-test-format/tests/invalid/initialCollectionData-databaseName-type.yml rename to source/unified-test-format/tests/invalid/collectionData-databaseName-type.yml index 5d0907554b..bc5b47fe1b 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-databaseName-type.yml +++ b/source/unified-test-format/tests/invalid/collectionData-databaseName-type.yml @@ -1,4 +1,4 @@ -description: "initialCollectionData-databaseName-type" +description: "collectionData-databaseName-type" schemaVersion: "1.0" diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-documents-items.json b/source/unified-test-format/tests/invalid/collectionData-documents-items.json similarity index 91% rename from source/unified-test-format/tests/invalid/initialCollectionData-documents-items.json rename to source/unified-test-format/tests/invalid/collectionData-documents-items.json index 2c8071bacf..beb5af61c4 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-documents-items.json +++ b/source/unified-test-format/tests/invalid/collectionData-documents-items.json @@ -1,5 +1,5 @@ { - "description": "initialCollectionData-documents-items", + "description": "collectionData-documents-items", "schemaVersion": "1.0", "createEntities": [ { diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-documents-items.yml b/source/unified-test-format/tests/invalid/collectionData-documents-items.yml similarity index 89% rename from source/unified-test-format/tests/invalid/initialCollectionData-documents-items.yml rename to source/unified-test-format/tests/invalid/collectionData-documents-items.yml index 44523a7bc3..f129ee371a 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-documents-items.yml +++ b/source/unified-test-format/tests/invalid/collectionData-documents-items.yml @@ -1,4 +1,4 @@ -description: "initialCollectionData-documents-items" +description: "collectionData-documents-items" schemaVersion: "1.0" diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-documents-required.json b/source/unified-test-format/tests/invalid/collectionData-documents-required.json similarity index 90% rename from source/unified-test-format/tests/invalid/initialCollectionData-documents-required.json rename to source/unified-test-format/tests/invalid/collectionData-documents-required.json index f45a9d711d..4aadf9b159 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-documents-required.json +++ b/source/unified-test-format/tests/invalid/collectionData-documents-required.json @@ -1,5 +1,5 @@ { - "description": "initialCollectionData-documents-required", + "description": "collectionData-documents-required", "schemaVersion": "1.0", "createEntities": [ { diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-documents-required.yml b/source/unified-test-format/tests/invalid/collectionData-documents-required.yml similarity index 88% rename from source/unified-test-format/tests/invalid/initialCollectionData-documents-required.yml rename to source/unified-test-format/tests/invalid/collectionData-documents-required.yml index e83315933a..b275e7610c 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-documents-required.yml +++ b/source/unified-test-format/tests/invalid/collectionData-documents-required.yml @@ -1,4 +1,4 @@ -description: "initialCollectionData-documents-required" +description: "collectionData-documents-required" schemaVersion: "1.0" diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-documents-type.json b/source/unified-test-format/tests/invalid/collectionData-documents-type.json similarity index 91% rename from source/unified-test-format/tests/invalid/initialCollectionData-documents-type.json rename to source/unified-test-format/tests/invalid/collectionData-documents-type.json index 1ce6041a9a..9cbd3c164c 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-documents-type.json +++ b/source/unified-test-format/tests/invalid/collectionData-documents-type.json @@ -1,5 +1,5 @@ { - "description": "initialCollectionData-documents-type", + "description": "collectionData-documents-type", "schemaVersion": "1.0", "createEntities": [ { diff --git a/source/unified-test-format/tests/invalid/initialCollectionData-documents-type.yml b/source/unified-test-format/tests/invalid/collectionData-documents-type.yml similarity index 89% rename from source/unified-test-format/tests/invalid/initialCollectionData-documents-type.yml rename to source/unified-test-format/tests/invalid/collectionData-documents-type.yml index bfea6cbb8f..a51a506508 100644 --- a/source/unified-test-format/tests/invalid/initialCollectionData-documents-type.yml +++ b/source/unified-test-format/tests/invalid/collectionData-documents-type.yml @@ -1,4 +1,4 @@ -description: "initialCollectionData-documents-type" +description: "collectionData-documents-type" schemaVersion: "1.0" diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-additionalProperties.json b/source/unified-test-format/tests/invalid/outcomeCollectionData-additionalProperties.json deleted file mode 100644 index 302013ee18..0000000000 --- a/source/unified-test-format/tests/invalid/outcomeCollectionData-additionalProperties.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "description": "outcomeCollectionData-additionalProperties", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "foo" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "foo" - } - } - ], - "tests": [ - { - "description": "foo", - "operations": [], - "outcome": [ - { - "collectionName": "foo", - "databaseName": "foo", - "documents": [], - "foo": 0 - } - ] - } - ] -} diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-additionalProperties.yml b/source/unified-test-format/tests/invalid/outcomeCollectionData-additionalProperties.yml deleted file mode 100644 index 7f7343044e..0000000000 --- a/source/unified-test-format/tests/invalid/outcomeCollectionData-additionalProperties.yml +++ /dev/null @@ -1,24 +0,0 @@ -description: "outcomeCollectionData-additionalProperties" - -schemaVersion: "1.0" - -createEntities: - - client: - id: &client0 "client0" - - database: - id: &database0 "database0" - client: *client0 - databaseName: &database0Name "foo" - - collection: - id: &collection0 "collection0" - database: *database0 - collectionName: &collection0Name "foo" - -tests: - - description: "foo" - operations: [] - outcome: - - collectionName: *collection0Name - databaseName: *database0Name - documents: [] - foo: 0 diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-required.json b/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-required.json deleted file mode 100644 index c0ba9aabb2..0000000000 --- a/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-required.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "description": "outcomeCollectionData-collectionName-required", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "foo" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "foo" - } - } - ], - "tests": [ - { - "description": "foo", - "operations": [], - "outcome": [ - { - "databaseName": "foo", - "documents": [] - } - ] - } - ] -} diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-required.yml b/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-required.yml deleted file mode 100644 index 669e557be7..0000000000 --- a/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-required.yml +++ /dev/null @@ -1,22 +0,0 @@ -description: "outcomeCollectionData-collectionName-required" - -schemaVersion: "1.0" - -createEntities: - - client: - id: &client0 "client0" - - database: - id: &database0 "database0" - client: *client0 - databaseName: &database0Name "foo" - - collection: - id: &collection0 "collection0" - database: *database0 - collectionName: &collection0Name "foo" - -tests: - - description: "foo" - operations: [] - outcome: - - databaseName: *database0Name - documents: [] diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-type.json b/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-type.json deleted file mode 100644 index 6f8f82dd1b..0000000000 --- a/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-type.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "description": "outcomeCollectionData-collectionName-type", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "foo" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "foo" - } - } - ], - "tests": [ - { - "description": "foo", - "operations": [], - "outcome": [ - { - "collectionName": 0, - "databaseName": "foo", - "documents": [] - } - ] - } - ] -} diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-type.yml b/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-type.yml deleted file mode 100644 index 59af07d31f..0000000000 --- a/source/unified-test-format/tests/invalid/outcomeCollectionData-collectionName-type.yml +++ /dev/null @@ -1,23 +0,0 @@ -description: "outcomeCollectionData-collectionName-type" - -schemaVersion: "1.0" - -createEntities: - - client: - id: &client0 "client0" - - database: - id: &database0 "database0" - client: *client0 - databaseName: &database0Name "foo" - - collection: - id: &collection0 "collection0" - database: *database0 - collectionName: &collection0Name "foo" - -tests: - - description: "foo" - operations: [] - outcome: - - collectionName: 0 - databaseName: *database0Name - documents: [] diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-required.json b/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-required.json deleted file mode 100644 index 76c9fbacde..0000000000 --- a/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-required.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "description": "outcomeCollectionData-databaseName-required", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "foo" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "foo" - } - } - ], - "tests": [ - { - "description": "foo", - "operations": [], - "outcome": [ - { - "collectionName": "foo", - "documents": [] - } - ] - } - ] -} diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-required.yml b/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-required.yml deleted file mode 100644 index f6f560e016..0000000000 --- a/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-required.yml +++ /dev/null @@ -1,22 +0,0 @@ -description: "outcomeCollectionData-databaseName-required" - -schemaVersion: "1.0" - -createEntities: - - client: - id: &client0 "client0" - - database: - id: &database0 "database0" - client: *client0 - databaseName: &database0Name "foo" - - collection: - id: &collection0 "collection0" - database: *database0 - collectionName: &collection0Name "foo" - -tests: - - description: "foo" - operations: [] - outcome: - - collectionName: *collection0Name - documents: [] diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-type.json b/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-type.json deleted file mode 100644 index 72560fdfaf..0000000000 --- a/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-type.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "description": "outcomeCollectionData-databaseName-type", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "foo" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "foo" - } - } - ], - "tests": [ - { - "description": "foo", - "operations": [], - "outcome": [ - { - "collectionName": "foo", - "databaseName": 0, - "documents": [] - } - ] - } - ] -} diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-type.yml b/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-type.yml deleted file mode 100644 index 1dd9c3f5a5..0000000000 --- a/source/unified-test-format/tests/invalid/outcomeCollectionData-databaseName-type.yml +++ /dev/null @@ -1,23 +0,0 @@ -description: "outcomeCollectionData-databaseName-type" - -schemaVersion: "1.0" - -createEntities: - - client: - id: &client0 "client0" - - database: - id: &database0 "database0" - client: *client0 - databaseName: &database0Name "foo" - - collection: - id: &collection0 "collection0" - database: *database0 - collectionName: &collection0Name "foo" - -tests: - - description: "foo" - operations: [] - outcome: - - collectionName: *collection0Name - databaseName: 0 - documents: [] diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-items.json b/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-items.json deleted file mode 100644 index 507202ea9f..0000000000 --- a/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-items.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "description": "outcomeCollectionData-documents-items", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "foo" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "foo" - } - } - ], - "tests": [ - { - "description": "foo", - "operations": [], - "outcome": [ - { - "collectionName": "foo", - "databaseName": "foo", - "documents": [ - 0 - ] - } - ] - } - ] -} diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-items.yml b/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-items.yml deleted file mode 100644 index c20ec8b220..0000000000 --- a/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-items.yml +++ /dev/null @@ -1,23 +0,0 @@ -description: "outcomeCollectionData-documents-items" - -schemaVersion: "1.0" - -createEntities: - - client: - id: &client0 "client0" - - database: - id: &database0 "database0" - client: *client0 - databaseName: &database0Name "foo" - - collection: - id: &collection0 "collection0" - database: *database0 - collectionName: &collection0Name "foo" - -tests: - - description: "foo" - operations: [] - outcome: - - collectionName: *collection0Name - databaseName: *database0Name - documents: [0] diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-required.json b/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-required.json deleted file mode 100644 index 1ceee96aba..0000000000 --- a/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-required.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "description": "outcomeCollectionData-documents-required", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "foo" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "foo" - } - } - ], - "tests": [ - { - "description": "foo", - "operations": [], - "outcome": [ - { - "collectionName": "foo", - "databaseName": "foo" - } - ] - } - ] -} diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-required.yml b/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-required.yml deleted file mode 100644 index d047c2aa0c..0000000000 --- a/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-required.yml +++ /dev/null @@ -1,22 +0,0 @@ -description: "outcomeCollectionData-documents-required" - -schemaVersion: "1.0" - -createEntities: - - client: - id: &client0 "client0" - - database: - id: &database0 "database0" - client: *client0 - databaseName: &database0Name "foo" - - collection: - id: &collection0 "collection0" - database: *database0 - collectionName: &collection0Name "foo" - -tests: - - description: "foo" - operations: [] - outcome: - - collectionName: *collection0Name - databaseName: *database0Name diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-type.json b/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-type.json deleted file mode 100644 index f55e793018..0000000000 --- a/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-type.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "description": "outcomeCollectionData-documents-type", - "schemaVersion": "1.0", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "foo" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "foo" - } - } - ], - "tests": [ - { - "description": "foo", - "operations": [], - "outcome": [ - { - "collectionName": "foo", - "databaseName": "foo", - "documents": 0 - } - ] - } - ] -} diff --git a/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-type.yml b/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-type.yml deleted file mode 100644 index dfca60d13d..0000000000 --- a/source/unified-test-format/tests/invalid/outcomeCollectionData-documents-type.yml +++ /dev/null @@ -1,23 +0,0 @@ -description: "outcomeCollectionData-documents-type" - -schemaVersion: "1.0" - -createEntities: - - client: - id: &client0 "client0" - - database: - id: &database0 "database0" - client: *client0 - databaseName: &database0Name "foo" - - collection: - id: &collection0 "collection0" - database: *database0 - collectionName: &collection0Name "foo" - -tests: - - description: "foo" - operations: [] - outcome: - - collectionName: *collection0Name - databaseName: *database0Name - documents: 0 diff --git a/source/unified-test-format/tests/valid-pass/initialCollectionData-createOptions.json b/source/unified-test-format/tests/valid-pass/collectionData-createOptions.json similarity index 95% rename from source/unified-test-format/tests/valid-pass/initialCollectionData-createOptions.json rename to source/unified-test-format/tests/valid-pass/collectionData-createOptions.json index 3c92cfb08e..07ab66baa0 100644 --- a/source/unified-test-format/tests/valid-pass/initialCollectionData-createOptions.json +++ b/source/unified-test-format/tests/valid-pass/collectionData-createOptions.json @@ -1,5 +1,5 @@ { - "description": "initialCollectionData-createOptions", + "description": "collectionData-createOptions", "schemaVersion": "1.9", "runOnRequirements": [ { diff --git a/source/unified-test-format/tests/valid-pass/initialCollectionData-createOptions.yml b/source/unified-test-format/tests/valid-pass/collectionData-createOptions.yml similarity index 95% rename from source/unified-test-format/tests/valid-pass/initialCollectionData-createOptions.yml rename to source/unified-test-format/tests/valid-pass/collectionData-createOptions.yml index 5286998b5a..ca1479d060 100644 --- a/source/unified-test-format/tests/valid-pass/initialCollectionData-createOptions.yml +++ b/source/unified-test-format/tests/valid-pass/collectionData-createOptions.yml @@ -1,4 +1,4 @@ -description: initialCollectionData-createOptions +description: collectionData-createOptions schemaVersion: "1.9" From f5ef38a0e7e296b61529bb52a0cbde1a8960d2f3 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Wed, 27 Apr 2022 14:26:59 -0700 Subject: [PATCH 10/11] DRIVERS-555 Use anchors --- .../valid-pass/createEntities-operation.json | 8 ++-- .../valid-pass/createEntities-operation.yml | 40 +++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/source/unified-test-format/tests/valid-pass/createEntities-operation.json b/source/unified-test-format/tests/valid-pass/createEntities-operation.json index 18a9ecd6fe..a32f58e9b4 100644 --- a/source/unified-test-format/tests/valid-pass/createEntities-operation.json +++ b/source/unified-test-format/tests/valid-pass/createEntities-operation.json @@ -18,13 +18,13 @@ "collection": { "id": "collection0", "database": "database0", - "collectionName": "collection0" + "collectionName": "coll0" } } ], "initialData": [ { - "collectionName": "collection0", + "collectionName": "coll0", "databaseName": "database0", "documents": [] } @@ -57,7 +57,7 @@ "collection": { "id": "collection1", "database": "database1", - "collectionName": "collection1" + "collectionName": "coll1" } } ] @@ -80,7 +80,7 @@ { "commandStartedEvent": { "command": { - "delete": "collection1", + "delete": "coll1", "deletes": [ { "q": { diff --git a/source/unified-test-format/tests/valid-pass/createEntities-operation.yml b/source/unified-test-format/tests/valid-pass/createEntities-operation.yml index 500e1b7f17..c65e2caa5e 100644 --- a/source/unified-test-format/tests/valid-pass/createEntities-operation.yml +++ b/source/unified-test-format/tests/valid-pass/createEntities-operation.yml @@ -5,19 +5,19 @@ schemaVersion: "1.9" createEntities: - client: - id: client0 + id: &client0 client0 - database: - id: database0 - client: client0 - databaseName: database0 + id: &database0 database0 + client: *client0 + databaseName: &database0Name database0 - collection: - id: collection0 - database: database0 - collectionName: collection0 + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 initialData: - - collectionName: collection0 - databaseName: database0 + - collectionName: *collection0Name + databaseName: *database0Name documents: [] tests: @@ -28,28 +28,28 @@ tests: arguments: entities: - client: - id: client1 + id: &client1 client1 observeEvents: [ commandStartedEvent ] - database: - id: database1 - client: client1 - databaseName: database1 + id: &database1 database1 + client: *client1 + databaseName: &database1Name database1 - collection: - id: collection1 - database: database1 - collectionName: collection1 + id: &collection1 collection1 + database: *database1 + collectionName: &collection1Name coll1 - name: deleteOne - object: collection1 + object: *collection1 arguments: filter: { _id : 1 } expectEvents: - - client: client1 + - client: *client1 events: - commandStartedEvent: command: - delete: collection1 + delete: *collection1Name deletes: - q: { _id: 1 } limit: 1 commandName: delete - databaseName: database1 + databaseName: *database1Name From 3f4d7caac4074f357fec6cba96ef629101669df1 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Wed, 27 Apr 2022 15:12:10 -0700 Subject: [PATCH 11/11] DRIVERS-555 Remove redundant createEntities and initialData --- .../valid-pass/createEntities-operation.json | 28 ------------------- .../valid-pass/createEntities-operation.yml | 17 ----------- 2 files changed, 45 deletions(-) diff --git a/source/unified-test-format/tests/valid-pass/createEntities-operation.json b/source/unified-test-format/tests/valid-pass/createEntities-operation.json index a32f58e9b4..3fde42919d 100644 --- a/source/unified-test-format/tests/valid-pass/createEntities-operation.json +++ b/source/unified-test-format/tests/valid-pass/createEntities-operation.json @@ -1,34 +1,6 @@ { "description": "createEntities-operation", "schemaVersion": "1.9", - "createEntities": [ - { - "client": { - "id": "client0" - } - }, - { - "database": { - "id": "database0", - "client": "client0", - "databaseName": "database0" - } - }, - { - "collection": { - "id": "collection0", - "database": "database0", - "collectionName": "coll0" - } - } - ], - "initialData": [ - { - "collectionName": "coll0", - "databaseName": "database0", - "documents": [] - } - ], "tests": [ { "description": "createEntities operation", diff --git a/source/unified-test-format/tests/valid-pass/createEntities-operation.yml b/source/unified-test-format/tests/valid-pass/createEntities-operation.yml index c65e2caa5e..ee8acd7368 100644 --- a/source/unified-test-format/tests/valid-pass/createEntities-operation.yml +++ b/source/unified-test-format/tests/valid-pass/createEntities-operation.yml @@ -3,23 +3,6 @@ description: createEntities-operation # Note: createEntities is not technically in the 1.9 schema but was introduced at the same time. schemaVersion: "1.9" -createEntities: - - client: - id: &client0 client0 - - database: - id: &database0 database0 - client: *client0 - databaseName: &database0Name database0 - - collection: - id: &collection0 collection0 - database: *database0 - collectionName: &collection0Name coll0 - -initialData: - - collectionName: *collection0Name - databaseName: *database0Name - documents: [] - tests: - description: createEntities operation operations: