diff --git a/test/unified-test-format/invalid/entity-client-serverApi-deprecationErrors-type.json b/test/unified-test-format/invalid/entity-client-serverApi-deprecationErrors-type.json new file mode 100644 index 000000000..b688dae63 --- /dev/null +++ b/test/unified-test-format/invalid/entity-client-serverApi-deprecationErrors-type.json @@ -0,0 +1,21 @@ +{ + "description": "entity-client-serverApi-version-type", + "schemaVersion": "1.1", + "createEntities": [ + { + "client": { + "id": "client0", + "serverApi": { + "version": "1", + "deprecationErrors": 0 + } + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/unified-test-format/invalid/entity-client-serverApi-strict-type.json b/test/unified-test-format/invalid/entity-client-serverApi-strict-type.json new file mode 100644 index 000000000..0b2fdc484 --- /dev/null +++ b/test/unified-test-format/invalid/entity-client-serverApi-strict-type.json @@ -0,0 +1,21 @@ +{ + "description": "entity-client-serverApi-version-type", + "schemaVersion": "1.1", + "createEntities": [ + { + "client": { + "id": "client0", + "serverApi": { + "version": "1", + "strict": 0 + } + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/unified-test-format/invalid/entity-client-serverApi-type.json b/test/unified-test-format/invalid/entity-client-serverApi-type.json new file mode 100644 index 000000000..20c9d1dce --- /dev/null +++ b/test/unified-test-format/invalid/entity-client-serverApi-type.json @@ -0,0 +1,18 @@ +{ + "description": "entity-client-serverApi-type", + "schemaVersion": "1.1", + "createEntities": [ + { + "client": { + "id": "client0", + "serverApi": 0 + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/unified-test-format/invalid/entity-client-serverApi-version-required.json b/test/unified-test-format/invalid/entity-client-serverApi-version-required.json new file mode 100644 index 000000000..8bef92b06 --- /dev/null +++ b/test/unified-test-format/invalid/entity-client-serverApi-version-required.json @@ -0,0 +1,18 @@ +{ + "description": "entity-client-serverApi-version-required", + "schemaVersion": "1.1", + "createEntities": [ + { + "client": { + "id": "client0", + "serverApi": {} + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/unified-test-format/invalid/entity-client-serverApi-version-type.json b/test/unified-test-format/invalid/entity-client-serverApi-version-type.json new file mode 100644 index 000000000..2c36ff57e --- /dev/null +++ b/test/unified-test-format/invalid/entity-client-serverApi-version-type.json @@ -0,0 +1,20 @@ +{ + "description": "entity-client-serverApi-version-type", + "schemaVersion": "1.1", + "createEntities": [ + { + "client": { + "id": "client0", + "serverApi": { + "version": 0 + } + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/unified-test-format/invalid/expectedCommandEvent-additionalProperties.json b/test/unified-test-format/invalid/expectedCommandEvent-additionalProperties.json new file mode 100644 index 000000000..9e45cbadd --- /dev/null +++ b/test/unified-test-format/invalid/expectedCommandEvent-additionalProperties.json @@ -0,0 +1,27 @@ +{ + "description": "expectedCommandEvent-additionalProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "foo": 0 + } + ] + } + ] + } + ] +} diff --git a/test/unified-test-format/invalid/expectedCommandEvent-commandFailedEvent-commandName-type.json b/test/unified-test-format/invalid/expectedCommandEvent-commandFailedEvent-commandName-type.json new file mode 100644 index 000000000..a571d8e0c --- /dev/null +++ b/test/unified-test-format/invalid/expectedCommandEvent-commandFailedEvent-commandName-type.json @@ -0,0 +1,29 @@ +{ + "description": "expectedCommandEvent-commandFailedEvent-commandName-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandFailedEvent": { + "commandName": 0 + } + } + ] + } + ] + } + ] +} diff --git a/test/unified-test-format/invalid/expectedCommandEvent-commandStartedEvent-additionalProperties.json b/test/unified-test-format/invalid/expectedCommandEvent-commandStartedEvent-additionalProperties.json new file mode 100644 index 000000000..996332d27 --- /dev/null +++ b/test/unified-test-format/invalid/expectedCommandEvent-commandStartedEvent-additionalProperties.json @@ -0,0 +1,29 @@ +{ + "description": "expectedCommandEvent-commandStartedEvent-additionalProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "foo": 0 + } + } + ] + } + ] + } + ] +} diff --git a/test/unified-test-format/invalid/expectedCommandEvent-commandStartedEvent-command-type.json b/test/unified-test-format/invalid/expectedCommandEvent-commandStartedEvent-command-type.json new file mode 100644 index 000000000..8f8946061 --- /dev/null +++ b/test/unified-test-format/invalid/expectedCommandEvent-commandStartedEvent-command-type.json @@ -0,0 +1,29 @@ +{ + "description": "expectedCommandEvent-commandStartedEvent-command-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": 0 + } + } + ] + } + ] + } + ] +} diff --git a/test/unified-test-format/invalid/expectedCommandEvent-commandStartedEvent-commandName-type.json b/test/unified-test-format/invalid/expectedCommandEvent-commandStartedEvent-commandName-type.json new file mode 100644 index 000000000..121947b06 --- /dev/null +++ b/test/unified-test-format/invalid/expectedCommandEvent-commandStartedEvent-commandName-type.json @@ -0,0 +1,29 @@ +{ + "description": "expectedCommandEvent-commandStartedEvent-commandName-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "commandName": 0 + } + } + ] + } + ] + } + ] +} diff --git a/test/unified-test-format/invalid/expectedCommandEvent-commandStartedEvent-databaseName-type.json b/test/unified-test-format/invalid/expectedCommandEvent-commandStartedEvent-databaseName-type.json new file mode 100644 index 000000000..97d2b84f6 --- /dev/null +++ b/test/unified-test-format/invalid/expectedCommandEvent-commandStartedEvent-databaseName-type.json @@ -0,0 +1,29 @@ +{ + "description": "expectedCommandEvent-commandStartedEvent-databaseName-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "databaseName": 0 + } + } + ] + } + ] + } + ] +} diff --git a/test/unified-test-format/invalid/expectedCommandEvent-commandSucceededEvent-commandName-type.json b/test/unified-test-format/invalid/expectedCommandEvent-commandSucceededEvent-commandName-type.json new file mode 100644 index 000000000..bde2f4817 --- /dev/null +++ b/test/unified-test-format/invalid/expectedCommandEvent-commandSucceededEvent-commandName-type.json @@ -0,0 +1,29 @@ +{ + "description": "expectedCommandEvent-commandSucceededEvent-commandName-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandSucceededEvent": { + "commandName": 0 + } + } + ] + } + ] + } + ] +} diff --git a/test/unified-test-format/invalid/expectedCommandEvent-commandSucceededEvent-reply-type.json b/test/unified-test-format/invalid/expectedCommandEvent-commandSucceededEvent-reply-type.json new file mode 100644 index 000000000..9df04acd2 --- /dev/null +++ b/test/unified-test-format/invalid/expectedCommandEvent-commandSucceededEvent-reply-type.json @@ -0,0 +1,29 @@ +{ + "description": "expectedCommandEvent-commandSucceededEvent-reply-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandSucceededEvent": { + "reply": 0 + } + } + ] + } + ] + } + ] +} diff --git a/test/unified-test-format/invalid/expectedCommandEvent-maxProperties.json b/test/unified-test-format/invalid/expectedCommandEvent-maxProperties.json new file mode 100644 index 000000000..dd8b0e7e7 --- /dev/null +++ b/test/unified-test-format/invalid/expectedCommandEvent-maxProperties.json @@ -0,0 +1,28 @@ +{ + "description": "expectedCommandEvent-maxProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": {}, + "commandSucceededEvent": {} + } + ] + } + ] + } + ] +} diff --git a/test/unified-test-format/invalid/expectedCommandEvent-minProperties.json b/test/unified-test-format/invalid/expectedCommandEvent-minProperties.json new file mode 100644 index 000000000..0f3e711a1 --- /dev/null +++ b/test/unified-test-format/invalid/expectedCommandEvent-minProperties.json @@ -0,0 +1,25 @@ +{ + "description": "expectedCommandEvent-minProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [], + "expectEvents": [ + { + "client": "client0", + "events": [ + {} + ] + } + ] + } + ] +} diff --git a/test/unified-test-format/invalid/expectedEventsForClient-additionalProperties.json b/test/unified-test-format/invalid/expectedEventsForClient-additionalProperties.json index 6ecf5931f..90ed9c327 100644 --- a/test/unified-test-format/invalid/expectedEventsForClient-additionalProperties.json +++ b/test/unified-test-format/invalid/expectedEventsForClient-additionalProperties.json @@ -11,17 +11,12 @@ "tests": [ { "description": "foo", - "operations": [ + "operations": [], + "expectEvents": [ { - "name": "foo", - "object": "client0", - "expectEvents": [ - { - "client": "client0", - "events": [], - "foo": 0 - } - ] + "client": "client0", + "events": [], + "foo": 0 } ] } diff --git a/test/unified-test-format/invalid/expectedEventsForClient-client-required.json b/test/unified-test-format/invalid/expectedEventsForClient-client-required.json index b879db859..24b6330de 100644 --- a/test/unified-test-format/invalid/expectedEventsForClient-client-required.json +++ b/test/unified-test-format/invalid/expectedEventsForClient-client-required.json @@ -11,15 +11,10 @@ "tests": [ { "description": "foo", - "operations": [ + "operations": [], + "expectEvents": [ { - "name": "foo", - "object": "client0", - "expectEvents": [ - { - "events": [] - } - ] + "events": [] } ] } diff --git a/test/unified-test-format/invalid/expectedEventsForClient-client-type.json b/test/unified-test-format/invalid/expectedEventsForClient-client-type.json index 4ee5427df..6e66857ee 100644 --- a/test/unified-test-format/invalid/expectedEventsForClient-client-type.json +++ b/test/unified-test-format/invalid/expectedEventsForClient-client-type.json @@ -11,16 +11,11 @@ "tests": [ { "description": "foo", - "operations": [ + "operations": [], + "expectEvents": [ { - "name": "foo", - "object": "client0", - "expectEvents": [ - { - "client": 0, - "events": [] - } - ] + "client": 0, + "events": [] } ] } diff --git a/test/unified-test-format/invalid/expectedEventsForClient-events-items.json b/test/unified-test-format/invalid/expectedEventsForClient-events-items.json index ee8ce4a40..c1fcd4a6c 100644 --- a/test/unified-test-format/invalid/expectedEventsForClient-events-items.json +++ b/test/unified-test-format/invalid/expectedEventsForClient-events-items.json @@ -11,17 +11,12 @@ "tests": [ { "description": "foo", - "operations": [ + "operations": [], + "expectEvents": [ { - "name": "foo", - "object": "client0", - "expectEvents": [ - { - "client": "client0", - "events": [ - 0 - ] - } + "client": "client0", + "events": [ + 0 ] } ] diff --git a/test/unified-test-format/invalid/expectedEventsForClient-events-required.json b/test/unified-test-format/invalid/expectedEventsForClient-events-required.json index 7f1bc6fb5..39c1e9e12 100644 --- a/test/unified-test-format/invalid/expectedEventsForClient-events-required.json +++ b/test/unified-test-format/invalid/expectedEventsForClient-events-required.json @@ -11,15 +11,10 @@ "tests": [ { "description": "foo", - "operations": [ + "operations": [], + "expectEvents": [ { - "name": "foo", - "object": "client0", - "expectEvents": [ - { - "client": "client0" - } - ] + "client": "client0" } ] } diff --git a/test/unified-test-format/invalid/expectedEventsForClient-events-type.json b/test/unified-test-format/invalid/expectedEventsForClient-events-type.json index f171fc2b9..4199d042b 100644 --- a/test/unified-test-format/invalid/expectedEventsForClient-events-type.json +++ b/test/unified-test-format/invalid/expectedEventsForClient-events-type.json @@ -11,16 +11,11 @@ "tests": [ { "description": "foo", - "operations": [ + "operations": [], + "expectEvents": [ { - "name": "foo", - "object": "client0", - "expectEvents": [ - { - "client": "client0", - "events": 0 - } - ] + "client": "client0", + "events": 0 } ] } diff --git a/test/unified-test-format/valid-fail/entity-client-apiVersion-unsupported.json b/test/unified-test-format/valid-fail/entity-client-apiVersion-unsupported.json new file mode 100644 index 000000000..d92d23dca --- /dev/null +++ b/test/unified-test-format/valid-fail/entity-client-apiVersion-unsupported.json @@ -0,0 +1,20 @@ +{ + "description": "entity-client-apiVersion-unsupported", + "schemaVersion": "1.1", + "createEntities": [ + { + "client": { + "id": "client0", + "serverApi": { + "version": "server_will_never_support_this_api_version" + } + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/unified-test-format/valid-fail/operation-failure.json b/test/unified-test-format/valid-fail/operation-failure.json new file mode 100644 index 000000000..8f6cae152 --- /dev/null +++ b/test/unified-test-format/valid-fail/operation-failure.json @@ -0,0 +1,56 @@ +{ + "description": "operation-failure", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "operation-failure" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + } + ], + "tests": [ + { + "description": "Unsupported command", + "operations": [ + { + "name": "runCommand", + "object": "database0", + "arguments": { + "commandName": "unsupportedCommand", + "command": { + "unsupportedCommand": 1 + } + } + } + ] + }, + { + "description": "Unsupported query operator", + "operations": [ + { + "name": "find", + "object": "collection0", + "arguments": { + "filter": { + "$unsupportedQueryOperator": 1 + } + } + } + ] + } + ] +} diff --git a/test/unified-test-format/valid-pass/poc-retryable-writes.json b/test/unified-test-format/valid-pass/poc-retryable-writes.json index 3e42aacb8..30c1d5415 100644 --- a/test/unified-test-format/valid-pass/poc-retryable-writes.json +++ b/test/unified-test-format/valid-pass/poc-retryable-writes.json @@ -297,13 +297,15 @@ "ordered": true }, "expectResult": { - "insertedCount": { - "$$unsetOrMatches": 2 - }, - "insertedIds": { - "$$unsetOrMatches": { - "0": 3, - "1": 4 + "$$unsetOrMatches": { + "insertedCount": { + "$$unsetOrMatches": 2 + }, + "insertedIds": { + "$$unsetOrMatches": { + "0": 3, + "1": 4 + } } } }