From 196751514281160f5d169193e1db8eb2ebfd8874 Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Mon, 17 May 2021 17:37:01 -0400 Subject: [PATCH] test(NODE-3187): port unified test runner (#2783) Adds typescript compilation for unified runner. Modified package scripts to align with 4.0 branch. CI steps needed to compile the runner. Fixes to bulk result to conform to spec. --- .eslintignore | 3 + .evergreen/install-dependencies.sh | 3 + .evergreen/run-atlas-tests.sh | 2 +- .evergreen/run-checks.sh | 2 +- .evergreen/run-tests.sh | 8 +- .gitignore | 4 + lib/bulk/common.js | 68 + lib/mongo_client.js | 252 +- lib/operations/bulk_write.js | 8 - package-lock.json | 2690 ++++++++--------- package.json | 33 +- test/functional/change_stream.test.js | 51 +- test/functional/gridfs_stream.test.js | 2 +- test/functional/spec-runner/index.js | 9 +- .../unified-spec-runner/entities.ts | 329 ++ test/functional/unified-spec-runner/match.ts | 319 ++ .../unified-spec-runner/operations.ts | 509 ++++ test/functional/unified-spec-runner/runner.ts | 198 ++ test/functional/unified-spec-runner/schema.ts | 168 + .../unified-spec-runner/tsconfig.unified.json | 14 + .../unified-runner.test.js | 33 + .../unified-spec-runner/unified-utils.ts | 90 + test/spec/unified-test-format/Makefile | 24 + .../collectionData-additionalProperties.json | 40 + .../collectionData-additionalProperties.yml | 26 + ...ollectionData-collectionName-required.json | 38 + ...collectionData-collectionName-required.yml | 24 + .../collectionData-collectionName-type.json | 39 + .../collectionData-collectionName-type.yml | 25 + .../collectionData-databaseName-required.json | 38 + .../collectionData-databaseName-required.yml | 24 + .../collectionData-databaseName-type.json | 39 + .../collectionData-databaseName-type.yml | 25 + .../collectionData-documents-items.json | 41 + .../collectionData-documents-items.yml | 25 + .../collectionData-documents-required.json | 38 + .../collectionData-documents-required.yml | 24 + .../collectionData-documents-type.json | 39 + .../invalid/collectionData-documents-type.yml | 25 + ...rDatabaseOptions-additionalProperties.json | 27 + ...OrDatabaseOptions-additionalProperties.yml | 17 + ...ionOrDatabaseOptions-readConcern-type.json | 27 + ...tionOrDatabaseOptions-readConcern-type.yml | 17 + ...OrDatabaseOptions-readPreference-type.json | 27 + ...nOrDatabaseOptions-readPreference-type.yml | 17 + ...onOrDatabaseOptions-writeConcern-type.json | 27 + ...ionOrDatabaseOptions-writeConcern-type.yml | 17 + .../invalid/createEntities-items.json | 13 + .../invalid/createEntities-items.yml | 9 + .../invalid/createEntities-minItems.json | 11 + .../invalid/createEntities-minItems.yml | 9 + .../invalid/createEntities-type.json | 11 + .../invalid/createEntities-type.yml | 9 + .../invalid/description-required.json | 9 + .../invalid/description-required.yml | 7 + .../invalid/entity-additionalProperties.json | 15 + .../invalid/entity-additionalProperties.yml | 10 + .../entity-bucket-additionalProperties.json | 31 + .../entity-bucket-additionalProperties.yml | 19 + .../entity-bucket-bucketOptions-type.json | 31 + .../entity-bucket-bucketOptions-type.yml | 19 + .../entity-bucket-database-required.json | 29 + .../entity-bucket-database-required.yml | 17 + .../invalid/entity-bucket-database-type.json | 30 + .../invalid/entity-bucket-database-type.yml | 18 + .../invalid/entity-bucket-id-required.json | 29 + .../invalid/entity-bucket-id-required.yml | 17 + .../invalid/entity-bucket-id-type.json | 30 + .../invalid/entity-bucket-id-type.yml | 18 + .../entity-client-additionalProperties.json | 18 + .../entity-client-additionalProperties.yml | 12 + .../invalid/entity-client-id-required.json | 15 + .../invalid/entity-client-id-required.yml | 10 + .../invalid/entity-client-id-type.json | 17 + .../invalid/entity-client-id-type.yml | 11 + ...t-ignoreCommandMonitoringEvents-items.json | 20 + ...nt-ignoreCommandMonitoringEvents-items.yml | 12 + ...gnoreCommandMonitoringEvents-minItems.json | 18 + ...ignoreCommandMonitoringEvents-minItems.yml | 12 + ...nt-ignoreCommandMonitoringEvents-type.json | 18 + ...ent-ignoreCommandMonitoringEvents-type.yml | 12 + .../entity-client-observeEvents-enum.json | 20 + .../entity-client-observeEvents-enum.yml | 12 + .../entity-client-observeEvents-items.json | 20 + .../entity-client-observeEvents-items.yml | 12 + .../entity-client-observeEvents-minItems.json | 18 + .../entity-client-observeEvents-minItems.yml | 12 + .../entity-client-observeEvents-type.json | 18 + .../entity-client-observeEvents-type.yml | 12 + ...ient-serverApi-deprecationErrors-type.json | 21 + ...lient-serverApi-deprecationErrors-type.yml | 14 + .../entity-client-serverApi-strict-type.json | 21 + .../entity-client-serverApi-strict-type.yml | 14 + .../invalid/entity-client-serverApi-type.json | 18 + .../invalid/entity-client-serverApi-type.yml | 12 + ...ity-client-serverApi-version-required.json | 18 + ...tity-client-serverApi-version-required.yml | 12 + .../entity-client-serverApi-version-type.json | 20 + .../entity-client-serverApi-version-type.yml | 13 + .../entity-client-uriOptions-type.json | 18 + .../invalid/entity-client-uriOptions-type.yml | 12 + ...ntity-client-useMultipleMongoses-type.json | 18 + ...entity-client-useMultipleMongoses-type.yml | 12 + ...ntity-collection-additionalProperties.json | 32 + ...entity-collection-additionalProperties.yml | 20 + ...ty-collection-collectionName-required.json | 30 + ...ity-collection-collectionName-required.yml | 18 + ...entity-collection-collectionName-type.json | 31 + .../entity-collection-collectionName-type.yml | 19 + ...ity-collection-collectionOptions-type.json | 32 + ...tity-collection-collectionOptions-type.yml | 20 + .../entity-collection-database-required.json | 30 + .../entity-collection-database-required.yml | 18 + .../entity-collection-database-type.json | 31 + .../entity-collection-database-type.yml | 19 + .../entity-collection-id-required.json | 30 + .../invalid/entity-collection-id-required.yml | 18 + .../invalid/entity-collection-id-type.json | 31 + .../invalid/entity-collection-id-type.yml | 19 + .../entity-database-additionalProperties.json | 25 + .../entity-database-additionalProperties.yml | 16 + .../entity-database-client-required.json | 23 + .../entity-database-client-required.yml | 14 + .../invalid/entity-database-client-type.json | 24 + .../invalid/entity-database-client-type.yml | 15 + ...entity-database-databaseName-required.json | 23 + .../entity-database-databaseName-required.yml | 14 + .../entity-database-databaseName-type.json | 24 + .../entity-database-databaseName-type.yml | 15 + .../entity-database-databaseOptions-type.json | 25 + .../entity-database-databaseOptions-type.yml | 16 + .../invalid/entity-database-id-required.json | 23 + .../invalid/entity-database-id-required.yml | 14 + .../invalid/entity-database-id-type.json | 24 + .../invalid/entity-database-id-type.yml | 15 + .../invalid/entity-maxProperties.json | 22 + .../invalid/entity-maxProperties.yml | 15 + .../invalid/entity-minProperties.json | 13 + .../invalid/entity-minProperties.yml | 10 + .../entity-session-additionalProperties.json | 24 + .../entity-session-additionalProperties.yml | 15 + .../entity-session-client-required.json | 22 + .../entity-session-client-required.yml | 13 + .../invalid/entity-session-client-type.json | 23 + .../invalid/entity-session-client-type.yml | 14 + .../invalid/entity-session-id-required.json | 22 + .../invalid/entity-session-id-required.yml | 13 + .../invalid/entity-session-id-type.json | 23 + .../invalid/entity-session-id-type.yml | 14 + .../entity-session-sessionOptions-type.json | 24 + .../entity-session-sessionOptions-type.yml | 15 + .../entity-stream-additionalProperties.json | 19 + .../entity-stream-additionalProperties.yml | 13 + .../entity-stream-hexBytes-pattern.json | 18 + .../entity-stream-hexBytes-pattern.yml | 12 + .../entity-stream-hexBytes-required.json | 17 + .../entity-stream-hexBytes-required.yml | 11 + .../invalid/entity-stream-hexBytes-type.json | 18 + .../invalid/entity-stream-hexBytes-type.yml | 12 + .../invalid/entity-stream-id-required.json | 17 + .../invalid/entity-stream-id-required.yml | 11 + .../invalid/entity-stream-id-type.json | 18 + .../invalid/entity-stream-id-type.yml | 12 + .../expectedError-additionalProperties.json | 25 + .../expectedError-additionalProperties.yml | 15 + .../invalid/expectedError-errorCode-type.json | 25 + .../invalid/expectedError-errorCode-type.yml | 15 + .../expectedError-errorCodeName-type.json | 25 + .../expectedError-errorCodeName-type.yml | 15 + .../expectedError-errorContains-type.json | 25 + .../expectedError-errorContains-type.yml | 15 + ...xpectedError-errorLabelsContain-items.json | 27 + ...expectedError-errorLabelsContain-items.yml | 15 + ...ctedError-errorLabelsContain-minItems.json | 25 + ...ectedError-errorLabelsContain-minItems.yml | 15 + ...expectedError-errorLabelsContain-type.json | 25 + .../expectedError-errorLabelsContain-type.yml | 15 + .../expectedError-errorLabelsOmit-items.json | 27 + .../expectedError-errorLabelsOmit-items.yml | 15 + ...xpectedError-errorLabelsOmit-minItems.json | 25 + ...expectedError-errorLabelsOmit-minItems.yml | 15 + .../expectedError-errorLabelsOmit-type.json | 25 + .../expectedError-errorLabelsOmit-type.yml | 15 + .../expectedError-isClientError-type.json | 25 + .../expectedError-isClientError-type.yml | 15 + .../invalid/expectedError-isError-const.json | 25 + .../invalid/expectedError-isError-const.yml | 15 + .../invalid/expectedError-isError-type.json | 25 + .../invalid/expectedError-isError-type.yml | 15 + .../invalid/expectedError-minProperties.json | 23 + .../invalid/expectedError-minProperties.yml | 14 + .../expectedEvent-additionalProperties.json | 32 + .../expectedEvent-additionalProperties.yml | 17 + ...t-commandFailedEvent-commandName-type.json | 34 + ...nt-commandFailedEvent-commandName-type.yml | 18 + ...mandStartedEvent-additionalProperties.json | 34 + ...mmandStartedEvent-additionalProperties.yml | 18 + ...vent-commandStartedEvent-command-type.json | 34 + ...Event-commandStartedEvent-command-type.yml | 18 + ...-commandStartedEvent-commandName-type.json | 34 + ...t-commandStartedEvent-commandName-type.yml | 18 + ...commandStartedEvent-databaseName-type.json | 34 + ...-commandStartedEvent-databaseName-type.yml | 18 + ...ommandSucceededEvent-commandName-type.json | 34 + ...commandSucceededEvent-commandName-type.yml | 18 + ...vent-commandSucceededEvent-reply-type.json | 34 + ...Event-commandSucceededEvent-reply-type.yml | 18 + .../invalid/expectedEvent-maxProperties.json | 33 + .../invalid/expectedEvent-maxProperties.yml | 18 + .../invalid/expectedEvent-minProperties.json | 30 + .../invalid/expectedEvent-minProperties.yml | 17 + ...dEventsForClient-additionalProperties.json | 29 + ...edEventsForClient-additionalProperties.yml | 17 + ...pectedEventsForClient-client-required.json | 27 + ...xpectedEventsForClient-client-required.yml | 15 + .../expectedEventsForClient-client-type.json | 28 + .../expectedEventsForClient-client-type.yml | 16 + .../expectedEventsForClient-events-items.json | 30 + .../expectedEventsForClient-events-items.yml | 16 + ...pectedEventsForClient-events-required.json | 27 + ...xpectedEventsForClient-events-required.yml | 15 + .../expectedEventsForClient-events-type.json | 28 + .../expectedEventsForClient-events-type.yml | 16 + .../invalid/initialData-items.json | 13 + .../invalid/initialData-items.yml | 9 + .../invalid/initialData-minItems.json | 11 + .../invalid/initialData-minItems.yml | 9 + .../invalid/initialData-type.json | 11 + .../invalid/initialData-type.yml | 9 + .../operation-additionalProperties.json | 23 + .../operation-additionalProperties.yml | 14 + .../invalid/operation-arguments-type.json | 23 + .../invalid/operation-arguments-type.yml | 14 + ...pectError-conflicts_with_expectResult.json | 26 + ...xpectError-conflicts_with_expectResult.yml | 16 + ...ror-conflicts_with_saveResultAsEntity.json | 26 + ...rror-conflicts_with_saveResultAsEntity.yml | 16 + .../invalid/operation-expectError-type.json | 23 + .../invalid/operation-expectError-type.yml | 14 + .../invalid/operation-expectEvents-type.json | 23 + .../invalid/operation-expectEvents-type.yml | 14 + .../invalid/operation-name-required.json | 21 + .../invalid/operation-name-required.yml | 12 + .../invalid/operation-name-type.json | 22 + .../invalid/operation-name-type.yml | 13 + .../invalid/operation-object-required.json | 21 + .../invalid/operation-object-required.yml | 12 + .../invalid/operation-object-type.json | 22 + .../invalid/operation-object-type.yml | 13 + .../operation-saveResultAsEntity-type.json | 23 + .../operation-saveResultAsEntity-type.yml | 14 + ...runOnRequirement-additionalProperties.json | 16 + .../runOnRequirement-additionalProperties.yml | 11 + ...nRequirement-maxServerVersion-pattern.json | 15 + ...OnRequirement-maxServerVersion-pattern.yml | 10 + ...unOnRequirement-maxServerVersion-type.json | 15 + ...runOnRequirement-maxServerVersion-type.yml | 10 + .../runOnRequirement-minProperties.json | 13 + .../runOnRequirement-minProperties.yml | 10 + ...nRequirement-minServerVersion-pattern.json | 15 + ...OnRequirement-minServerVersion-pattern.yml | 10 + ...unOnRequirement-minServerVersion-type.json | 15 + ...runOnRequirement-minServerVersion-type.yml | 10 + .../runOnRequirement-topologies-enum.json | 17 + .../runOnRequirement-topologies-enum.yml | 10 + .../runOnRequirement-topologies-items.json | 17 + .../runOnRequirement-topologies-items.yml | 10 + .../runOnRequirement-topologies-minItems.json | 15 + .../runOnRequirement-topologies-minItems.yml | 10 + .../runOnRequirement-topologies-type.json | 15 + .../runOnRequirement-topologies-type.yml | 10 + .../invalid/runOnRequirements-items.json | 13 + .../invalid/runOnRequirements-items.yml | 9 + .../invalid/runOnRequirements-minItems.json | 11 + .../invalid/runOnRequirements-minItems.yml | 9 + .../invalid/runOnRequirements-type.json | 11 + .../invalid/runOnRequirements-type.yml | 9 + .../invalid/schemaVersion-pattern.json | 10 + .../invalid/schemaVersion-pattern.yml | 7 + .../invalid/schemaVersion-required.json | 9 + .../invalid/schemaVersion-required.yml | 5 + .../invalid/schemaVersion-type.json | 10 + .../invalid/schemaVersion-type.yml | 7 + .../entity-bucket-database-undefined.json | 18 + .../entity-bucket-database-undefined.yml | 12 + .../entity-client-apiVersion-unsupported.json | 20 + .../entity-client-apiVersion-unsupported.yml | 13 + .../entity-collection-database-undefined.json | 19 + .../entity-collection-database-undefined.yml | 13 + .../entity-database-client-undefined.json | 19 + .../entity-database-client-undefined.yml | 13 + .../entity-session-client-undefined.json | 18 + .../entity-session-client-undefined.yml | 12 + .../returnDocument-enum-invalid.json | 66 + .../returnDocument-enum-invalid.yml | 34 + .../valid-fail/schemaVersion-unsupported.json | 10 + .../valid-fail/schemaVersion-unsupported.yml | 7 + .../valid-pass/poc-change-streams.json | 414 +++ .../valid-pass/poc-change-streams.yml | 220 ++ .../valid-pass/poc-command-monitoring.json | 222 ++ .../valid-pass/poc-command-monitoring.yml | 101 + .../valid-pass/poc-crud.json | 446 +++ .../valid-pass/poc-crud.yml | 183 ++ .../valid-pass/poc-gridfs.json | 301 ++ .../valid-pass/poc-gridfs.yml | 155 + .../valid-pass/poc-retryable-reads.json | 433 +++ .../valid-pass/poc-retryable-reads.yml | 193 ++ .../valid-pass/poc-retryable-writes.json | 485 +++ .../valid-pass/poc-retryable-writes.yml | 209 ++ .../valid-pass/poc-sessions.json | 466 +++ .../valid-pass/poc-sessions.yml | 214 ++ .../poc-transactions-convenient-api.json | 505 ++++ .../poc-transactions-convenient-api.yml | 235 ++ .../poc-transactions-mongos-pin-auto.json | 409 +++ .../poc-transactions-mongos-pin-auto.yml | 169 ++ .../valid-pass/poc-transactions.json | 322 ++ .../valid-pass/poc-transactions.yml | 170 ++ test/tools/runner/config.js | 51 + test/tools/runner/index.js | 4 + test/tools/utils.js | 70 + 320 files changed, 14377 insertions(+), 1627 deletions(-) create mode 100644 .eslintignore create mode 100644 test/functional/unified-spec-runner/entities.ts create mode 100644 test/functional/unified-spec-runner/match.ts create mode 100644 test/functional/unified-spec-runner/operations.ts create mode 100644 test/functional/unified-spec-runner/runner.ts create mode 100644 test/functional/unified-spec-runner/schema.ts create mode 100644 test/functional/unified-spec-runner/tsconfig.unified.json create mode 100644 test/functional/unified-spec-runner/unified-runner.test.js create mode 100644 test/functional/unified-spec-runner/unified-utils.ts create mode 100644 test/spec/unified-test-format/Makefile create mode 100644 test/spec/unified-test-format/invalid/collectionData-additionalProperties.json create mode 100644 test/spec/unified-test-format/invalid/collectionData-additionalProperties.yml create mode 100644 test/spec/unified-test-format/invalid/collectionData-collectionName-required.json create mode 100644 test/spec/unified-test-format/invalid/collectionData-collectionName-required.yml create mode 100644 test/spec/unified-test-format/invalid/collectionData-collectionName-type.json create mode 100644 test/spec/unified-test-format/invalid/collectionData-collectionName-type.yml create mode 100644 test/spec/unified-test-format/invalid/collectionData-databaseName-required.json create mode 100644 test/spec/unified-test-format/invalid/collectionData-databaseName-required.yml create mode 100644 test/spec/unified-test-format/invalid/collectionData-databaseName-type.json create mode 100644 test/spec/unified-test-format/invalid/collectionData-databaseName-type.yml create mode 100644 test/spec/unified-test-format/invalid/collectionData-documents-items.json create mode 100644 test/spec/unified-test-format/invalid/collectionData-documents-items.yml create mode 100644 test/spec/unified-test-format/invalid/collectionData-documents-required.json create mode 100644 test/spec/unified-test-format/invalid/collectionData-documents-required.yml create mode 100644 test/spec/unified-test-format/invalid/collectionData-documents-type.json create mode 100644 test/spec/unified-test-format/invalid/collectionData-documents-type.yml create mode 100644 test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-additionalProperties.json create mode 100644 test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-additionalProperties.yml create mode 100644 test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-readConcern-type.json create mode 100644 test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-readConcern-type.yml create mode 100644 test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-readPreference-type.json create mode 100644 test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-readPreference-type.yml create mode 100644 test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-writeConcern-type.json create mode 100644 test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-writeConcern-type.yml create mode 100644 test/spec/unified-test-format/invalid/createEntities-items.json create mode 100644 test/spec/unified-test-format/invalid/createEntities-items.yml create mode 100644 test/spec/unified-test-format/invalid/createEntities-minItems.json create mode 100644 test/spec/unified-test-format/invalid/createEntities-minItems.yml create mode 100644 test/spec/unified-test-format/invalid/createEntities-type.json create mode 100644 test/spec/unified-test-format/invalid/createEntities-type.yml create mode 100644 test/spec/unified-test-format/invalid/description-required.json create mode 100644 test/spec/unified-test-format/invalid/description-required.yml create mode 100644 test/spec/unified-test-format/invalid/entity-additionalProperties.json create mode 100644 test/spec/unified-test-format/invalid/entity-additionalProperties.yml create mode 100644 test/spec/unified-test-format/invalid/entity-bucket-additionalProperties.json create mode 100644 test/spec/unified-test-format/invalid/entity-bucket-additionalProperties.yml create mode 100644 test/spec/unified-test-format/invalid/entity-bucket-bucketOptions-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-bucket-bucketOptions-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-bucket-database-required.json create mode 100644 test/spec/unified-test-format/invalid/entity-bucket-database-required.yml create mode 100644 test/spec/unified-test-format/invalid/entity-bucket-database-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-bucket-database-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-bucket-id-required.json create mode 100644 test/spec/unified-test-format/invalid/entity-bucket-id-required.yml create mode 100644 test/spec/unified-test-format/invalid/entity-bucket-id-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-bucket-id-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-client-additionalProperties.json create mode 100644 test/spec/unified-test-format/invalid/entity-client-additionalProperties.yml create mode 100644 test/spec/unified-test-format/invalid/entity-client-id-required.json create mode 100644 test/spec/unified-test-format/invalid/entity-client-id-required.yml create mode 100644 test/spec/unified-test-format/invalid/entity-client-id-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-client-id-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-items.json create mode 100644 test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-items.yml create mode 100644 test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-minItems.json create mode 100644 test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-minItems.yml create mode 100644 test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-client-observeEvents-enum.json create mode 100644 test/spec/unified-test-format/invalid/entity-client-observeEvents-enum.yml create mode 100644 test/spec/unified-test-format/invalid/entity-client-observeEvents-items.json create mode 100644 test/spec/unified-test-format/invalid/entity-client-observeEvents-items.yml create mode 100644 test/spec/unified-test-format/invalid/entity-client-observeEvents-minItems.json create mode 100644 test/spec/unified-test-format/invalid/entity-client-observeEvents-minItems.yml create mode 100644 test/spec/unified-test-format/invalid/entity-client-observeEvents-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-client-observeEvents-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-client-serverApi-deprecationErrors-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-client-serverApi-deprecationErrors-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-client-serverApi-strict-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-client-serverApi-strict-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-client-serverApi-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-client-serverApi-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-client-serverApi-version-required.json create mode 100644 test/spec/unified-test-format/invalid/entity-client-serverApi-version-required.yml create mode 100644 test/spec/unified-test-format/invalid/entity-client-serverApi-version-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-client-serverApi-version-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-client-uriOptions-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-client-uriOptions-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-client-useMultipleMongoses-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-client-useMultipleMongoses-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-collection-additionalProperties.json create mode 100644 test/spec/unified-test-format/invalid/entity-collection-additionalProperties.yml create mode 100644 test/spec/unified-test-format/invalid/entity-collection-collectionName-required.json create mode 100644 test/spec/unified-test-format/invalid/entity-collection-collectionName-required.yml create mode 100644 test/spec/unified-test-format/invalid/entity-collection-collectionName-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-collection-collectionName-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-collection-collectionOptions-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-collection-collectionOptions-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-collection-database-required.json create mode 100644 test/spec/unified-test-format/invalid/entity-collection-database-required.yml create mode 100644 test/spec/unified-test-format/invalid/entity-collection-database-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-collection-database-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-collection-id-required.json create mode 100644 test/spec/unified-test-format/invalid/entity-collection-id-required.yml create mode 100644 test/spec/unified-test-format/invalid/entity-collection-id-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-collection-id-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-database-additionalProperties.json create mode 100644 test/spec/unified-test-format/invalid/entity-database-additionalProperties.yml create mode 100644 test/spec/unified-test-format/invalid/entity-database-client-required.json create mode 100644 test/spec/unified-test-format/invalid/entity-database-client-required.yml create mode 100644 test/spec/unified-test-format/invalid/entity-database-client-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-database-client-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-database-databaseName-required.json create mode 100644 test/spec/unified-test-format/invalid/entity-database-databaseName-required.yml create mode 100644 test/spec/unified-test-format/invalid/entity-database-databaseName-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-database-databaseName-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-database-databaseOptions-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-database-databaseOptions-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-database-id-required.json create mode 100644 test/spec/unified-test-format/invalid/entity-database-id-required.yml create mode 100644 test/spec/unified-test-format/invalid/entity-database-id-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-database-id-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-maxProperties.json create mode 100644 test/spec/unified-test-format/invalid/entity-maxProperties.yml create mode 100644 test/spec/unified-test-format/invalid/entity-minProperties.json create mode 100644 test/spec/unified-test-format/invalid/entity-minProperties.yml create mode 100644 test/spec/unified-test-format/invalid/entity-session-additionalProperties.json create mode 100644 test/spec/unified-test-format/invalid/entity-session-additionalProperties.yml create mode 100644 test/spec/unified-test-format/invalid/entity-session-client-required.json create mode 100644 test/spec/unified-test-format/invalid/entity-session-client-required.yml create mode 100644 test/spec/unified-test-format/invalid/entity-session-client-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-session-client-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-session-id-required.json create mode 100644 test/spec/unified-test-format/invalid/entity-session-id-required.yml create mode 100644 test/spec/unified-test-format/invalid/entity-session-id-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-session-id-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-session-sessionOptions-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-session-sessionOptions-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-stream-additionalProperties.json create mode 100644 test/spec/unified-test-format/invalid/entity-stream-additionalProperties.yml create mode 100644 test/spec/unified-test-format/invalid/entity-stream-hexBytes-pattern.json create mode 100644 test/spec/unified-test-format/invalid/entity-stream-hexBytes-pattern.yml create mode 100644 test/spec/unified-test-format/invalid/entity-stream-hexBytes-required.json create mode 100644 test/spec/unified-test-format/invalid/entity-stream-hexBytes-required.yml create mode 100644 test/spec/unified-test-format/invalid/entity-stream-hexBytes-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-stream-hexBytes-type.yml create mode 100644 test/spec/unified-test-format/invalid/entity-stream-id-required.json create mode 100644 test/spec/unified-test-format/invalid/entity-stream-id-required.yml create mode 100644 test/spec/unified-test-format/invalid/entity-stream-id-type.json create mode 100644 test/spec/unified-test-format/invalid/entity-stream-id-type.yml create mode 100644 test/spec/unified-test-format/invalid/expectedError-additionalProperties.json create mode 100644 test/spec/unified-test-format/invalid/expectedError-additionalProperties.yml create mode 100644 test/spec/unified-test-format/invalid/expectedError-errorCode-type.json create mode 100644 test/spec/unified-test-format/invalid/expectedError-errorCode-type.yml create mode 100644 test/spec/unified-test-format/invalid/expectedError-errorCodeName-type.json create mode 100644 test/spec/unified-test-format/invalid/expectedError-errorCodeName-type.yml create mode 100644 test/spec/unified-test-format/invalid/expectedError-errorContains-type.json create mode 100644 test/spec/unified-test-format/invalid/expectedError-errorContains-type.yml create mode 100644 test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-items.json create mode 100644 test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-items.yml create mode 100644 test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-minItems.json create mode 100644 test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-minItems.yml create mode 100644 test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-type.json create mode 100644 test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-type.yml create mode 100644 test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-items.json create mode 100644 test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-items.yml create mode 100644 test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-minItems.json create mode 100644 test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-minItems.yml create mode 100644 test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-type.json create mode 100644 test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-type.yml create mode 100644 test/spec/unified-test-format/invalid/expectedError-isClientError-type.json create mode 100644 test/spec/unified-test-format/invalid/expectedError-isClientError-type.yml create mode 100644 test/spec/unified-test-format/invalid/expectedError-isError-const.json create mode 100644 test/spec/unified-test-format/invalid/expectedError-isError-const.yml create mode 100644 test/spec/unified-test-format/invalid/expectedError-isError-type.json create mode 100644 test/spec/unified-test-format/invalid/expectedError-isError-type.yml create mode 100644 test/spec/unified-test-format/invalid/expectedError-minProperties.json create mode 100644 test/spec/unified-test-format/invalid/expectedError-minProperties.yml create mode 100644 test/spec/unified-test-format/invalid/expectedEvent-additionalProperties.json create mode 100644 test/spec/unified-test-format/invalid/expectedEvent-additionalProperties.yml create mode 100644 test/spec/unified-test-format/invalid/expectedEvent-commandFailedEvent-commandName-type.json create mode 100644 test/spec/unified-test-format/invalid/expectedEvent-commandFailedEvent-commandName-type.yml create mode 100644 test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-additionalProperties.json create mode 100644 test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-additionalProperties.yml create mode 100644 test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-command-type.json create mode 100644 test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-command-type.yml create mode 100644 test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-commandName-type.json create mode 100644 test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-commandName-type.yml create mode 100644 test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-databaseName-type.json create mode 100644 test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-databaseName-type.yml create mode 100644 test/spec/unified-test-format/invalid/expectedEvent-commandSucceededEvent-commandName-type.json create mode 100644 test/spec/unified-test-format/invalid/expectedEvent-commandSucceededEvent-commandName-type.yml create mode 100644 test/spec/unified-test-format/invalid/expectedEvent-commandSucceededEvent-reply-type.json create mode 100644 test/spec/unified-test-format/invalid/expectedEvent-commandSucceededEvent-reply-type.yml create mode 100644 test/spec/unified-test-format/invalid/expectedEvent-maxProperties.json create mode 100644 test/spec/unified-test-format/invalid/expectedEvent-maxProperties.yml create mode 100644 test/spec/unified-test-format/invalid/expectedEvent-minProperties.json create mode 100644 test/spec/unified-test-format/invalid/expectedEvent-minProperties.yml create mode 100644 test/spec/unified-test-format/invalid/expectedEventsForClient-additionalProperties.json create mode 100644 test/spec/unified-test-format/invalid/expectedEventsForClient-additionalProperties.yml create mode 100644 test/spec/unified-test-format/invalid/expectedEventsForClient-client-required.json create mode 100644 test/spec/unified-test-format/invalid/expectedEventsForClient-client-required.yml create mode 100644 test/spec/unified-test-format/invalid/expectedEventsForClient-client-type.json create mode 100644 test/spec/unified-test-format/invalid/expectedEventsForClient-client-type.yml create mode 100644 test/spec/unified-test-format/invalid/expectedEventsForClient-events-items.json create mode 100644 test/spec/unified-test-format/invalid/expectedEventsForClient-events-items.yml create mode 100644 test/spec/unified-test-format/invalid/expectedEventsForClient-events-required.json create mode 100644 test/spec/unified-test-format/invalid/expectedEventsForClient-events-required.yml create mode 100644 test/spec/unified-test-format/invalid/expectedEventsForClient-events-type.json create mode 100644 test/spec/unified-test-format/invalid/expectedEventsForClient-events-type.yml create mode 100644 test/spec/unified-test-format/invalid/initialData-items.json create mode 100644 test/spec/unified-test-format/invalid/initialData-items.yml create mode 100644 test/spec/unified-test-format/invalid/initialData-minItems.json create mode 100644 test/spec/unified-test-format/invalid/initialData-minItems.yml create mode 100644 test/spec/unified-test-format/invalid/initialData-type.json create mode 100644 test/spec/unified-test-format/invalid/initialData-type.yml create mode 100644 test/spec/unified-test-format/invalid/operation-additionalProperties.json create mode 100644 test/spec/unified-test-format/invalid/operation-additionalProperties.yml create mode 100644 test/spec/unified-test-format/invalid/operation-arguments-type.json create mode 100644 test/spec/unified-test-format/invalid/operation-arguments-type.yml create mode 100644 test/spec/unified-test-format/invalid/operation-expectError-conflicts_with_expectResult.json create mode 100644 test/spec/unified-test-format/invalid/operation-expectError-conflicts_with_expectResult.yml create mode 100644 test/spec/unified-test-format/invalid/operation-expectError-conflicts_with_saveResultAsEntity.json create mode 100644 test/spec/unified-test-format/invalid/operation-expectError-conflicts_with_saveResultAsEntity.yml create mode 100644 test/spec/unified-test-format/invalid/operation-expectError-type.json create mode 100644 test/spec/unified-test-format/invalid/operation-expectError-type.yml create mode 100644 test/spec/unified-test-format/invalid/operation-expectEvents-type.json create mode 100644 test/spec/unified-test-format/invalid/operation-expectEvents-type.yml create mode 100644 test/spec/unified-test-format/invalid/operation-name-required.json create mode 100644 test/spec/unified-test-format/invalid/operation-name-required.yml create mode 100644 test/spec/unified-test-format/invalid/operation-name-type.json create mode 100644 test/spec/unified-test-format/invalid/operation-name-type.yml create mode 100644 test/spec/unified-test-format/invalid/operation-object-required.json create mode 100644 test/spec/unified-test-format/invalid/operation-object-required.yml create mode 100644 test/spec/unified-test-format/invalid/operation-object-type.json create mode 100644 test/spec/unified-test-format/invalid/operation-object-type.yml create mode 100644 test/spec/unified-test-format/invalid/operation-saveResultAsEntity-type.json create mode 100644 test/spec/unified-test-format/invalid/operation-saveResultAsEntity-type.yml create mode 100644 test/spec/unified-test-format/invalid/runOnRequirement-additionalProperties.json create mode 100644 test/spec/unified-test-format/invalid/runOnRequirement-additionalProperties.yml create mode 100644 test/spec/unified-test-format/invalid/runOnRequirement-maxServerVersion-pattern.json create mode 100644 test/spec/unified-test-format/invalid/runOnRequirement-maxServerVersion-pattern.yml create mode 100644 test/spec/unified-test-format/invalid/runOnRequirement-maxServerVersion-type.json create mode 100644 test/spec/unified-test-format/invalid/runOnRequirement-maxServerVersion-type.yml create mode 100644 test/spec/unified-test-format/invalid/runOnRequirement-minProperties.json create mode 100644 test/spec/unified-test-format/invalid/runOnRequirement-minProperties.yml create mode 100644 test/spec/unified-test-format/invalid/runOnRequirement-minServerVersion-pattern.json create mode 100644 test/spec/unified-test-format/invalid/runOnRequirement-minServerVersion-pattern.yml create mode 100644 test/spec/unified-test-format/invalid/runOnRequirement-minServerVersion-type.json create mode 100644 test/spec/unified-test-format/invalid/runOnRequirement-minServerVersion-type.yml create mode 100644 test/spec/unified-test-format/invalid/runOnRequirement-topologies-enum.json create mode 100644 test/spec/unified-test-format/invalid/runOnRequirement-topologies-enum.yml create mode 100644 test/spec/unified-test-format/invalid/runOnRequirement-topologies-items.json create mode 100644 test/spec/unified-test-format/invalid/runOnRequirement-topologies-items.yml create mode 100644 test/spec/unified-test-format/invalid/runOnRequirement-topologies-minItems.json create mode 100644 test/spec/unified-test-format/invalid/runOnRequirement-topologies-minItems.yml create mode 100644 test/spec/unified-test-format/invalid/runOnRequirement-topologies-type.json create mode 100644 test/spec/unified-test-format/invalid/runOnRequirement-topologies-type.yml create mode 100644 test/spec/unified-test-format/invalid/runOnRequirements-items.json create mode 100644 test/spec/unified-test-format/invalid/runOnRequirements-items.yml create mode 100644 test/spec/unified-test-format/invalid/runOnRequirements-minItems.json create mode 100644 test/spec/unified-test-format/invalid/runOnRequirements-minItems.yml create mode 100644 test/spec/unified-test-format/invalid/runOnRequirements-type.json create mode 100644 test/spec/unified-test-format/invalid/runOnRequirements-type.yml create mode 100644 test/spec/unified-test-format/invalid/schemaVersion-pattern.json create mode 100644 test/spec/unified-test-format/invalid/schemaVersion-pattern.yml create mode 100644 test/spec/unified-test-format/invalid/schemaVersion-required.json create mode 100644 test/spec/unified-test-format/invalid/schemaVersion-required.yml create mode 100644 test/spec/unified-test-format/invalid/schemaVersion-type.json create mode 100644 test/spec/unified-test-format/invalid/schemaVersion-type.yml create mode 100644 test/spec/unified-test-format/valid-fail/entity-bucket-database-undefined.json create mode 100644 test/spec/unified-test-format/valid-fail/entity-bucket-database-undefined.yml create mode 100644 test/spec/unified-test-format/valid-fail/entity-client-apiVersion-unsupported.json create mode 100644 test/spec/unified-test-format/valid-fail/entity-client-apiVersion-unsupported.yml create mode 100644 test/spec/unified-test-format/valid-fail/entity-collection-database-undefined.json create mode 100644 test/spec/unified-test-format/valid-fail/entity-collection-database-undefined.yml create mode 100644 test/spec/unified-test-format/valid-fail/entity-database-client-undefined.json create mode 100644 test/spec/unified-test-format/valid-fail/entity-database-client-undefined.yml create mode 100644 test/spec/unified-test-format/valid-fail/entity-session-client-undefined.json create mode 100644 test/spec/unified-test-format/valid-fail/entity-session-client-undefined.yml create mode 100644 test/spec/unified-test-format/valid-fail/returnDocument-enum-invalid.json create mode 100644 test/spec/unified-test-format/valid-fail/returnDocument-enum-invalid.yml create mode 100644 test/spec/unified-test-format/valid-fail/schemaVersion-unsupported.json create mode 100644 test/spec/unified-test-format/valid-fail/schemaVersion-unsupported.yml create mode 100644 test/spec/unified-test-format/valid-pass/poc-change-streams.json create mode 100644 test/spec/unified-test-format/valid-pass/poc-change-streams.yml create mode 100644 test/spec/unified-test-format/valid-pass/poc-command-monitoring.json create mode 100644 test/spec/unified-test-format/valid-pass/poc-command-monitoring.yml create mode 100644 test/spec/unified-test-format/valid-pass/poc-crud.json create mode 100644 test/spec/unified-test-format/valid-pass/poc-crud.yml create mode 100644 test/spec/unified-test-format/valid-pass/poc-gridfs.json create mode 100644 test/spec/unified-test-format/valid-pass/poc-gridfs.yml create mode 100644 test/spec/unified-test-format/valid-pass/poc-retryable-reads.json create mode 100644 test/spec/unified-test-format/valid-pass/poc-retryable-reads.yml create mode 100644 test/spec/unified-test-format/valid-pass/poc-retryable-writes.json create mode 100644 test/spec/unified-test-format/valid-pass/poc-retryable-writes.yml create mode 100644 test/spec/unified-test-format/valid-pass/poc-sessions.json create mode 100644 test/spec/unified-test-format/valid-pass/poc-sessions.yml create mode 100644 test/spec/unified-test-format/valid-pass/poc-transactions-convenient-api.json create mode 100644 test/spec/unified-test-format/valid-pass/poc-transactions-convenient-api.yml create mode 100644 test/spec/unified-test-format/valid-pass/poc-transactions-mongos-pin-auto.json create mode 100644 test/spec/unified-test-format/valid-pass/poc-transactions-mongos-pin-auto.yml create mode 100644 test/spec/unified-test-format/valid-pass/poc-transactions.json create mode 100644 test/spec/unified-test-format/valid-pass/poc-transactions.yml diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000000..87546ef088 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +test/functional/unified-spec-runner/*.js +!test/functional/unified-spec-runner/unified-runner.test.js +docs diff --git a/.evergreen/install-dependencies.sh b/.evergreen/install-dependencies.sh index 05634741fe..186dabffb3 100644 --- a/.evergreen/install-dependencies.sh +++ b/.evergreen/install-dependencies.sh @@ -75,6 +75,7 @@ if [[ "$OS" == "Windows_NT" ]]; then root: $NVM_HOME path: $NVM_SYMLINK EOT + nvm install 12 nvm install $NODE_VERSION nvm use $NODE_VERSION which node || echo "node not found, PATH=$PATH" @@ -86,7 +87,9 @@ EOT else curl -o- $NVM_URL | bash [ -s "${NVM_DIR}/nvm.sh" ] && \. "${NVM_DIR}/nvm.sh" + nvm install --no-progress 12 nvm install --no-progress $NODE_VERSION + nvm use $NODE_VERSION # setup npm cache in a local directory cat < .npmrc diff --git a/.evergreen/run-atlas-tests.sh b/.evergreen/run-atlas-tests.sh index fd1706823d..e3920d7229 100644 --- a/.evergreen/run-atlas-tests.sh +++ b/.evergreen/run-atlas-tests.sh @@ -7,4 +7,4 @@ NODE_ARTIFACTS_PATH="${PROJECT_DIRECTORY}/node-artifacts" export NVM_DIR="${NODE_ARTIFACTS_PATH}/nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" -npm run atlas +npm run check:atlas diff --git a/.evergreen/run-checks.sh b/.evergreen/run-checks.sh index 2274bc9efa..ff755a4d8e 100644 --- a/.evergreen/run-checks.sh +++ b/.evergreen/run-checks.sh @@ -6,4 +6,4 @@ NODE_ARTIFACTS_PATH="${PROJECT_DIRECTORY}/node-artifacts" export NVM_DIR="${NODE_ARTIFACTS_PATH}/nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" -npm run lint +npm run check:lint diff --git a/.evergreen/run-tests.sh b/.evergreen/run-tests.sh index b44d304b97..09cfe8f173 100755 --- a/.evergreen/run-tests.sh +++ b/.evergreen/run-tests.sh @@ -8,14 +8,14 @@ set -o errexit # Exit the script with error if any of the commands fail # UNIFIED Set to enable the Unified SDAM topology for the node driver # MONGODB_URI Set the suggested connection MONGODB_URI (including credentials and topology info) # MARCH Machine Architecture. Defaults to lowercase uname -m -# TEST_NPM_SCRIPT Script to npm run. Defaults to "test-nolint" +# TEST_NPM_SCRIPT Script to npm run. Defaults to "check:test" # SKIP_DEPS Skip installing dependencies # NO_EXIT Don't exit early from tests that leak resources AUTH=${AUTH:-noauth} UNIFIED=${UNIFIED:-0} MONGODB_URI=${MONGODB_URI:-} -TEST_NPM_SCRIPT=${TEST_NPM_SCRIPT:-test-nolint} +TEST_NPM_SCRIPT=${TEST_NPM_SCRIPT:-"check:test"} if [[ -z "${NO_EXIT}" ]]; then TEST_NPM_SCRIPT="$TEST_NPM_SCRIPT -- --exit" fi @@ -55,4 +55,8 @@ else npm install mongodb-client-encryption@latest fi +nvm use 12 +npm run build:unified +nvm use "$NODE_VERSION" + MONGODB_UNIFIED_TOPOLOGY=${UNIFIED} MONGODB_URI=${MONGODB_URI} npm run ${TEST_NPM_SCRIPT} diff --git a/.gitignore b/.gitignore index abd919a61b..1f1c1e26e3 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,7 @@ yarn.lock .vscode output + +# Unified Runner +test/functional/unified-spec-runner/*.js +!test/functional/unified-spec-runner/unified-runner.test.js diff --git a/lib/bulk/common.js b/lib/bulk/common.js index c99c876959..cfc661e02f 100644 --- a/lib/bulk/common.js +++ b/lib/bulk/common.js @@ -71,6 +71,45 @@ class BulkWriteResult { this.result = bulkResult; } + /** Number of documents inserted. */ + get insertedCount() { + return typeof this.result.nInserted !== 'number' ? 0 : this.result.nInserted; + } + /** Number of documents matched for update. */ + get matchedCount() { + return typeof this.result.nMatched !== 'number' ? 0 : this.result.nMatched; + } + /** Number of documents modified. */ + get modifiedCount() { + return typeof this.result.nModified !== 'number' ? 0 : this.result.nModified; + } + /** Number of documents deleted. */ + get deletedCount() { + return typeof this.result.nRemoved !== 'number' ? 0 : this.result.nRemoved; + } + /** Number of documents upserted. */ + get upsertedCount() { + return !this.result.upserted ? 0 : this.result.upserted.length; + } + + /** Upserted document generated Id's, hash key is the index of the originating operation */ + get upsertedIds() { + const upserted = {}; + for (const doc of !this.result.upserted ? [] : this.result.upserted) { + upserted[doc.index] = doc._id; + } + return upserted; + } + + /** Inserted document generated Id's, hash key is the index of the originating operation */ + get insertedIds() { + const inserted = {}; + for (const doc of !this.result.insertedIds ? [] : this.result.insertedIds) { + inserted[doc.index] = doc._id; + } + return inserted; + } + /** * Evaluates to true if the bulk operation correctly executes * @type {boolean} @@ -572,6 +611,35 @@ class BulkWriteError extends MongoError { this.name = 'BulkWriteError'; this.result = result; } + + /** Number of documents inserted. */ + get insertedCount() { + return this.result.insertedCount; + } + /** Number of documents matched for update. */ + get matchedCount() { + return this.result.matchedCount; + } + /** Number of documents modified. */ + get modifiedCount() { + return this.result.modifiedCount; + } + /** Number of documents deleted. */ + get deletedCount() { + return this.result.deletedCount; + } + /** Number of documents upserted. */ + get upsertedCount() { + return this.result.upsertedCount; + } + /** Inserted document generated Id's, hash key is the index of the originating operation */ + get insertedIds() { + return this.result.insertedIds; + } + /** Upserted document generated Id's, hash key is the index of the originating operation */ + get upsertedIds() { + return this.result.upsertedIds; + } } /** diff --git a/lib/mongo_client.js b/lib/mongo_client.js index 7058b5ad78..7e11512bf1 100644 --- a/lib/mongo_client.js +++ b/lib/mongo_client.js @@ -90,86 +90,82 @@ const validOptions = require('./operations/connect').validOptions; */ /** - * Creates a new MongoClient instance - * @class - * @param {string} url The connection URI string - * @param {object} [options] Optional settings - * @param {number} [options.poolSize=5] The maximum size of the individual server pool - * @param {boolean} [options.ssl=false] Enable SSL connection. *deprecated* use `tls` variants - * @param {boolean} [options.sslValidate=false] Validate mongod server certificate against Certificate Authority - * @param {buffer} [options.sslCA=undefined] SSL Certificate store binary buffer *deprecated* use `tls` variants - * @param {buffer} [options.sslCert=undefined] SSL Certificate binary buffer *deprecated* use `tls` variants - * @param {buffer} [options.sslKey=undefined] SSL Key file binary buffer *deprecated* use `tls` variants - * @param {string} [options.sslPass=undefined] SSL Certificate pass phrase *deprecated* use `tls` variants - * @param {buffer} [options.sslCRL=undefined] SSL Certificate revocation list binary buffer *deprecated* use `tls` variants - * @param {boolean|function} [options.checkServerIdentity=true] Ensure we check server identify during SSL, set to false to disable checking. Only works for Node 0.12.x or higher. You can pass in a boolean or your own checkServerIdentity override function. *deprecated* use `tls` variants - * @param {boolean} [options.tls=false] Enable TLS connections - * @param {boolean} [options.tlsInsecure=false] Relax TLS constraints, disabling validation - * @param {string} [options.tlsCAFile] A path to file with either a single or bundle of certificate authorities to be considered trusted when making a TLS connection - * @param {string} [options.tlsCertificateKeyFile] A path to the client certificate file or the client private key file; in the case that they both are needed, the files should be concatenated - * @param {string} [options.tlsCertificateKeyFilePassword] The password to decrypt the client private key to be used for TLS connections - * @param {boolean} [options.tlsAllowInvalidCertificates] Specifies whether or not the driver should error when the server’s TLS certificate is invalid - * @param {boolean} [options.tlsAllowInvalidHostnames] Specifies whether or not the driver should error when there is a mismatch between the server’s hostname and the hostname specified by the TLS certificate - * @param {boolean} [options.autoReconnect=true] Enable autoReconnect for single server instances - * @param {boolean} [options.noDelay=true] TCP Connection no delay - * @param {boolean} [options.keepAlive=true] TCP Connection keep alive enabled - * @param {number} [options.keepAliveInitialDelay=120000] The number of milliseconds to wait before initiating keepAlive on the TCP socket - * @param {number} [options.connectTimeoutMS=10000] How long to wait for a connection to be established before timing out - * @param {number} [options.socketTimeoutMS=0] How long a send or receive on a socket can take before timing out - * @param {number} [options.family] Version of IP stack. Can be 4, 6 or null (default). - * If null, will attempt to connect with IPv6, and will fall back to IPv4 on failure - * @param {number} [options.reconnectTries=30] Server attempt to reconnect #times - * @param {number} [options.reconnectInterval=1000] Server will wait # milliseconds between retries - * @param {boolean} [options.ha=true] Control if high availability monitoring runs for Replicaset or Mongos proxies - * @param {number} [options.haInterval=10000] The High availability period for replicaset inquiry - * @param {string} [options.replicaSet=undefined] The Replicaset set name - * @param {number} [options.secondaryAcceptableLatencyMS=15] Cutoff latency point in MS for Replicaset member selection - * @param {number} [options.acceptableLatencyMS=15] Cutoff latency point in MS for Mongos proxies selection - * @param {boolean} [options.connectWithNoPrimary=false] Sets if the driver should connect even if no primary is available - * @param {string} [options.authSource=undefined] Define the database to authenticate against - * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead. - * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead. - * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead. - * @param {boolean} [options.fsync=false] **Deprecated** Specify a file sync write concern. Use writeConcern instead. - * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings. - * @param {boolean} [options.forceServerObjectId=false] Force server to assign _id values instead of driver - * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object - * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields - * @param {boolean} [options.raw=false] Return document results as raw BSON buffers - * @param {number} [options.bufferMaxEntries=-1] Sets a cap on how many operations the driver will buffer up before giving up on getting a working connection, default is -1 which is unlimited - * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST) - * @param {object} [options.pkFactory] A primary key factory object for generation of custom _id keys - * @param {object} [options.promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible - * @param {object} [options.readConcern] Specify a read concern for the collection (only MongoDB 3.2 or higher supported) - * @param {ReadConcernLevel} [options.readConcern.level='local'] Specify a read concern level for the collection operations (only MongoDB 3.2 or higher supported) - * @param {number} [options.maxStalenessSeconds=undefined] The max staleness to secondary reads (values under 10 seconds cannot be guaranteed) - * @param {string} [options.loggerLevel=undefined] The logging level (error/warn/info/debug) - * @param {object} [options.logger=undefined] Custom logger object - * @param {boolean} [options.promoteValues=true] Promotes BSON values to native types where possible, set to false to only receive wrapper types - * @param {boolean} [options.promoteBuffers=false] Promotes Binary BSON values to native Node Buffers - * @param {boolean} [options.promoteLongs=true] Promotes long values to number if they fit inside the 53 bits resolution - * @param {boolean} [options.domainsEnabled=false] Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit - * @param {object} [options.validateOptions=false] Validate MongoClient passed in options for correctness - * @param {string} [options.appname=undefined] The name of the application that created this MongoClient instance. MongoDB 3.4 and newer will print this value in the server log upon establishing each connection. It is also recorded in the slow query log and profile collections - * @param {string} [options.auth.user=undefined] The username for auth - * @param {string} [options.auth.password=undefined] The password for auth - * @param {string} [options.authMechanism] An authentication mechanism to use for connection authentication, see the {@link https://docs.mongodb.com/manual/reference/connection-string/#urioption.authMechanism|authMechanism} reference for supported options. - * @param {object} [options.compression] Type of compression to use: snappy or zlib - * @param {array} [options.readPreferenceTags] Read preference tags - * @param {number} [options.numberOfRetries=5] The number of retries for a tailable cursor - * @param {boolean} [options.auto_reconnect=true] Enable auto reconnecting for single server instances - * @param {boolean} [options.monitorCommands=false] Enable command monitoring for this client - * @param {number} [options.minSize] If present, the connection pool will be initialized with minSize connections, and will never dip below minSize connections - * @param {boolean} [options.useNewUrlParser=true] Determines whether or not to use the new url parser. Enables the new, spec-compliant, url parser shipped in the core driver. This url parser fixes a number of problems with the original parser, and aims to outright replace that parser in the near future. Defaults to true, and must be explicitly set to false to use the legacy url parser. - * @param {boolean} [options.useUnifiedTopology] Enables the new unified topology layer - * @param {Number} [options.localThresholdMS=15] **Only applies to the unified topology** The size of the latency window for selecting among multiple suitable servers - * @param {Number} [options.serverSelectionTimeoutMS=30000] **Only applies to the unified topology** How long to block for server selection before throwing an error - * @param {Number} [options.heartbeatFrequencyMS=10000] **Only applies to the unified topology** The frequency with which topology updates are scheduled - * @param {number} [options.maxPoolSize=10] **Only applies to the unified topology** The maximum number of connections that may be associated with a pool at a given time. This includes in use and available connections. - * @param {number} [options.minPoolSize=0] **Only applies to the unified topology** The minimum number of connections that MUST exist at any moment in a single connection pool. - * @param {number} [options.maxIdleTimeMS] **Only applies to the unified topology** The maximum amount of time a connection should remain idle in the connection pool before being marked idle. The default is infinity. - * @param {number} [options.waitQueueTimeoutMS=0] **Only applies to the unified topology** The maximum amount of time operation execution should wait for a connection to become available. The default is 0 which means there is no limit. - * @param {AutoEncryptionOptions} [options.autoEncryption] Optionally enable client side auto encryption. + * @typedef {object} MongoClientOptions + * @property {number} [poolSize] (**default**: 5) The maximum size of the individual server pool + * @property {boolean} [ssl] (**default**: false) Enable SSL connection. *deprecated* use `tls` variants + * @property {boolean} [sslValidate] (**default**: false) Validate mongod server certificate against Certificate Authority + * @property {buffer} [sslCA] (**default**: undefined) SSL Certificate store binary buffer *deprecated* use `tls` variants + * @property {buffer} [sslCert] (**default**: undefined) SSL Certificate binary buffer *deprecated* use `tls` variants + * @property {buffer} [sslKey] (**default**: undefined) SSL Key file binary buffer *deprecated* use `tls` variants + * @property {string} [sslPass] (**default**: undefined) SSL Certificate pass phrase *deprecated* use `tls` variants + * @property {buffer} [sslCRL] (**default**: undefined) SSL Certificate revocation list binary buffer *deprecated* use `tls` variants + * @property {boolean|function} [checkServerIdentity] (**default**: true) Ensure we check server identify during SSL, set to false to disable checking. Only works for Node 0.12.x or higher. You can pass in a boolean or your own checkServerIdentity override function. *deprecated* use `tls` variants + * @property {boolean} [tls] (**default**: false) Enable TLS connections + * @property {boolean} [tlsInsecure] (**default**: false) Relax TLS constraints, disabling validation + * @property {string} [tlsCAFile] A path to file with either a single or bundle of certificate authorities to be considered trusted when making a TLS connection + * @property {string} [tlsCertificateKeyFile] A path to the client certificate file or the client private key file; in the case that they both are needed, the files should be concatenated + * @property {string} [tlsCertificateKeyFilePassword] The password to decrypt the client private key to be used for TLS connections + * @property {boolean} [tlsAllowInvalidCertificates] Specifies whether or not the driver should error when the server’s TLS certificate is invalid + * @property {boolean} [tlsAllowInvalidHostnames] Specifies whether or not the driver should error when there is a mismatch between the server’s hostname and the hostname specified by the TLS certificate + * @property {boolean} [autoReconnect] (**default**: true) Enable autoReconnect for single server instances + * @property {boolean} [noDelay] (**default**: true) TCP Connection no delay + * @property {boolean} [keepAlive] (**default**: true) TCP Connection keep alive enabled + * @property {number} [keepAliveInitialDelay] (**default**: 120000) The number of milliseconds to wait before initiating keepAlive on the TCP socket + * @property {number} [connectTimeoutMS] (**default**: 10000) How long to wait for a connection to be established before timing out + * @property {number} [socketTimeoutMS] (**default**: 0) How long a send or receive on a socket can take before timing out + * @property {number} [family] Version of IP stack. Can be 4, 6 or null (default). If null, will attempt to connect with IPv6, and will fall back to IPv4 on failure + * @property {number} [reconnectTries] (**default**: 30) Server attempt to reconnect #times + * @property {number} [reconnectInterval] (**default**: 1000) Server will wait # milliseconds between retries + * @property {boolean} [ha] (**default**: true) Control if high availability monitoring runs for Replicaset or Mongos proxies + * @property {number} [haInterval] (**default**: 10000) The High availability period for replicaset inquiry + * @property {string} [replicaSet] (**default**: undefined) The Replicaset set name + * @property {number} [secondaryAcceptableLatencyMS] (**default**: 15) Cutoff latency point in MS for Replicaset member selection + * @property {number} [acceptableLatencyMS] (**default**: 15) Cutoff latency point in MS for Mongos proxies selection + * @property {boolean} [connectWithNoPrimary] (**default**: false) Sets if the driver should connect even if no primary is available + * @property {string} [authSource] (**default**: undefined) Define the database to authenticate against + * @property {(number|string)} [w] **Deprecated** The write concern. Use writeConcern instead. + * @property {number} [wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead. + * @property {boolean} [j] (**default**: false) **Deprecated** Specify a journal write concern. Use writeConcern instead. + * @property {boolean} [fsync] (**default**: false) **Deprecated** Specify a file sync write concern. Use writeConcern instead. + * @property {object|WriteConcern} [writeConcern] Specify write concern settings. + * @property {boolean} [forceServerObjectId] (**default**: false) Force server to assign _id values instead of driver + * @property {boolean} [serializeFunctions] (**default**: false) Serialize functions on any object + * @property {Boolean} [ignoreUndefined] (**default**: false) Specify if the BSON serializer should ignore undefined fields + * @property {boolean} [raw] (**default**: false) Return document results as raw BSON buffers + * @property {number} [bufferMaxEntries] (**default**: -1) Sets a cap on how many operations the driver will buffer up before giving up on getting a working connection, default is -1 which is unlimited + * @property {(ReadPreference|string)} [readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST) + * @property {object} [pkFactory] A primary key factory object for generation of custom _id keys + * @property {object} [promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible + * @property {object} [readConcern] Specify a read concern for the collection (only MongoDB 3.2 or higher supported) + * @property {ReadConcernLevel} [readConcern.level] (**default**: {Level: 'local'}) Specify a read concern level for the collection operations (only MongoDB 3.2 or higher supported) + * @property {number} [maxStalenessSeconds] (**default**: undefined) The max staleness to secondary reads (values under 10 seconds cannot be guaranteed) + * @property {string} [loggerLevel] (**default**: undefined) The logging level (error/warn/info/debug) + * @property {object} [logger] (**default**: undefined) Custom logger object + * @property {boolean} [promoteValues] (**default**: true) Promotes BSON values to native types where possible, set to false to only receive wrapper types + * @property {boolean} [promoteBuffers] (**default**: false) Promotes Binary BSON values to native Node Buffers + * @property {boolean} [promoteLongs] (**default**: true) Promotes long values to number if they fit inside the 53 bits resolution + * @property {boolean} [domainsEnabled] (**default**: false) Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit + * @property {object} [validateOptions] (**default**: false) Validate MongoClient passed in options for correctness + * @property {string} [appname] (**default**: undefined) The name of the application that created this MongoClient instance. MongoDB 3.4 and newer will print this value in the server log upon establishing each connection. It is also recorded in the slow query log and profile collections + * @property {string} [options.auth.user] (**default**: undefined) The username for auth + * @property {string} [options.auth.password] (**default**: undefined) The password for auth + * @property {string} [authMechanism] An authentication mechanism to use for connection authentication, see the {@link https://docs.mongodb.com/manual/reference/connection-string/#urioption.authMechanism|authMechanism} reference for supported options. + * @property {object} [compression] Type of compression to use: snappy or zlib + * @property {array} [readPreferenceTags] Read preference tags + * @property {number} [numberOfRetries] (**default**: 5) The number of retries for a tailable cursor + * @property {boolean} [auto_reconnect] (**default**: true) Enable auto reconnecting for single server instances + * @property {boolean} [monitorCommands] (**default**: false) Enable command monitoring for this client + * @property {number} [minSize] If present, the connection pool will be initialized with minSize connections, and will never dip below minSize connections + * @property {boolean} [useNewUrlParser] (**default**: true) Determines whether or not to use the new url parser. Enables the new, spec-compliant, url parser shipped in the core driver. This url parser fixes a number of problems with the original parser, and aims to outright replace that parser in the near future. Defaults to true, and must be explicitly set to false to use the legacy url parser. + * @property {boolean} [useUnifiedTopology] Enables the new unified topology layer + * @property {number} [localThresholdMS] (**default**: 15) **Only applies to the unified topology** The size of the latency window for selecting among multiple suitable servers + * @property {number} [serverSelectionTimeoutMS] (**default**: 30000) **Only applies to the unified topology** How long to block for server selection before throwing an error + * @property {number} [heartbeatFrequencyMS] (**default**: 10000) **Only applies to the unified topology** The frequency with which topology updates are scheduled + * @property {number} [maxPoolSize] (**default**: 10) **Only applies to the unified topology** The maximum number of connections that may be associated with a pool at a given time. This includes in use and available connections. + * @property {number} [minPoolSize] (**default**: 0) **Only applies to the unified topology** The minimum number of connections that MUST exist at any moment in a single connection pool. + * @property {number} [maxIdleTimeMS] **Only applies to the unified topology** The maximum amount of time a connection should remain idle in the connection pool before being marked idle. The default is infinity. + * @property {number} [waitQueueTimeoutMS] (**default**: 0) **Only applies to the unified topology** The maximum amount of time operation execution should wait for a connection to become available. The default is 0 which means there is no limit. + * @property {AutoEncryptionOptions} [autoEncryption] Optionally enable client side auto encryption. * * > Automatic encryption is an enterprise only feature that only applies to operations on a collection. Automatic encryption is not supported for operations on a database or view, and operations that are not bypassed will result in error * > (see [libmongocrypt: Auto Encryption Allow-List](https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.rst#libmongocrypt-auto-encryption-allow-list)). To bypass automatic encryption for all operations, set bypassAutoEncryption=true in AutoEncryptionOpts. @@ -181,10 +177,17 @@ const validOptions = require('./operations/connect').validOptions; * > - AutoEncryptionOptions.bypassAutomaticEncryption is false. * > If an internal MongoClient is created, it is configured with the same options as the parent MongoClient except minPoolSize is set to 0 and AutoEncryptionOptions is omitted. * - * @param {DriverInfoOptions} [options.driverInfo] Allows a wrapping driver to amend the client metadata generated by the driver to include information about the wrapping driver - * @param {boolean} [options.directConnection=false] Enable directConnection - * @param {MongoClient~connectCallback} [callback] The command result callback - * @return {MongoClient} a MongoClient instance + * @property {DriverInfoOptions} [driverInfo] Allows a wrapping driver to amend the client metadata generated by the driver to include information about the wrapping driver + * @property {boolean} [directConnection] (**default**: false) Enable directConnection + * @property {function} [callback] The command result callback + */ + +/** + * Creates a new MongoClient instance + * @constructor + * @extends {EventEmitter} + * @param {string} url The connection URI string + * @param {MongoClientOptions} [options] Optional settings */ function MongoClient(url, options) { if (!(this instanceof MongoClient)) return new MongoClient(url, options); @@ -382,86 +385,7 @@ MongoClient.prototype.isConnected = function(options) { * @method * @static * @param {string} url The connection URI string - * @param {object} [options] Optional settings - * @param {number} [options.poolSize=5] The maximum size of the individual server pool - * @param {boolean} [options.ssl=false] Enable SSL connection. *deprecated* use `tls` variants - * @param {boolean} [options.sslValidate=false] Validate mongod server certificate against Certificate Authority - * @param {buffer} [options.sslCA=undefined] SSL Certificate store binary buffer *deprecated* use `tls` variants - * @param {buffer} [options.sslCert=undefined] SSL Certificate binary buffer *deprecated* use `tls` variants - * @param {buffer} [options.sslKey=undefined] SSL Key file binary buffer *deprecated* use `tls` variants - * @param {string} [options.sslPass=undefined] SSL Certificate pass phrase *deprecated* use `tls` variants - * @param {buffer} [options.sslCRL=undefined] SSL Certificate revocation list binary buffer *deprecated* use `tls` variants - * @param {boolean|function} [options.checkServerIdentity=true] Ensure we check server identify during SSL, set to false to disable checking. Only works for Node 0.12.x or higher. You can pass in a boolean or your own checkServerIdentity override function. *deprecated* use `tls` variants - * @param {boolean} [options.tls=false] Enable TLS connections - * @param {boolean} [options.tlsInsecure=false] Relax TLS constraints, disabling validation - * @param {string} [options.tlsCAFile] A path to file with either a single or bundle of certificate authorities to be considered trusted when making a TLS connection - * @param {string} [options.tlsCertificateKeyFile] A path to the client certificate file or the client private key file; in the case that they both are needed, the files should be concatenated - * @param {string} [options.tlsCertificateKeyFilePassword] The password to decrypt the client private key to be used for TLS connections - * @param {boolean} [options.tlsAllowInvalidCertificates] Specifies whether or not the driver should error when the server’s TLS certificate is invalid - * @param {boolean} [options.tlsAllowInvalidHostnames] Specifies whether or not the driver should error when there is a mismatch between the server’s hostname and the hostname specified by the TLS certificate - * @param {boolean} [options.autoReconnect=true] Enable autoReconnect for single server instances - * @param {boolean} [options.noDelay=true] TCP Connection no delay - * @param {boolean} [options.keepAlive=true] TCP Connection keep alive enabled - * @param {number} [options.keepAliveInitialDelay=120000] The number of milliseconds to wait before initiating keepAlive on the TCP socket - * @param {number} [options.connectTimeoutMS=10000] How long to wait for a connection to be established before timing out - * @param {number} [options.socketTimeoutMS=0] How long a send or receive on a socket can take before timing out - * @param {number} [options.family] Version of IP stack. Can be 4, 6 or null (default). - * If null, will attempt to connect with IPv6, and will fall back to IPv4 on failure - * @param {number} [options.reconnectTries=30] Server attempt to reconnect #times - * @param {number} [options.reconnectInterval=1000] Server will wait # milliseconds between retries - * @param {boolean} [options.ha=true] Control if high availability monitoring runs for Replicaset or Mongos proxies - * @param {number} [options.haInterval=10000] The High availability period for replicaset inquiry - * @param {string} [options.replicaSet=undefined] The Replicaset set name - * @param {number} [options.secondaryAcceptableLatencyMS=15] Cutoff latency point in MS for Replicaset member selection - * @param {number} [options.acceptableLatencyMS=15] Cutoff latency point in MS for Mongos proxies selection - * @param {boolean} [options.connectWithNoPrimary=false] Sets if the driver should connect even if no primary is available - * @param {string} [options.authSource=undefined] Define the database to authenticate against - * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead. - * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead. - * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead. - * @param {boolean} [options.fsync=false] **Deprecated** Specify a file sync write concern. Use writeConcern instead. - * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings. - * @param {boolean} [options.forceServerObjectId=false] Force server to assign _id values instead of driver - * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object - * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields - * @param {boolean} [options.raw=false] Return document results as raw BSON buffers - * @param {number} [options.bufferMaxEntries=-1] Sets a cap on how many operations the driver will buffer up before giving up on getting a working connection, default is -1 which is unlimited - * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST) - * @param {object} [options.pkFactory] A primary key factory object for generation of custom _id keys - * @param {object} [options.promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible - * @param {object} [options.readConcern] Specify a read concern for the collection (only MongoDB 3.2 or higher supported) - * @param {ReadConcernLevel} [options.readConcern.level='local'] Specify a read concern level for the collection operations (only MongoDB 3.2 or higher supported) - * @param {number} [options.maxStalenessSeconds=undefined] The max staleness to secondary reads (values under 10 seconds cannot be guaranteed) - * @param {string} [options.loggerLevel=undefined] The logging level (error/warn/info/debug) - * @param {object} [options.logger=undefined] Custom logger object - * @param {boolean} [options.promoteValues=true] Promotes BSON values to native types where possible, set to false to only receive wrapper types - * @param {boolean} [options.promoteBuffers=false] Promotes Binary BSON values to native Node Buffers - * @param {boolean} [options.promoteLongs=true] Promotes long values to number if they fit inside the 53 bits resolution - * @param {boolean} [options.domainsEnabled=false] Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit - * @param {object} [options.validateOptions=false] Validate MongoClient passed in options for correctness - * @param {string} [options.appname=undefined] The name of the application that created this MongoClient instance. MongoDB 3.4 and newer will print this value in the server log upon establishing each connection. It is also recorded in the slow query log and profile collections - * @param {string} [options.auth.user=undefined] The username for auth - * @param {string} [options.auth.password=undefined] The password for auth - * @param {string} [options.authMechanism] An authentication mechanism to use for connection authentication, see the {@link https://docs.mongodb.com/manual/reference/connection-string/#urioption.authMechanism|authMechanism} reference for supported options. - * @param {object} [options.compression] Type of compression to use: snappy or zlib - * @param {array} [options.readPreferenceTags] Read preference tags - * @param {number} [options.numberOfRetries=5] The number of retries for a tailable cursor - * @param {boolean} [options.auto_reconnect=true] Enable auto reconnecting for single server instances - * @param {boolean} [options.monitorCommands=false] Enable command monitoring for this client - * @param {number} [options.minSize] If present, the connection pool will be initialized with minSize connections, and will never dip below minSize connections - * @param {boolean} [options.directConnection=false] Enable directConnection - * @param {boolean} [options.useNewUrlParser=true] Determines whether or not to use the new url parser. Enables the new, spec-compliant, url parser shipped in the core driver. This url parser fixes a number of problems with the original parser, and aims to outright replace that parser in the near future. Defaults to true, and must be explicitly set to false to use the legacy url parser. - * @param {boolean} [options.useUnifiedTopology] Enables the new unified topology layer - * @param {Number} [options.localThresholdMS=15] **Only applies to the unified topology** The size of the latency window for selecting among multiple suitable servers - * @param {Number} [options.serverSelectionTimeoutMS=30000] **Only applies to the unified topology** How long to block for server selection before throwing an error - * @param {Number} [options.heartbeatFrequencyMS=10000] **Only applies to the unified topology** The frequency with which topology updates are scheduled - * @param {number} [options.maxPoolSize=10] **Only applies to the unified topology** The maximum number of connections that may be associated with a pool at a given time. This includes in use and available connections. - * @param {number} [options.minPoolSize=0] **Only applies to the unified topology** The minimum number of connections that MUST exist at any moment in a single connection pool. - * @param {number} [options.maxIdleTimeMS] **Only applies to the unified topology** The maximum amount of time a connection should remain idle in the connection pool before being marked idle. The default is infinity. - * @param {number} [options.waitQueueTimeoutMS=0] **Only applies to the unified topology** The maximum amount of time operation execution should wait for a connection to become available. The default is 0 which means there is no limit. - * @param {AutoEncrypter~AutoEncryptionOptions} [options.autoEncryption] Optionally enable client side auto encryption - * @param {DriverInfoOptions} [options.driverInfo] Allows a wrapping driver to amend the client metadata generated by the driver to include information about the wrapping driver - * @param {MongoClient~connectCallback} [callback] The command result callback + * @param {MongoClientOptions} [options] Optional settings * @return {Promise} returns Promise if no callback passed */ MongoClient.connect = function(url, options, callback) { diff --git a/lib/operations/bulk_write.js b/lib/operations/bulk_write.js index 8f14f0217c..752b3e7b7f 100644 --- a/lib/operations/bulk_write.js +++ b/lib/operations/bulk_write.js @@ -70,14 +70,6 @@ class BulkWriteOperation extends OperationBase { return callback(err, null); } - r.insertedCount = r.nInserted; - r.matchedCount = r.nMatched; - r.modifiedCount = r.nModified || 0; - r.deletedCount = r.nRemoved; - r.upsertedCount = r.getUpsertedIds().length; - r.upsertedIds = {}; - r.insertedIds = {}; - // Update the n r.n = r.insertedCount; diff --git a/package-lock.json b/package-lock.json index 3039d96ddd..98c5b6a866 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,16 +13,203 @@ "@babel/highlight": "^7.10.4" } }, + "@babel/compat-data": { + "version": "7.13.15", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.13.15.tgz", + "integrity": "sha512-ltnibHKR1VnrU4ymHyQ/CXtNXI6yZC0oJThyW78Hft8XndANwi+9H+UIklBDraIjFEJzw8wmcM427oDd9KS5wA==", + "dev": true + }, + "@babel/core": { + "version": "7.13.15", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.13.15.tgz", + "integrity": "sha512-6GXmNYeNjS2Uz+uls5jalOemgIhnTMeaXo+yBUA72kC2uX/8VW6XyhVIo2L8/q0goKQA3EVKx0KOQpVKSeWadQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.13.9", + "@babel/helper-compilation-targets": "^7.13.13", + "@babel/helper-module-transforms": "^7.13.14", + "@babel/helpers": "^7.13.10", + "@babel/parser": "^7.13.15", + "@babel/template": "^7.12.13", + "@babel/traverse": "^7.13.15", + "@babel/types": "^7.13.14", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.1.2", + "semver": "^6.3.0", + "source-map": "^0.5.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.12.13" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "@babel/generator": { + "version": "7.13.9", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.13.9.tgz", + "integrity": "sha512-mHOOmY0Axl/JCTkxTU6Lf5sWOg/v8nUa+Xkt4zMTftX0wqmb6Sh7J8gvcehBw7q0AhrhAR+FDacKjCZ2X8K+Sw==", + "dev": true, + "requires": { + "@babel/types": "^7.13.0", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "@babel/helper-compilation-targets": { + "version": "7.13.13", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.13.13.tgz", + "integrity": "sha512-q1kcdHNZehBwD9jYPh3WyXcsFERi39X4I59I3NadciWtNDyZ6x+GboOxncFK0kXlKIv6BJm5acncehXWUjWQMQ==", + "dev": true, + "requires": { + "@babel/compat-data": "^7.13.12", + "@babel/helper-validator-option": "^7.12.17", + "browserslist": "^4.14.5", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "@babel/helper-function-name": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz", + "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.12.13", + "@babel/template": "^7.12.13", + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz", + "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz", + "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==", + "dev": true, + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-module-imports": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz", + "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==", + "dev": true, + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-module-transforms": { + "version": "7.13.14", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.13.14.tgz", + "integrity": "sha512-QuU/OJ0iAOSIatyVZmfqB0lbkVP0kDRiKj34xy+QNsnVZi/PA6BoSoreeqnxxa9EHFAIL0R9XOaAR/G9WlIy5g==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.13.12", + "@babel/helper-replace-supers": "^7.13.12", + "@babel/helper-simple-access": "^7.13.12", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/helper-validator-identifier": "^7.12.11", + "@babel/template": "^7.12.13", + "@babel/traverse": "^7.13.13", + "@babel/types": "^7.13.14" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz", + "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, + "@babel/helper-replace-supers": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz", + "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.13.12", + "@babel/helper-optimise-call-expression": "^7.12.13", + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-simple-access": { + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz", + "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==", + "dev": true, + "requires": { + "@babel/types": "^7.13.12" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz", + "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==", + "dev": true, + "requires": { + "@babel/types": "^7.12.13" + } + }, "@babel/helper-validator-identifier": { "version": "7.12.11", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", "dev": true }, + "@babel/helper-validator-option": { + "version": "7.12.17", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz", + "integrity": "sha512-TopkMDmLzq8ngChwRlyjR6raKD6gMSae4JdYDB8bByKreQgG0RBTuKe9LRxW3wFtUnjxOPRKBDwEH6Mg5KeDfw==", + "dev": true + }, + "@babel/helpers": { + "version": "7.13.10", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.13.10.tgz", + "integrity": "sha512-4VO883+MWPDUVRF3PhiLBUFHoX/bsLTGFpFK/HqvvfBZz2D57u9XzPVNFVBTc0PW/CWR9BXTOKt8NF4DInUHcQ==", + "dev": true, + "requires": { + "@babel/template": "^7.12.13", + "@babel/traverse": "^7.13.0", + "@babel/types": "^7.13.0" + } + }, "@babel/highlight": { - "version": "7.13.8", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.13.8.tgz", - "integrity": "sha512-4vrIhfJyfNf+lCtXC2ck1rKSzDwciqF7IWFhXXrSOUC2O5DrVp+w4c6ed4AllTxhTkUP5x2tYj41VaxdVMMRDw==", + "version": "7.13.10", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.13.10.tgz", + "integrity": "sha512-5aPpe5XQPzflQrFwL1/QoeHkP2MsA4JCntcXHRhEsdsfPVkvPi2w7Qix4iV7t5S/oC9OodGrggd8aco1g3SZFg==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.12.11", @@ -30,6 +217,78 @@ "js-tokens": "^4.0.0" } }, + "@babel/parser": { + "version": "7.13.15", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.15.tgz", + "integrity": "sha512-b9COtcAlVEQljy/9fbcMHpG+UIW9ReF+gpaxDHTlZd0c6/UU9ng8zdySAW9sRTzpvcdCHn6bUcbuYUgGzLAWVQ==", + "dev": true + }, + "@babel/template": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz", + "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/parser": "^7.12.13", + "@babel/types": "^7.12.13" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.12.13" + } + } + } + }, + "@babel/traverse": { + "version": "7.13.15", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.13.15.tgz", + "integrity": "sha512-/mpZMNvj6bce59Qzl09fHEs8Bt8NnpEDQYleHUPZQ3wXUMvXi+HJPLars68oAbmp839fGoOkv2pSL2z9ajCIaQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.12.13", + "@babel/generator": "^7.13.9", + "@babel/helper-function-name": "^7.12.13", + "@babel/helper-split-export-declaration": "^7.12.13", + "@babel/parser": "^7.13.15", + "@babel/types": "^7.13.14", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", + "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.12.13" + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.13.14", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.13.14.tgz", + "integrity": "sha512-A2aa3QTkWoyqsZZFl56MLUsfmh7O0gN41IPvXAE/++8ojpbz12SszD7JEGYVdn4f9Kt4amIei07swF1h4AqmmQ==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.12.11", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + } + }, "@eslint/eslintrc": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.0.tgz", @@ -47,28 +306,48 @@ "strip-json-comments": "^3.1.1" }, "dependencies": { - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", "dev": true, "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "type-fest": "^0.8.1" } } } }, + "@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } + } + }, + "@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true + }, "@sinonjs/commons": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.2.tgz", - "integrity": "sha512-sruwd86RJHdsVf/AtBoijDmUqJp3B6hF/DGC23C+JaegnDHaZyewCjoVGTdg3J0uz3Zs7NnIT05OBOmML72lQw==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", + "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", "dev": true, "requires": { "type-detect": "4.0.8" @@ -100,12 +379,30 @@ "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", "dev": true }, + "@types/chai": { + "version": "4.2.16", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.16.tgz", + "integrity": "sha512-vI5iOAsez9+roLS3M3+Xx7w+WRuDtSmF8bQkrbcIJ2sC1PcDgVoA0WGpa+bIrJ+y8zqY2oi//fUctkxtIcXJCw==", + "dev": true + }, "@types/minimist": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.1.tgz", "integrity": "sha512-fZQQafSREFyuZcdWFAExYjBiCL7AUCdgsk80iO0q4yihYYdcIiH28CcuPTGFgLOCC8RlW49GSQxdHwZP+I7CNg==", "dev": true }, + "@types/mocha": { + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.2.2.tgz", + "integrity": "sha512-Lwh0lzzqT5Pqh6z61P3c3P5nm6fzQK/MMHl9UKeneAeInVflBSz1O2EkX6gM6xfJd7FBXBY5purtLx7fUiZ7Hw==", + "dev": true + }, + "@types/node": { + "version": "14.14.37", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.37.tgz", + "integrity": "sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==", + "dev": true + }, "@types/normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", @@ -122,12 +419,6 @@ "through": ">=2.2.7 <3" } }, - "abbrev": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", - "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", - "dev": true - }, "acorn": { "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", @@ -146,6 +437,16 @@ "integrity": "sha1-anmQQ3ynNtXhKI25K9MmbV9csqo=", "dev": true }, + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, "ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -158,13 +459,6 @@ "uri-js": "^4.2.2" } }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", - "dev": true, - "optional": true - }, "ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", @@ -172,9 +466,9 @@ "dev": true }, "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", "dev": true }, "ansi-styles": { @@ -186,12 +480,27 @@ "color-convert": "^1.9.0" } }, + "append-transform": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", + "dev": true, + "requires": { + "default-require-extensions": "^3.0.0" + } + }, "aproba": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true + }, "are-we-there-yet": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", @@ -229,25 +538,23 @@ "integrity": "sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=", "dev": true }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "array-includes": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.3.tgz", + "integrity": "sha512-gcem1KlBU7c9rB+Rq8/3PPKsK2kjqeEBa3bD5kkQo4nYlOHQCJqIJFqBXDEfwaRuYTT4E+FxA9xez7Gf/e3Q7A==", "dev": true, "requires": { - "safer-buffer": "~2.1.0" + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.2", + "get-intrinsic": "^1.1.1", + "is-string": "^1.0.5" } }, - "assert-plus": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", - "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", "dev": true }, "assertion-error": { @@ -262,50 +569,11 @@ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true }, - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true - }, - "aws-sign2": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", - "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", - "dev": true - }, - "aws4": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", - "dev": true - }, - "babylon": { - "version": "7.0.0-beta.19", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.19.tgz", - "integrity": "sha512-Vg0C9s/REX6/WIXN37UKpv5ZhRi6A4pjHlpkE34+8/a6c2W1Q692n3hmc+SZG5lKRnaExLUbxtJ1SVT+KaCQ/A==", - "dev": true - }, "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true - }, - "bcrypt-pbkdf": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, - "requires": { - "tweetnacl": "^0.14.3" - } + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true }, "bindings": { "version": "1.5.0", @@ -326,20 +594,11 @@ } }, "bluebird": { - "version": "3.5.5", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", - "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==", + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", "dev": true }, - "boom": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", - "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", - "dev": true, - "requires": { - "hoek": "2.x.x" - } - }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -356,10 +615,23 @@ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, + "browserslist": { + "version": "4.16.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.4.tgz", + "integrity": "sha512-d7rCxYV8I9kj41RH8UKYnvDYCRENUlHRgyXy/Rhr/1BaeLGfiCptEdFE8MIrvGfWbBFNjVYx76SQWvNX1j+/cQ==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001208", + "colorette": "^1.2.2", + "electron-to-chromium": "^1.3.712", + "escalade": "^3.1.1", + "node-releases": "^1.1.71" + } + }, "bson": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.5.tgz", - "integrity": "sha512-kDuEzldR21lHciPQAIulLs1LZlCXdLziXI6Mb/TDkwXhb//UORJNPXgcRs2CuO4H0DcMkpfT3/ySsP3unoZjBg==" + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.6.tgz", + "integrity": "sha512-EvVNVeGo4tHxwi8L6bPj3y3itEvStdwvvlojVxxbyYfoaxJ6keLgrTuKdyfEAszFK+H3olzBuafE0yoh0D1gdg==" }, "buffer-alloc": { "version": "1.2.0", @@ -389,6 +661,18 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, + "caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "dev": true, + "requires": { + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" + } + }, "call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -422,10 +706,10 @@ "quick-lru": "^4.0.1" } }, - "caseless": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", - "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=", + "caniuse-lite": { + "version": "1.0.30001208", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001208.tgz", + "integrity": "sha512-OE5UE4+nBOro8Dyvv0lfx+SRtfVIOM9uhKqFmJeUbGriqhhStgp1A0OyBpgy3OUF8AhYCT+PVwPC1gMl2ZcQMA==", "dev": true }, "catharsis": { @@ -438,9 +722,9 @@ } }, "chai": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.1.tgz", - "integrity": "sha512-JClPZFGRcSl7X8dYzlCJY7v+X1fBA+9Y339Y8EqhBVfp0QC1hTnaf7nMfR+XZ74clkBC64b0iEw2cWKHt3EVqA==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz", + "integrity": "sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==", "dev": true, "requires": { "assertion-error": "^1.1.0", @@ -480,6 +764,12 @@ "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", "dev": true }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, "cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -489,23 +779,6 @@ "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^6.2.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - } } }, "co": { @@ -535,19 +808,22 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } + "colorette": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", + "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", + "dev": true }, "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, "compare-func": { @@ -598,21 +874,21 @@ "dev": true }, "conventional-changelog": { - "version": "3.1.21", - "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-3.1.21.tgz", - "integrity": "sha512-ZGecVZPEo3aC75VVE4nu85589dDhpMyqfqgUM5Myq6wfKWiNqhDJLSDMsc8qKXshZoY7dqs1hR0H/15kI/G2jQ==", - "dev": true, - "requires": { - "conventional-changelog-angular": "^5.0.10", - "conventional-changelog-atom": "^2.0.7", - "conventional-changelog-codemirror": "^2.0.7", - "conventional-changelog-conventionalcommits": "^4.3.0", - "conventional-changelog-core": "^4.1.7", - "conventional-changelog-ember": "^2.0.8", - "conventional-changelog-eslint": "^3.0.8", - "conventional-changelog-express": "^2.0.5", - "conventional-changelog-jquery": "^3.0.10", - "conventional-changelog-jshint": "^2.0.7", + "version": "3.1.24", + "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-3.1.24.tgz", + "integrity": "sha512-ed6k8PO00UVvhExYohroVPXcOJ/K1N0/drJHx/faTH37OIZthlecuLIRX/T6uOp682CAoVoFpu+sSEaeuH6Asg==", + "dev": true, + "requires": { + "conventional-changelog-angular": "^5.0.12", + "conventional-changelog-atom": "^2.0.8", + "conventional-changelog-codemirror": "^2.0.8", + "conventional-changelog-conventionalcommits": "^4.5.0", + "conventional-changelog-core": "^4.2.1", + "conventional-changelog-ember": "^2.0.9", + "conventional-changelog-eslint": "^3.0.9", + "conventional-changelog-express": "^2.0.6", + "conventional-changelog-jquery": "^3.0.11", + "conventional-changelog-jshint": "^2.0.9", "conventional-changelog-preset-loader": "^2.3.4" } }, @@ -651,41 +927,14 @@ "dev": true }, "conventional-changelog-conventionalcommits": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.3.0.tgz", - "integrity": "sha512-oYHydvZKU+bS8LnGqTMlNrrd7769EsuEHKy4fh1oMdvvDi7fem8U+nvfresJ1IDB8K00Mn4LpiA/lR+7Gs6rgg==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.5.0.tgz", + "integrity": "sha512-buge9xDvjjOxJlyxUnar/+6i/aVEVGA7EEh4OafBCXPlLUQPGbRUBhBUveWRxzvR8TEjhKEP4BdepnpG2FSZXw==", "dev": true, "requires": { - "compare-func": "^1.3.1", + "compare-func": "^2.0.0", "lodash": "^4.17.15", "q": "^1.5.1" - }, - "dependencies": { - "compare-func": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-1.3.4.tgz", - "integrity": "sha512-sq2sWtrqKPkEXAC8tEJA1+BqAH9GbFkGBtUOqrUX57VSfwp8xyktctk+uLoRy5eccTdxzDcVIztlYDpKs3Jv1Q==", - "dev": true, - "requires": { - "array-ify": "^1.0.0", - "dot-prop": "^3.0.0" - } - }, - "dot-prop": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-3.0.0.tgz", - "integrity": "sha1-G3CK8JSknJoOfbyteQq6U52sEXc=", - "dev": true, - "requires": { - "is-obj": "^1.0.0" - } - }, - "is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", - "dev": true - } } }, "conventional-changelog-core": { @@ -813,332 +1062,37 @@ "through2": "^4.0.0", "trim-off-newlines": "^1.0.0" } - }, - "conventional-recommended-bump": { - "version": "6.0.9", - "resolved": "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-6.0.9.tgz", - "integrity": "sha512-DpRmW1k8CpRrcsXHOPGgHgOd4BMGiq2gtXAveGM8B9pSd9b4r4WKnqp1Fd0vkDtk8l973mIk8KKKUYnKRr9SFw==", - "dev": true, - "requires": { - "concat-stream": "^2.0.0", - "conventional-changelog-preset-loader": "^2.3.4", - "conventional-commits-filter": "^2.0.6", - "conventional-commits-parser": "^3.1.0", - "git-raw-commits": "2.0.0", - "git-semver-tags": "^4.0.0", - "meow": "^7.0.0", - "q": "^1.5.1" - }, - "dependencies": { - "camelcase": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true - }, - "camelcase-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", - "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", - "dev": true, - "requires": { - "camelcase": "^4.1.0", - "map-obj": "^2.0.0", - "quick-lru": "^1.0.0" - } - }, - "dargs": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/dargs/-/dargs-4.1.0.tgz", - "integrity": "sha1-A6nbtLXC8Tm/FK5T8LiipqhvThc=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "git-raw-commits": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.0.tgz", - "integrity": "sha512-w4jFEJFgKXMQJ0H0ikBk2S+4KP2VEjhCvLCNqbNRQC8BgGWgLKNCO7a9K9LI+TVT7Gfoloje502sEnctibffgg==", - "dev": true, - "requires": { - "dargs": "^4.0.1", - "lodash.template": "^4.0.2", - "meow": "^4.0.0", - "split2": "^2.0.0", - "through2": "^2.0.0" - }, - "dependencies": { - "meow": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", - "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", - "dev": true, - "requires": { - "camelcase-keys": "^4.0.0", - "decamelize-keys": "^1.0.0", - "loud-rejection": "^1.0.0", - "minimist": "^1.1.3", - "minimist-options": "^3.0.1", - "normalize-package-data": "^2.3.4", - "read-pkg-up": "^3.0.0", - "redent": "^2.0.0", - "trim-newlines": "^2.0.0" - } - } - } - }, - "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", - "dev": true - }, - "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", - "dev": true - }, - "map-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", - "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", - "dev": true - }, - "meow": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/meow/-/meow-7.1.1.tgz", - "integrity": "sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA==", - "dev": true, - "requires": { - "@types/minimist": "^1.2.0", - "camelcase-keys": "^6.2.2", - "decamelize-keys": "^1.1.0", - "hard-rejection": "^2.1.0", - "minimist-options": "4.1.0", - "normalize-package-data": "^2.5.0", - "read-pkg-up": "^7.0.1", - "redent": "^3.0.0", - "trim-newlines": "^3.0.0", - "type-fest": "^0.13.1", - "yargs-parser": "^18.1.3" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "camelcase-keys": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", - "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", - "dev": true, - "requires": { - "camelcase": "^5.3.1", - "map-obj": "^4.0.0", - "quick-lru": "^4.0.1" - } - }, - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true - }, - "map-obj": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", - "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==", - "dev": true - }, - "minimist-options": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", - "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", - "dev": true, - "requires": { - "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0", - "kind-of": "^6.0.3" - } - }, - "quick-lru": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", - "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", - "dev": true - }, - "read-pkg-up": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", - "dev": true, - "requires": { - "find-up": "^4.1.0", - "read-pkg": "^5.2.0", - "type-fest": "^0.8.1" - }, - "dependencies": { - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true - } - } - }, - "redent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", - "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", - "dev": true, - "requires": { - "indent-string": "^4.0.0", - "strip-indent": "^3.0.0" - } - }, - "strip-indent": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", - "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", - "dev": true, - "requires": { - "min-indent": "^1.0.0" - } - }, - "trim-newlines": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", - "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==", - "dev": true - } - } - }, - "minimist-options": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", - "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", - "dev": true, - "requires": { - "arrify": "^1.0.1", - "is-plain-obj": "^1.1.0" - } - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dev": true, - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "quick-lru": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", - "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", - "dev": true - }, - "read-pkg": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", - "dev": true, - "requires": { - "@types/normalize-package-data": "^2.4.0", - "normalize-package-data": "^2.5.0", - "parse-json": "^5.0.0", - "type-fest": "^0.6.0" - }, - "dependencies": { - "type-fest": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", - "dev": true - } - } - }, - "redent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", - "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", - "dev": true, - "requires": { - "indent-string": "^3.0.0", - "strip-indent": "^2.0.0" - } - }, - "resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", - "dev": true, - "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" - } - }, - "split2": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", - "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", - "dev": true, - "requires": { - "through2": "^2.0.2" - } - }, - "strip-indent": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", - "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", - "dev": true - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" - } - }, - "trim-newlines": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", - "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", - "dev": true - }, - "type-fest": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", - "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", + }, + "conventional-recommended-bump": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-6.1.0.tgz", + "integrity": "sha512-uiApbSiNGM/kkdL9GTOLAqC4hbptObFo4wW2QRyHsKciGAfQuLU1ShZ1BIVI/+K2BE/W1AWYQMCXAsv4dyKPaw==", + "dev": true, + "requires": { + "concat-stream": "^2.0.0", + "conventional-changelog-preset-loader": "^2.3.4", + "conventional-commits-filter": "^2.0.7", + "conventional-commits-parser": "^3.2.0", + "git-raw-commits": "^2.0.8", + "git-semver-tags": "^4.1.1", + "meow": "^8.0.0", + "q": "^1.5.1" + } + }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true - }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "dependencies": { - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - } - } } } }, @@ -1147,19 +1101,6 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, - "coveralls": { - "version": "2.13.3", - "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-2.13.3.tgz", - "integrity": "sha512-iiAmn+l1XqRwNLXhW8Rs5qHZRFMYp9ZIPjEOVRpC/c4so6Y/f4/lFi0FfR5B9cCqgyhkJ5cZmbvcVRfP8MHchw==", - "dev": true, - "requires": { - "js-yaml": "3.6.1", - "lcov-parse": "0.0.10", - "log-driver": "1.2.5", - "minimist": "1.2.0", - "request": "2.79.0" - } - }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -1171,15 +1112,6 @@ "which": "^2.0.1" } }, - "cryptiles": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", - "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", - "dev": true, - "requires": { - "boom": "2.x.x" - } - }, "currently-unhandled": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", @@ -1195,23 +1127,6 @@ "integrity": "sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==", "dev": true }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } - } - }, "dateformat": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", @@ -1281,6 +1196,15 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, + "default-require-extensions": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", + "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", + "dev": true, + "requires": { + "strip-bom": "^4.0.0" + } + }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -1290,12 +1214,6 @@ "object-keys": "^1.0.12" } }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true - }, "delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", @@ -1395,15 +1313,11 @@ } } }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } + "electron-to-chromium": { + "version": "1.3.717", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.717.tgz", + "integrity": "sha512-OfzVPIqD1MkJ7fX+yTl2nKyOE4FReeVfMCzzxQS+Kp43hZYwHwThlGP+EGIZRXJsxCM7dqo8Y65NOX/HP12iXQ==", + "dev": true }, "emoji-regex": { "version": "8.0.0", @@ -1429,6 +1343,12 @@ "ansi-colors": "^4.1.1" } }, + "entities": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.0.3.tgz", + "integrity": "sha512-MyoZ0jgnLvB2X3Lg5HqpFmn1kybDiIfEQmKzTb5apr51Rb+T3KdmMiqa70T+bhGnyv7bQ6WMj2QMHpGMmlrUYQ==", + "dev": true + }, "errno": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", @@ -1448,9 +1368,9 @@ } }, "es-abstract": { - "version": "1.18.0-next.3", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.3.tgz", - "integrity": "sha512-VMzHx/Bczjg59E6jZOQjHeN3DEoptdhejpARgflAViidlqSpjdq9zA6lKwlhRRs/lOw1gHJv2xkkSFRgvEwbQg==", + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0.tgz", + "integrity": "sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw==", "dev": true, "requires": { "call-bind": "^1.0.2", @@ -1482,76 +1402,28 @@ "is-symbol": "^1.0.2" } }, + "es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true + }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, - "escodegen": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", - "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", - "dev": true, - "requires": { - "esprima": "^2.7.1", - "estraverse": "^1.9.1", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.2.0" - }, - "dependencies": { - "estraverse": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", - "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", - "dev": true - }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - } - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", - "dev": true - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2" - } - } - } - }, "eslint": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.21.0.tgz", - "integrity": "sha512-W2aJbXpMNofUp0ztQaF40fveSsJBjlSCSWpy//gzfTvwC+USs/nceBrKmlJOiM8r1bLwP2EuYkCqArn/6QTIgg==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.24.0.tgz", + "integrity": "sha512-k9gaHeHiFmGCDQ2rEfvULlSLruz6tgfA8DEn+rY9/oYPFFTlz55mM/Q/Rij1b2Y42jwZiK3lXvNTw6w6TXzcKQ==", "dev": true, "requires": { "@babel/code-frame": "7.12.11", @@ -1571,7 +1443,7 @@ "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", "glob-parent": "^5.0.0", - "globals": "^12.1.0", + "globals": "^13.6.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", @@ -1579,7 +1451,7 @@ "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", - "lodash": "^4.17.20", + "lodash": "^4.17.21", "minimatch": "^3.0.4", "natural-compare": "^1.4.0", "optionator": "^0.9.1", @@ -1593,12 +1465,6 @@ "v8-compile-cache": "^2.0.3" }, "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -1633,46 +1499,21 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, - "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dev": true, - "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - } - }, "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "dev": true, "requires": { "lru-cache": "^6.0.0" } }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -1765,9 +1606,9 @@ } }, "esprima": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, "esquery": { @@ -1822,18 +1663,6 @@ "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", "dev": true }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true - }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -1882,6 +1711,17 @@ "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", "dev": true }, + "find-cache-dir": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", + "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -1917,23 +1757,22 @@ "is-callable": "^1.1.3" } }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true - }, - "form-data": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", - "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", + "foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", "dev": true, "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.5", - "mime-types": "^2.1.12" + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" } }, + "fromentries": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", + "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", + "dev": true + }, "fs-access": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", @@ -1983,6 +1822,12 @@ "wide-align": "^1.1.0" }, "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, "is-fullwidth-code-point": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", @@ -2002,26 +1847,23 @@ "is-fullwidth-code-point": "^1.0.0", "strip-ansi": "^3.0.0" } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } } } }, - "generate-function": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", - "integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", - "dev": true, - "requires": { - "is-property": "^1.0.2" - } - }, - "generate-object-property": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", - "dev": true, - "requires": { - "is-property": "^1.0.0" - } + "gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true }, "get-caller-file": { "version": "2.0.5", @@ -2046,6 +1888,12 @@ "has-symbols": "^1.0.1" } }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, "get-pkg-repo": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/get-pkg-repo/-/get-pkg-repo-1.4.0.tgz", @@ -2092,9 +1940,9 @@ "dev": true }, "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, "indent-string": { @@ -2130,6 +1978,12 @@ "trim-newlines": "^1.0.0" } }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -2182,16 +2036,6 @@ "strip-indent": "^1.0.1" } }, - "resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", - "dev": true, - "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" - } - }, "strip-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", @@ -2225,23 +2069,6 @@ "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", "dev": true }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } - } - }, "git-raw-commits": { "version": "2.0.10", "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.10.tgz", @@ -2313,21 +2140,29 @@ } }, "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "requires": { "is-glob": "^4.0.1" } }, "globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "version": "13.8.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.8.0.tgz", + "integrity": "sha512-rHtdA6+PDBIjeEvA91rpqzEvk/k3/i7EeNQiryiWuJH0Hw9cpyJMAt2jtbAwUaRdhD+573X4vWw6IcjKPasi9Q==", "dev": true, "requires": { - "type-fest": "^0.8.1" + "type-fest": "^0.20.2" + }, + "dependencies": { + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + } } }, "graceful-fs": { @@ -2369,45 +2204,6 @@ } } }, - "har-validator": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", - "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", - "dev": true, - "requires": { - "chalk": "^1.1.1", - "commander": "^2.9.0", - "is-my-json-valid": "^2.12.4", - "pinkie-promise": "^2.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", - "dev": true - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "dev": true, - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", - "dev": true - } - } - }, "hard-rejection": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", @@ -2423,15 +2219,6 @@ "function-bind": "^1.1.1" } }, - "has-ansi": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, "has-bigints": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz", @@ -2456,16 +2243,14 @@ "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true }, - "hawk": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", - "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "hasha": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", + "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", "dev": true, "requires": { - "boom": "2.x.x", - "cryptiles": "2.x.x", - "hoek": "2.x.x", - "sntp": "1.x.x" + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" } }, "he": { @@ -2474,31 +2259,20 @@ "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", "dev": true }, - "hoek": { - "version": "2.16.3", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", - "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", - "dev": true - }, "hosted-git-info": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.8.tgz", - "integrity": "sha512-aXpmwoOhRBrw6X3j0h5RloK4x1OzsxMPyxqIHyNfSe2pypkVTZFpEiRoSipPEPlMrh0HW/XsjkJ5WgnCirpNUw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.0.2.tgz", + "integrity": "sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg==", "dev": true, "requires": { "lru-cache": "^6.0.0" } }, - "http-signature": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", - "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", - "dev": true, - "requires": { - "assert-plus": "^0.2.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true }, "ignore": { "version": "4.0.6", @@ -2514,14 +2288,6 @@ "requires": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - } } }, "imurmurhash": { @@ -2632,25 +2398,6 @@ "is-extglob": "^2.1.1" } }, - "is-my-ip-valid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", - "integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==", - "dev": true - }, - "is-my-json-valid": { - "version": "2.20.5", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.20.5.tgz", - "integrity": "sha512-VTPuvvGQtxvCeghwspQu1rBgjYUT6FGxPlvFKbYuFtgc4ADsX3U5ihZOYN0qyU6u+d4X9xXb0IT5O6QpXKt87A==", - "dev": true, - "requires": { - "generate-function": "^2.0.0", - "generate-object-property": "^1.1.0", - "is-my-ip-valid": "^1.0.0", - "jsonpointer": "^4.0.0", - "xtend": "^4.0.0" - } - }, "is-negative-zero": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", @@ -2675,12 +2422,6 @@ "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", "dev": true }, - "is-property": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", - "dev": true - }, "is-regex": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz", @@ -2691,6 +2432,12 @@ "has-symbols": "^1.0.1" } }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, "is-string": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", @@ -2727,6 +2474,12 @@ "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", "dev": true }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -2738,73 +2491,113 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "istanbul-lib-coverage": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", + "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", "dev": true }, - "istanbul": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", - "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", + "istanbul-lib-hook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", + "dev": true, + "requires": { + "append-transform": "^2.0.0" + } + }, + "istanbul-lib-instrument": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "dev": true, + "requires": { + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "istanbul-lib-processinfo": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", + "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", + "dev": true, + "requires": { + "archy": "^1.0.0", + "cross-spawn": "^7.0.0", + "istanbul-lib-coverage": "^3.0.0-alpha.1", + "make-dir": "^3.0.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^3.3.3" + } + }, + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", "dev": true, "requires": { - "abbrev": "1.0.x", - "async": "1.x", - "escodegen": "1.8.x", - "esprima": "2.7.x", - "glob": "^5.0.15", - "handlebars": "^4.0.1", - "js-yaml": "3.x", - "mkdirp": "0.5.x", - "nopt": "3.x", - "once": "1.x", - "resolve": "1.1.x", - "supports-color": "^3.1.0", - "which": "^1.1.1", - "wordwrap": "^1.0.0" + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" }, "dependencies": { - "glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", - "dev": true, - "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, "has-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, "supports-color": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { - "isexe": "^2.0.0" + "has-flag": "^4.0.0" } } } }, + "istanbul-lib-source-maps": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", + "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "istanbul-reports": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", + "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -2812,58 +2605,60 @@ "dev": true }, "js-yaml": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.6.1.tgz", - "integrity": "sha1-bl/mfYsgXOTSL60Ft3geja3MSzA=", + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "requires": { "argparse": "^1.0.7", - "esprima": "^2.6.0" + "esprima": "^4.0.0" } }, "js2xmlparser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-3.0.0.tgz", - "integrity": "sha1-P7YOqgicVED5MZ9RdgzNB+JJlzM=", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.1.tgz", + "integrity": "sha512-KrPTolcw6RocpYjdC7pL7v62e55q7qOMHvLX1UCLc5AAS8qeJ6nukarEJAF2KL2PZxlbGueEbINqZR2bDe/gUw==", "dev": true, "requires": { - "xmlcreate": "^1.0.1" + "xmlcreate": "^2.0.3" } }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true - }, "jsdoc": { - "version": "3.5.5", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.5.5.tgz", - "integrity": "sha512-6PxB65TAU4WO0Wzyr/4/YhlGovXl0EVYfpKbpSroSj0qBxT4/xod/l40Opkm38dRHRdQgdeY836M0uVnJQG7kg==", - "dev": true, - "requires": { - "babylon": "7.0.0-beta.19", - "bluebird": "~3.5.0", - "catharsis": "~0.8.9", - "escape-string-regexp": "~1.0.5", - "js2xmlparser": "~3.0.0", - "klaw": "~2.0.0", - "marked": "~0.3.6", - "mkdirp": "~0.5.1", - "requizzle": "~0.2.1", - "strip-json-comments": "~2.0.1", + "version": "3.6.6", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.6.tgz", + "integrity": "sha512-znR99e1BHeyEkSvgDDpX0sTiTu+8aQyDl9DawrkOGZTTW8hv0deIFXx87114zJ7gRaDZKVQD/4tr1ifmJp9xhQ==", + "dev": true, + "requires": { + "@babel/parser": "^7.9.4", + "bluebird": "^3.7.2", + "catharsis": "^0.8.11", + "escape-string-regexp": "^2.0.0", + "js2xmlparser": "^4.0.1", + "klaw": "^3.0.0", + "markdown-it": "^10.0.0", + "markdown-it-anchor": "^5.2.7", + "marked": "^0.8.2", + "mkdirp": "^1.0.4", + "requizzle": "^0.2.3", + "strip-json-comments": "^3.1.0", "taffydb": "2.6.2", - "underscore": "~1.8.3" + "underscore": "~1.10.2" }, "dependencies": { - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", "dev": true } } }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", @@ -2876,12 +2671,6 @@ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, - "json-schema": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", - "dev": true - }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -2900,42 +2689,33 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, - "jsonparse": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", - "dev": true - }, - "jsonpointer": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.1.0.tgz", - "integrity": "sha512-CXcRvMyTlnR53xMcKnuMzfCA5i/nfblTnnr74CZb6C4vG39eu6w51t7nKmU5MfLfbTgGItliNyjO/ciNPDqClg==", - "dev": true - }, - "jsprim": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", - "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", "dev": true, "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.2.3", - "verror": "1.10.0" + "minimist": "^1.2.5" }, "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true } } }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "dev": true + }, "just-extend": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.1.1.tgz", - "integrity": "sha512-aWgeGFW67BP3e5181Ep1Fv2v8z//iBJfrvyTnq8wG86vEESwmonn1zPBJ0VfmT9CJq2FIT0VsETtrNFm2a+SHA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", + "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", "dev": true }, "kind-of": { @@ -2945,20 +2725,14 @@ "dev": true }, "klaw": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-2.0.0.tgz", - "integrity": "sha1-WcEo4Nxc5BAgEVEZTuucv4WGUPY=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", + "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", "dev": true, "requires": { "graceful-fs": "^4.1.9" } }, - "lcov-parse": { - "version": "0.0.10", - "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.10.tgz", - "integrity": "sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM=", - "dev": true - }, "levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", @@ -2975,6 +2749,15 @@ "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", "dev": true }, + "linkify-it": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", + "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", + "dev": true, + "requires": { + "uc.micro": "^1.0.1" + } + }, "load-json-file": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", @@ -2996,6 +2779,15 @@ "requires": { "error-ex": "^1.2.0" } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } } } }, @@ -3014,18 +2806,30 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, - "lodash._reinterpolate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", - "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", - "dev": true - }, "lodash.camelcase": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", "dev": true }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, + "lodash.flatten": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", + "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", + "dev": true + }, + "lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", + "dev": true + }, "lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", @@ -3038,29 +2842,10 @@ "integrity": "sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc=", "dev": true }, - "lodash.template": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", - "integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==", - "dev": true, - "requires": { - "lodash._reinterpolate": "^3.0.0", - "lodash.templatesettings": "^4.0.0" - } - }, - "lodash.templatesettings": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz", - "integrity": "sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==", - "dev": true, - "requires": { - "lodash._reinterpolate": "^3.0.0" - } - }, - "log-driver": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.5.tgz", - "integrity": "sha1-euTsJXMC/XkNVXyxDJcQDYV7AFY=", + "lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", "dev": true }, "lolex": { @@ -3088,16 +2873,58 @@ "yallist": "^4.0.0" } }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, "map-obj": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", - "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.2.1.tgz", + "integrity": "sha512-+WA2/1sPmDj1dlvvJmB5G6JKfY9dpn7EVBUL06+y6PoljPkh+6V1QihwxNkbcGxCRjt2b0F9K0taiCuo7MbdFQ==", + "dev": true + }, + "markdown-it": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-10.0.0.tgz", + "integrity": "sha512-YWOP1j7UbDNz+TumYP1kpwnP0aEa711cJjrAQrzd0UXlbJfc5aAq0F/PZHjiioqDC1NKgvIMX+o+9Bk7yuM2dg==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "entities": "~2.0.0", + "linkify-it": "^2.0.0", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + } + }, + "markdown-it-anchor": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.3.0.tgz", + "integrity": "sha512-/V1MnLL/rgJ3jkMWo84UR+K+jF1cxNG1a+KwqeXqTIJ+jtA8aWSHuigx8lTzauiIjBDbwF3NcWQMotd0Dm39jA==", "dev": true }, "marked": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.19.tgz", - "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==", + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.8.2.tgz", + "integrity": "sha512-EGwzEeCcLniFX51DhTpmTom+dSA/MG/OBUDjnWtHbEnjAH180VzUeAw+oE4+Zv+CoYBWyRlYOTR0N8SO9R1PVw==", + "dev": true + }, + "mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", "dev": true }, "memory-pager": { @@ -3126,9 +2953,9 @@ }, "dependencies": { "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, "read-pkg": { @@ -3182,39 +3009,20 @@ } } }, - "resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", - "dev": true, - "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" - } - }, "type-fest": { "version": "0.18.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.18.1.tgz", "integrity": "sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==", "dev": true + }, + "yargs-parser": { + "version": "20.2.7", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz", + "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==", + "dev": true } } }, - "mime-db": { - "version": "1.46.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.46.0.tgz", - "integrity": "sha512-svXaP8UQRZ5K7or+ZmfNhg2xX3yKDMUzqadsSqi4NCH/KomcH75MAMYAGVlvXn4+b/xOPhS3I2uHKRUzvjY7BQ==", - "dev": true - }, - "mime-types": { - "version": "2.1.29", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.29.tgz", - "integrity": "sha512-Y/jMt/S5sR9OaqteJtslsFZKWOIIqMACsJSiHghlCAyhf7jfVYjKBmLiX8OgpWeW+fjJ2b+Az69aPFPkUOY6xQ==", - "dev": true, - "requires": { - "mime-db": "1.46.0" - } - }, "mimic-response": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", @@ -3237,9 +3045,9 @@ } }, "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, "minimist-options": { @@ -3254,21 +3062,10 @@ } }, "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - }, - "dependencies": { - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true - } - } + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true }, "mocha": { "version": "5.2.0", @@ -3289,12 +3086,6 @@ "supports-color": "5.4.0" }, "dependencies": { - "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", - "dev": true - }, "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", @@ -3318,12 +3109,6 @@ "path-is-absolute": "^1.0.0" } }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", @@ -3453,55 +3238,51 @@ } }, "node-abi": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.20.0.tgz", - "integrity": "sha512-6ldtfVR5l3RS8D0aT+lj/uM2Vv/PGEkeWzt2tl8DFBsGY/IuVnAIHl+dG6C14NlWClVv7Rn2+ZDvox+35Hx2Kg==", + "version": "2.21.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.21.0.tgz", + "integrity": "sha512-smhrivuPqEM3H5LmnY3KU6HfYv0u4QklgAxfFyRNujKUzbUcYZ+Jc2EhukB9SRcD2VpqhxM7n/MIcp1Ua1/JMg==", "dev": true, "requires": { "semver": "^5.4.1" } }, + "node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", + "dev": true, + "requires": { + "process-on-spawn": "^1.0.0" + } + }, + "node-releases": { + "version": "1.1.71", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.71.tgz", + "integrity": "sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg==", + "dev": true + }, "noop-logger": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=", "dev": true }, - "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", - "dev": true, - "requires": { - "abbrev": "1" - } - }, "normalize-package-data": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.0.tgz", - "integrity": "sha512-6lUjEI0d3v6kFrtgA/lOx4zHCWULXsFNIjHolnZCKCTLA6m/G625cdn3O7eNmT0iD3jfo6HZ9cdImGZwf21prw==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.2.tgz", + "integrity": "sha512-6CdZocmfGaKnIHPVFhJJZ3GuR8SsLKvDANFp47Jmy51aKIr8akjAWTSxtpI+MBgBFdSMRyo4hMpDlT6dTffgZg==", "dev": true, "requires": { - "hosted-git-info": "^3.0.6", - "resolve": "^1.17.0", - "semver": "^7.3.2", + "hosted-git-info": "^4.0.1", + "resolve": "^1.20.0", + "semver": "^7.3.4", "validate-npm-package-license": "^3.0.1" }, "dependencies": { - "resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", - "dev": true, - "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" - } - }, "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -3533,11 +3314,67 @@ "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, - "oauth-sign": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", - "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", - "dev": true + "nyc": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", + "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", + "dev": true, + "requires": { + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^2.0.0", + "get-package-type": "^0.1.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" + }, + "dependencies": { + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + } + } }, "object-assign": { "version": "4.1.1", @@ -3569,6 +3406,18 @@ "object-keys": "^1.1.1" } }, + "object.entries": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.3.tgz", + "integrity": "sha512-ym7h7OZebNS96hn5IJeyUmaWhaSM4SVtAPPfNLQEI2MYWCO2egsITb9nab2+i/Pwibx+R0mtn+ltKJXRSeTMGg==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1", + "has": "^1.0.3" + } + }, "object.getownpropertydescriptors": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz", @@ -3632,12 +3481,33 @@ "p-limit": "^2.2.0" } }, + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, + "package-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + } + }, "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -3744,6 +3614,15 @@ "pinkie": "^2.0.0" } }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, "prebuild-install": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.0.tgz", @@ -3768,13 +3647,19 @@ "which-pm-runs": "^1.0.0" }, "dependencies": { - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { - "safe-buffer": "^5.0.1" + "minimist": "^1.2.5" } } } @@ -3805,6 +3690,15 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, + "process-on-spawn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", + "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", + "dev": true, + "requires": { + "fromentries": "^1.2.0" + } + }, "progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -3828,9 +3722,9 @@ } }, "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, "q": { @@ -3839,12 +3733,6 @@ "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", "dev": true }, - "qs": { - "version": "6.3.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", - "integrity": "sha1-51vV9uJoEioqDgvaYwslUMFmUCw=", - "dev": true - }, "quick-lru": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", @@ -3863,6 +3751,12 @@ "strip-json-comments": "~2.0.1" }, "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -3883,9 +3777,9 @@ }, "dependencies": { "hosted-git-info": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==", "dev": true }, "load-json-file": { @@ -3937,16 +3831,6 @@ "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "dev": true }, - "resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", - "dev": true, - "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" - } - }, "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", @@ -4062,6 +3946,15 @@ "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", "dev": true }, + "release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "dev": true, + "requires": { + "es6-error": "^4.0.1" + } + }, "repeating": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", @@ -4071,34 +3964,6 @@ "is-finite": "^1.0.0" } }, - "request": { - "version": "2.79.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", - "integrity": "sha1-Tf5b9r6LjNw3/Pk+BLZVd3InEN4=", - "dev": true, - "requires": { - "aws-sign2": "~0.6.0", - "aws4": "^1.2.1", - "caseless": "~0.11.0", - "combined-stream": "~1.0.5", - "extend": "~3.0.0", - "forever-agent": "~0.6.1", - "form-data": "~2.1.1", - "har-validator": "~2.0.6", - "hawk": "~3.1.3", - "http-signature": "~1.1.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.7", - "oauth-sign": "~0.8.1", - "qs": "~6.3.0", - "stringstream": "~0.0.4", - "tough-cookie": "~2.3.0", - "tunnel-agent": "~0.4.1", - "uuid": "^3.0.0" - } - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -4127,9 +3992,19 @@ } }, "resolve": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", + "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "dev": true, + "requires": { + "is-core-module": "^2.2.0", + "path-parse": "^1.0.6" + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, "rimraf": { @@ -4146,12 +4021,6 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true - }, "samsam": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.3.0.tgz", @@ -4244,9 +4113,9 @@ } }, "sinon-chai": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/sinon-chai/-/sinon-chai-3.5.0.tgz", - "integrity": "sha512-IifbusYiQBpUxxFJkR3wTU68xzBN0+bxCScEaKMjBvAQERg6FnTTc1F17rseLb1tjmkJ23730AXpFI0c47FgAg==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/sinon-chai/-/sinon-chai-3.6.0.tgz", + "integrity": "sha512-bk2h+0xyKnmvazAnc7HE5esttqmCerSMcBtuB2PS2T4tG6x8woXAxZeJaOJWD+8reXHngnXn0RtIbfEW9OTHFg==", "dev": true }, "slice-ansi": { @@ -4297,24 +4166,11 @@ "prebuild-install": "5.3.0" } }, - "sntp": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", - "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", - "dev": true, - "requires": { - "hoek": "2.x.x" - } - }, "source-map": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", - "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", - "dev": true, - "optional": true, - "requires": { - "amdefine": ">=0.0.4" - } + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true }, "sparse-bitfield": { "version": "3.0.3", @@ -4325,6 +4181,20 @@ "memory-pager": "^1.0.2" } }, + "spawn-wrap": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", + "dev": true, + "requires": { + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "which": "^2.0.1" + } + }, "spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", @@ -4400,91 +4270,147 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "dev": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } - } - }, "standard-version": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/standard-version/-/standard-version-8.0.2.tgz", - "integrity": "sha512-L8X9KFq2SmVmaeZgUmWHFJMOsEWpjgFAwqic6yIIoveM1kdw1vH4Io03WWxUDjypjGqGU6qUtcJoR8UvOv5w3g==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/standard-version/-/standard-version-9.2.0.tgz", + "integrity": "sha512-utJcqjk/wR4sePSwDoRcc5CzJ6S+kec5Hd0+1TJI+j1TRYuuptweAnEUdkkjGf2vYoGab2ezefyVtW065HZ1Uw==", "dev": true, "requires": { "chalk": "^2.4.2", - "conventional-changelog": "3.1.21", + "conventional-changelog": "3.1.24", "conventional-changelog-config-spec": "2.1.0", - "conventional-changelog-conventionalcommits": "4.3.0", - "conventional-recommended-bump": "6.0.9", + "conventional-changelog-conventionalcommits": "4.5.0", + "conventional-recommended-bump": "6.1.0", "detect-indent": "^6.0.0", "detect-newline": "^3.1.0", "dotgitignore": "^2.1.0", "figures": "^3.1.0", - "find-up": "^4.1.0", + "find-up": "^5.0.0", "fs-access": "^1.0.1", "git-semver-tags": "^4.0.0", "semver": "^7.1.1", "stringify-package": "^1.0.1", - "yargs": "^15.3.1" + "yargs": "^16.0.0" }, "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "dev": true, "requires": { "lru-cache": "^6.0.0" } }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true + }, "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", "dev": true, "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" } }, "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } + "version": "20.2.7", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.7.tgz", + "integrity": "sha512-FiNkvbeHzB/syOjIUxFDCnhSfzAL8R5vs40MgLFBorXACCOAEaWu0gRZl14vG8MR9AOJIZbmkjhusqBYZ3HTHw==", + "dev": true } } }, @@ -4497,23 +4423,6 @@ "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - } } }, "string.prototype.trimend": { @@ -4557,29 +4466,20 @@ "integrity": "sha512-sa4DUQsYciMP1xhKWGuFM04fB0LG/9DlluZoSVywUMRNvzid6XucHK0/90xGxRoHrAaROrcHK1aPKaijCtSrhg==", "dev": true }, - "stringstream": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.6.tgz", - "integrity": "sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA==", - "dev": true - }, "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "dev": true, "requires": { - "ansi-regex": "^2.0.0" + "ansi-regex": "^5.0.0" } }, "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", - "dev": true, - "requires": { - "is-utf8": "^0.2.0" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true }, "strip-indent": { "version": "3.0.0", @@ -4606,21 +4506,26 @@ } }, "table": { - "version": "6.0.7", - "resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz", - "integrity": "sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g==", + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/table/-/table-6.1.0.tgz", + "integrity": "sha512-T4G5KMmqIk6X87gLKWyU5exPpTjLjY5KyrFWaIjv3SvgaIUGXV7UEzGEnZJdTA38/yUS6f9PlKezQ0bYXG3iIQ==", "dev": true, "requires": { - "ajv": "^7.0.2", - "lodash": "^4.17.20", + "ajv": "^8.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "lodash.clonedeep": "^4.5.0", + "lodash.flatten": "^4.4.0", + "lodash.truncate": "^4.4.2", "slice-ansi": "^4.0.0", "string-width": "^4.2.0" }, "dependencies": { "ajv": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.1.1.tgz", - "integrity": "sha512-ga/aqDYnUy/o7vbsRTFhhTsNeXiYb5JWDIcRIeZfwRNCefwjNTVYCGdGSUrEmiu3yDK3vFvNbgJxvrQW4JXrYQ==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.1.0.tgz", + "integrity": "sha512-B/Sk2Ix7A36fs/ZkuGLIR86EdjbgR6fsAcbx9lOP/QBSXujDNbVmIS/U4Itz5k8fPFDeVZl/zQ/gJW4Jrq6XjQ==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -4655,6 +4560,21 @@ "tar-stream": "^1.1.2" }, "dependencies": { + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, "pump": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", @@ -4694,6 +4614,17 @@ } } }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + } + }, "text-extensions": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz", @@ -4740,14 +4671,11 @@ "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==", "dev": true }, - "tough-cookie": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", - "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", - "dev": true, - "requires": { - "punycode": "^1.4.1" - } + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true }, "trim-newlines": { "version": "3.0.0", @@ -4761,17 +4689,20 @@ "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", "dev": true }, - "tunnel-agent": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", - "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", + "tslib": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.2.0.tgz", + "integrity": "sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==", "dev": true }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } }, "type-check": { "version": "0.4.0", @@ -4800,29 +4731,50 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "typescript": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz", + "integrity": "sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==", + "dev": true + }, + "uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", + "dev": true + }, "uglify-js": { - "version": "3.13.0", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.0.tgz", - "integrity": "sha512-TWYSWa9T2pPN4DIJYbU9oAjQx+5qdV5RUDxwARg8fmJZrD/V27Zj0JngW5xg1DFz42G0uDYl2XhzF6alSzD62w==", + "version": "3.13.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.13.4.tgz", + "integrity": "sha512-kv7fCkIXyQIilD5/yQy8O+uagsYIOt5cZvs890W40/e/rvjMSzJw81o9Bg0tkURxzZBROtDQhW2LFjOGoK3RZw==", "dev": true, "optional": true }, "unbox-primitive": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.0.tgz", - "integrity": "sha512-P/51NX+JXyxK/aigg1/ZgyccdAxm5K1+n8+tvqSntjOivPt19gvm1VC49RWYetsiub8WViUchdxl/KWHHB0kzA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz", + "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==", "dev": true, "requires": { "function-bind": "^1.1.1", - "has-bigints": "^1.0.0", - "has-symbols": "^1.0.0", - "which-boxed-primitive": "^1.0.1" + "has-bigints": "^1.0.1", + "has-symbols": "^1.0.2", + "which-boxed-primitive": "^1.0.2" } }, "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.10.2.tgz", + "integrity": "sha512-N4P+Q/BuyuEKFJ43B9gYuOj4TQUHXX+j2FqguVOpjkssLUUrnJofCcBccJSCoeturDoZU6GorDTHSvUDlSQbTg==", "dev": true }, "uri-js": { @@ -4832,14 +4784,6 @@ "dev": true, "requires": { "punycode": "^2.1.0" - }, - "dependencies": { - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - } } }, "util-deprecate": { @@ -4867,9 +4811,9 @@ "dev": true }, "v8-compile-cache": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", - "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", "dev": true }, "validate-npm-package-license": { @@ -4882,25 +4826,6 @@ "spdx-expression-parse": "^3.0.0" } }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true - } - } - }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -5009,12 +4934,6 @@ "strip-ansi": "^6.0.0" }, "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -5038,15 +4957,6 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } } } }, @@ -5056,6 +4966,18 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, "wtfnode": { "version": "0.8.4", "resolved": "https://registry.npmjs.org/wtfnode/-/wtfnode-0.8.4.tgz", @@ -5063,9 +4985,9 @@ "dev": true }, "xmlcreate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-1.0.2.tgz", - "integrity": "sha1-+mv3YqYKQT+z3Y9LA8WyaSONMI8=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.3.tgz", + "integrity": "sha512-HgS+X6zAztGa9zIK3Y3LXuJes33Lz9x+YyTxgrkIdabu2vqcGOWwdfCpf1hWLRrd553wd4QCDf6BBO6FfdsRiQ==", "dev": true }, "xtend": { @@ -5075,9 +4997,9 @@ "dev": true }, "y18n": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", - "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", "dev": true }, "yallist": { @@ -5212,9 +5134,19 @@ } }, "yargs-parser": { - "version": "20.2.6", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.6.tgz", - "integrity": "sha512-AP1+fQIWSM/sMiET8fyayjx/J+JmTPt2Mr0FkrgqB4todtfa53sOsrSAcIrJRD5XS20bKUwaDIuMkWKCEiQLKA==", + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true } } diff --git a/package.json b/package.json index c8570821cf..fb01fb9fdd 100644 --- a/package.json +++ b/package.json @@ -44,29 +44,35 @@ "safe-buffer": "^5.1.2" }, "devDependencies": { + "@types/chai": "^4.2.16", + "@types/mocha": "^8.2.2", + "@types/node": "^14.14.37", + "array-includes": "^3.1.3", "chai": "^4.1.1", "chai-subset": "^1.6.0", "chalk": "^2.4.2", "co": "4.6.0", - "coveralls": "^2.11.6", "eslint": "^7.10.0", "eslint-config-prettier": "^6.11.0", "eslint-plugin-es": "^3.0.1", "eslint-plugin-prettier": "^3.1.3", - "istanbul": "^0.4.5", - "jsdoc": "3.5.5", + "jsdoc": "^3.5.5", "lodash.camelcase": "^4.3.0", "mocha": "5.2.0", "mocha-sinon": "^2.1.0", "mongodb-extjson": "^2.1.1", "mongodb-mock-server": "^1.0.1", + "nyc": "^15.1.0", + "object.entries": "^1.1.3", "prettier": "^1.19.1", "semver": "^5.5.0", "sinon": "^4.3.0", "sinon-chai": "^3.2.0", "snappy": "^6.3.4", "spec-xunit-file": "0.0.1-3", - "standard-version": "^8.0.2", + "standard-version": "^9.2.0", + "tslib": "^2.2.0", + "typescript": "^4.2.4", "util.promisify": "^1.0.1", "worker-farm": "^1.5.0", "wtfnode": "^0.8.0", @@ -80,18 +86,19 @@ "url": "https://github.com/mongodb/node-mongodb-native/issues" }, "scripts": { - "atlas": "mocha --opts '{}' ./test/manual/atlas_connectivity.test.js", + "build:evergreen": "node .evergreen/generate_evergreen_tasks.js", + "build:unified": "tsc -p test/functional/unified-spec-runner/tsconfig.unified.json", + "check:atlas": "mocha --opts '{}' ./test/manual/atlas_connectivity.test.js", + "check:bench": "node test/benchmarks/driverBench/", + "check:coverage": "nyc npm run check:test", "check:kerberos": "mocha --opts '{}' -t 60000 test/manual/kerberos.test.js", "check:ldap": "mocha --opts '{}' test/manual/ldap.test.js", + "check:lint": "eslint -v && eslint lib test", + "check:test": "mocha --recursive test/functional test/unit", "check:tls": "mocha --opts '{}' test/manual/tls_support.test.js", - "test": "npm run lint && mocha --recursive test/functional test/unit", - "test-nolint": "mocha --recursive test/functional test/unit", - "coverage": "istanbul cover mongodb-test-runner -- -t 60000 test/unit test/functional", - "lint": "eslint -v && eslint lib test", - "format": "npm run lint -- --fix", - "bench": "node test/benchmarks/driverBench/", - "generate-evergreen": "node .evergreen/generate_evergreen_tasks.js", - "release": "standard-version -i HISTORY.md" + "format": "npm run check:lint -- --fix", + "release": "standard-version -i HISTORY.md", + "test": "npm run lint && mocha --recursive test/functional test/unit" }, "homepage": "https://github.com/mongodb/node-mongodb-native", "optionalDependencies": { diff --git a/test/functional/change_stream.test.js b/test/functional/change_stream.test.js index 4f5b6a4ebb..458e7651c9 100644 --- a/test/functional/change_stream.test.js +++ b/test/functional/change_stream.test.js @@ -1,6 +1,7 @@ 'use strict'; const assert = require('assert'); const Transform = require('stream').Transform; +const EventCollector = require('../tools/utils').EventCollector; const MongoNetworkError = require('../../lib/core').MongoNetworkError; const setupDatabase = require('./shared').setupDatabase; const withClient = require('./shared').withClient; @@ -221,56 +222,6 @@ describe('Change Streams', function() { } }); - class EventCollector { - constructor(obj, events, options) { - this._events = []; - this._timeout = options ? options.timeout : 5000; - - events.forEach(eventName => { - this._events[eventName] = []; - obj.on(eventName, event => this._events[eventName].push(event)); - }); - } - - waitForEvent(eventName, count, callback) { - if (typeof count === 'function') { - callback = count; - count = 1; - } - - waitForEventImpl(this, Date.now(), eventName, count, callback); - } - - reset(eventName) { - if (eventName == null) { - Object.keys(this._events).forEach(eventName => { - this._events[eventName] = []; - }); - - return; - } - - if (this._events[eventName] == null) { - throw new TypeError(`invalid event name "${eventName}" specified for reset`); - } - - this._events[eventName] = []; - } - } - - function waitForEventImpl(collector, start, eventName, count, callback) { - const events = collector._events[eventName]; - if (events.length >= count) { - return callback(undefined, events); - } - - if (Date.now() - start >= collector._timeout) { - return callback(new Error(`timed out waiting for event "${eventName}"`)); - } - - setTimeout(() => waitForEventImpl(collector, start, eventName, count, callback), 10); - } - it('should create a ChangeStream on a collection and emit `change` events', { metadata: { requires: { topology: 'replicaset', mongodb: '>=3.6' } }, diff --git a/test/functional/gridfs_stream.test.js b/test/functional/gridfs_stream.test.js index 0db9d3e6a6..37637e76ca 100644 --- a/test/functional/gridfs_stream.test.js +++ b/test/functional/gridfs_stream.test.js @@ -100,7 +100,7 @@ describe('GridFS Stream', function() { }); it('destroy publishes provided error', { - metadata: { requires: { topology: ['single'], node: '>=8' } }, + metadata: { requires: { topology: ['single'], node: '>8' } }, test: function(done) { var configuration = this.configuration; var GridFSBucket = configuration.require.GridFSBucket; diff --git a/test/functional/spec-runner/index.js b/test/functional/spec-runner/index.js index 179f30c6c1..240126447e 100644 --- a/test/functional/spec-runner/index.js +++ b/test/functional/spec-runner/index.js @@ -438,14 +438,7 @@ function extractCrudResult(result, operation) { return result.value; } - return Object.keys(operation.result).reduce((crudResult, key) => { - if (Object.prototype.hasOwnProperty.call(result, key) && result[key] != null) { - // FIXME(major): update crud results are broken and need to be changed - crudResult[key] = key === 'upsertedId' ? result[key]._id : result[key]; - } - - return crudResult; - }, {}); + return operation.result; } function isTransactionCommand(command) { diff --git a/test/functional/unified-spec-runner/entities.ts b/test/functional/unified-spec-runner/entities.ts new file mode 100644 index 0000000000..fd61d26986 --- /dev/null +++ b/test/functional/unified-spec-runner/entities.ts @@ -0,0 +1,329 @@ +import MongoClient from '../../../lib/mongo_client'; +import Db from '../../../lib/db'; +import Collection from '../../../lib/collection'; +import GridFSBucket from '../../../lib/gridfs-stream/index' +import ChangeStream from '../../../lib/change_stream'; + +import ReadConcern from '../../../lib/read_concern'; +import WriteConcern from '../../../lib/write_concern'; +import ReadPreference from '../../../lib/core/topologies/read_preference'; +import { ClientSession } from '../../../lib/core/sessions'; +import type { ClientEntity, EntityDescription, Document } from './schema'; +import type { + CommandFailedEvent, + CommandStartedEvent, + CommandSucceededEvent +} from '../../../lib/core/connection/apm'; +import { patchCollectionOptions, patchDbOptions } from './unified-utils'; +import { expect } from 'chai'; +import { TestConfiguration } from './runner'; + +export class MapPassThrough { + items: Map; + constructor(entries?: readonly (readonly [K, V])[] | null) { + this.items = new Map(entries) + } + + get(key: K) { return this.items.get(key) } + set(key: K, value: V) { return this.items.set(key, value) } + entries() { return this.items.entries() } + clear() { return this.items.clear() } + [Symbol.iterator]() { return this.items[Symbol.iterator]() } +} + + +interface UnifiedChangeStream extends ChangeStream { + eventCollector: InstanceType; +} + +export type CommandEvent = CommandStartedEvent | CommandSucceededEvent | CommandFailedEvent; + +function getClient(address) { + return new MongoClient(`mongodb://${address}`, { + useUnifiedTopology: Boolean(process.env.MONGODB_UNIFIED_TOPOLOGY) + }); +} + +export interface UnifiedMongoClient { + on(eventName: string, listener: (...args: any[]) => void): void; + removeListener(eventName: string, listener: (...args: any[]) => void): void; + connect(): Promise; + db(name?: string, options?: Document): Db; + startSession(options: Document): ClientSession; + close(): Promise; +} + +export class UnifiedMongoClient extends MongoClient { + events: CommandEvent[]; + failPoints: Document[]; + ignoredEvents: string[]; + observedEvents: ('commandStarted' | 'commandSucceeded' | 'commandFailed')[]; + + // types not coming from jsdoc + topology: any; + s: any; + + static EVENT_NAME_LOOKUP = { + commandStartedEvent: 'commandStarted', + commandSucceededEvent: 'commandSucceeded', + commandFailedEvent: 'commandFailed' + } as const; + + constructor(url: string, description: ClientEntity) { + super(url, { + monitorCommands: true, + ...description.uriOptions, + useUnifiedTopology: Boolean(process.env.MONGODB_UNIFIED_TOPOLOGY) + }); + this.events = []; + this.failPoints = []; + this.ignoredEvents = [ + ...(description.ignoreCommandMonitoringEvents ?? []), + 'configureFailPoint' + ]; + // apm + this.observedEvents = (description.observeEvents ?? []).map( + e => UnifiedMongoClient.EVENT_NAME_LOOKUP[e] + ); + for (const eventName of this.observedEvents) { + this.on(eventName, this.pushEvent); + } + } + + // NOTE: pushEvent must be an arrow function + pushEvent: (e: CommandEvent) => void = e => { + if (!this.ignoredEvents.includes(e.commandName)) { + this.events.push(e); + } + }; + + /** Disables command monitoring for the client and returns a list of the captured events. */ + stopCapturingEvents(): CommandEvent[] { + for (const eventName of this.observedEvents) { + this.removeListener(eventName, this.pushEvent); + } + return this.events; + } + + getSeedList() { + if (this.s.options.useUnifiedTopology) { + return this.topology.s.seedlist.map(h => `${h.host}:${h.port}`).join(','); + } else { + return this.topology.s.coreTopology.s.seedlist.map(h => `${h.host}:${h.port}`).join(',') + } + } +} + +export class FailPointMap extends MapPassThrough { + async enableFailPoint( + addressOrClient: string | UnifiedMongoClient, + failPoint: Document + ): Promise { + let client: MongoClient; + let address: string; + if (addressOrClient instanceof MongoClient) { + client = addressOrClient; + address = client.getSeedList(); + } else { + // create a new client + address = addressOrClient.toString(); + client = getClient(address); + await client.connect(); + } + + const admin = client.db('admin'); + const result = await admin.command(failPoint); + + if (!(addressOrClient instanceof MongoClient)) { + // we created this client + await client.close(); + } + + expect(result).to.have.property('ok', 1); + this.set(address, failPoint.configureFailPoint); + return result; + } + + async disableFailPoints(): Promise { + const entries = Array.from(this.entries()); + await Promise.all( + entries.map(async ([address, configureFailPoint]) => { + const client = getClient(address); + await client.connect(); + const admin = client.db('admin'); + const result = await admin.command({ configureFailPoint, mode: 'off' }); + expect(result).to.have.property('ok', 1); + await client.close(); + }) + ); + } +} + +export type Entity = + | UnifiedMongoClient + | Db + | Collection + | ClientSession + | UnifiedChangeStream + | GridFSBucket + | Document; // Results from operations + +export type EntityCtor = + | typeof UnifiedMongoClient + | typeof Db + | typeof Collection + | typeof ClientSession + | typeof ChangeStream + | typeof GridFSBucket; + +export type EntityTypeId = 'client' | 'db' | 'collection' | 'session' | 'bucket' | 'stream'; + +const ENTITY_CTORS = new Map(); +ENTITY_CTORS.set('client', UnifiedMongoClient); +ENTITY_CTORS.set('db', Db); +ENTITY_CTORS.set('collection', Collection); +ENTITY_CTORS.set('session', ClientSession); +ENTITY_CTORS.set('bucket', GridFSBucket); +ENTITY_CTORS.set('stream', ChangeStream); + +export class EntitiesMap extends MapPassThrough { + failPoints: FailPointMap; + + constructor(entries?: readonly (readonly [string, E])[] | null) { + super(entries); + this.failPoints = new FailPointMap(); + } + + mapOf(type: 'client'): EntitiesMap; + mapOf(type: 'db'): EntitiesMap; + mapOf(type: 'collection'): EntitiesMap; + mapOf(type: 'session'): EntitiesMap; + mapOf(type: 'bucket'): EntitiesMap; + mapOf(type: 'stream'): EntitiesMap; + mapOf(type: EntityTypeId): EntitiesMap { + const ctor = ENTITY_CTORS.get(type); + if (!ctor) { + throw new Error(`Unknown type ${type}`); + } + return new EntitiesMap(Array.from(this.entries()).filter(([, e]) => e instanceof ctor)); + } + + getEntity(type: 'client', key: string, assertExists?: boolean): UnifiedMongoClient; + getEntity(type: 'db', key: string, assertExists?: boolean): Db; + getEntity(type: 'collection', key: string, assertExists?: boolean): Collection; + getEntity(type: 'session', key: string, assertExists?: boolean): ClientSession; + getEntity(type: 'bucket', key: string, assertExists?: boolean): GridFSBucket; + getEntity(type: 'stream', key: string, assertExists?: boolean): UnifiedChangeStream; + getEntity(type: EntityTypeId, key: string, assertExists = true): Entity { + const entity = this.get(key); + if (!entity) { + if (assertExists) throw new Error(`Entity '${key}' does not exist`); + return; + } + const ctor = ENTITY_CTORS.get(type); + if (!ctor) { + throw new Error(`Unknown entity type ${type}`); + } + if (!(entity instanceof ctor)) { + throw new Error(`${key} is not an instance of ${type}`); + } + return entity; + } + + async cleanup(): Promise { + await this.failPoints.disableFailPoints(); + for (const [, client] of this.mapOf('client')) { + await client.close(); + } + for (const [, session] of this.mapOf('session')) { + await session.endSession(); + } + this.clear(); + } + + static async createEntities( + config: TestConfiguration, + entities?: EntityDescription[] + ): Promise { + const map = new EntitiesMap(); + for (const entity of entities ?? []) { + if ('client' in entity) { + const useMultipleMongoses = + config.topologyType === 'Sharded' && entity.client.useMultipleMongoses; + const uri = config.unifiedUrlBuilder({ useMultipleMongoses }); + const client = new UnifiedMongoClient(uri, entity.client); + await client.connect(); + map.set(entity.client.id, client); + } else if ('database' in entity) { + const client = map.getEntity('client', entity.database.client); + const db = client.db( + entity.database.databaseName, + patchDbOptions(entity.database.databaseOptions) + ); + map.set(entity.database.id, db); + } else if ('collection' in entity) { + const db = map.getEntity('db', entity.collection.database); + const collection = db.collection( + entity.collection.collectionName, + patchCollectionOptions(entity.collection.collectionOptions) + ); + map.set(entity.collection.id, collection); + } else if ('session' in entity) { + const client = map.getEntity('client', entity.session.client); + + const options = Object.create(null); + + if (entity.session.sessionOptions?.causalConsistency) { + options.causalConsistency = entity.session.sessionOptions?.causalConsistency; + } + + if (entity.session.sessionOptions?.defaultTransactionOptions) { + options.defaultTransactionOptions = Object.create(null); + const defaultOptions = entity.session.sessionOptions.defaultTransactionOptions; + if (defaultOptions.readConcern) { + options.defaultTransactionOptions.readConcern = ReadConcern.fromOptions( + defaultOptions.readConcern + ); + } + if (defaultOptions.writeConcern) { + options.defaultTransactionOptions.writeConcern = WriteConcern.fromOptions( + defaultOptions + ); + } + if (defaultOptions.readPreference) { + options.defaultTransactionOptions.readPreference = ReadPreference.fromOptions( + defaultOptions.readPreference + ); + } + if (typeof defaultOptions.maxCommitTimeMS === 'number') { + options.defaultTransactionOptions.maxCommitTimeMS = defaultOptions.maxCommitTimeMS; + } + } + + const session = client.startSession(options); + map.set(entity.session.id, session); + } else if ('bucket' in entity) { + const db = map.getEntity('db', entity.bucket.database); + + const options = Object.create(null); + + if (entity.bucket.bucketOptions?.bucketName) { + options.bucketName = entity.bucket.bucketOptions?.bucketName; + } + if (entity.bucket.bucketOptions?.chunkSizeBytes) { + options.chunkSizeBytes = entity.bucket.bucketOptions?.chunkSizeBytes; + } + if (entity.bucket.bucketOptions?.readPreference) { + options.readPreference = entity.bucket.bucketOptions?.readPreference; + } + + map.set(entity.bucket.id, new GridFSBucket(db, options)); + } else if ('stream' in entity) { + throw new Error(`Unsupported Entity ${JSON.stringify(entity)}`); + } else { + throw new Error(`Unsupported Entity ${JSON.stringify(entity)}`); + } + } + return map; + } +} diff --git a/test/functional/unified-spec-runner/match.ts b/test/functional/unified-spec-runner/match.ts new file mode 100644 index 0000000000..533ee7d228 --- /dev/null +++ b/test/functional/unified-spec-runner/match.ts @@ -0,0 +1,319 @@ +import { expect } from 'chai'; +import { MongoError } from '../../../lib/core/error'; +import { Binary, Long, ObjectID as ObjectId } from 'bson' +import { + CommandFailedEvent, + CommandStartedEvent, + CommandSucceededEvent +} from '../../../lib/core/connection/apm'; +import { CommandEvent, EntitiesMap } from './entities'; +import { ExpectedError, ExpectedEvent, Document } from './schema'; + +function isLong(maybeLong?: any): maybeLong is Long { + return maybeLong && typeof maybeLong === 'object' && maybeLong._bsontype === 'Long' +} + +export interface ExistsOperator { + $$exists: boolean; +} +export function isExistsOperator(value: unknown): value is ExistsOperator { + return typeof value === 'object' && value != null && '$$exists' in value; +} +export interface TypeOperator { + $$type: boolean; +} +export function isTypeOperator(value: unknown): value is TypeOperator { + return typeof value === 'object' && value != null && '$$type' in value; +} +export interface MatchesEntityOperator { + $$matchesEntity: string; +} +export function isMatchesEntityOperator(value: unknown): value is MatchesEntityOperator { + return typeof value === 'object' && value != null && '$$matchesEntity' in value; +} +export interface MatchesHexBytesOperator { + $$matchesHexBytes: string; +} +export function isMatchesHexBytesOperator(value: unknown): value is MatchesHexBytesOperator { + return typeof value === 'object' && value != null && '$$matchesHexBytes' in value; +} +export interface UnsetOrMatchesOperator { + $$unsetOrMatches: unknown; +} +export function isUnsetOrMatchesOperator(value: unknown): value is UnsetOrMatchesOperator { + return typeof value === 'object' && value != null && '$$unsetOrMatches' in value; +} +export interface SessionLsidOperator { + $$sessionLsid: string; +} +export function isSessionLsidOperator(value: unknown): value is SessionLsidOperator { + return typeof value === 'object' && value != null && '$$sessionLsid' in value; +} + +export const SpecialOperatorKeys = [ + '$$exists', + '$$type', + '$$matchesEntity', + '$$matchesHexBytes', + '$$unsetOrMatches', + '$$sessionLsid' +]; + +export type SpecialOperator = + | ExistsOperator + | TypeOperator + | MatchesEntityOperator + | MatchesHexBytesOperator + | UnsetOrMatchesOperator + | SessionLsidOperator; + +// eslint-disable-next-line @typescript-eslint/ban-types +type KeysOfUnion = T extends object ? keyof T : never; +export type SpecialOperatorKey = KeysOfUnion; +export function isSpecialOperator(value: unknown): value is SpecialOperator { + return ( + isExistsOperator(value) || + isTypeOperator(value) || + isMatchesEntityOperator(value) || + isMatchesHexBytesOperator(value) || + isUnsetOrMatchesOperator(value) || + isSessionLsidOperator(value) + ); +} + +const TYPE_MAP = new Map(); + +TYPE_MAP.set('double', actual => typeof actual === 'number' || actual._bsontype === 'Double'); +TYPE_MAP.set('string', actual => typeof actual === 'string'); +TYPE_MAP.set('object', actual => typeof actual === 'object' && actual !== null); +TYPE_MAP.set('array', actual => Array.isArray(actual)); +TYPE_MAP.set('binData', actual => actual instanceof Binary); +TYPE_MAP.set('undefined', actual => actual === undefined); +TYPE_MAP.set('objectId', actual => actual instanceof ObjectId); +TYPE_MAP.set('bool', actual => typeof actual === 'boolean'); +TYPE_MAP.set('date', actual => actual instanceof Date); +TYPE_MAP.set('null', actual => actual === null); +TYPE_MAP.set('regex', actual => actual instanceof RegExp || actual._bsontype === 'BSONRegExp'); +TYPE_MAP.set('dbPointer', actual => actual._bsontype === 'DBRef'); +TYPE_MAP.set('javascript', actual => actual._bsontype === 'Code'); +TYPE_MAP.set('symbol', actual => actual._bsontype === 'Symbol'); +TYPE_MAP.set('javascriptWithScope', actual => actual._bsontype === 'Code' && actual.scope); +TYPE_MAP.set('timestamp', actual => actual._bsontype === 'Timestamp'); +TYPE_MAP.set('decimal', actual => actual._bsontype === 'Decimal128'); +TYPE_MAP.set('minKey', actual => actual._bsontype === 'MinKey'); +TYPE_MAP.set('maxKey', actual => actual._bsontype === 'MaxKey'); +TYPE_MAP.set( + 'int', + actual => (typeof actual === 'number' && Number.isInteger(actual)) || actual._bsontype === 'Int32' +); +TYPE_MAP.set( + 'long', + actual => (typeof actual === 'number' && Number.isInteger(actual)) || isLong(actual) +); + +export function resultCheck( + actual: Document, + expected: Document | number | string | boolean, + entities: EntitiesMap, + path: string[] = [], + depth = 0 +): void { + if (typeof expected === 'object' && expected) { + // Expected is an object + // either its a special operator or just an object to check equality against + + if (isSpecialOperator(expected)) { + // Special operation check is a base condition + // specialCheck may recurse depending upon the check ($$unsetOrMatches) + specialCheck(actual, expected, entities, path, depth); + return; + } else { + // Just a plain object, however this object can contain special operations + // So we need to recurse over each key,value + const expectedEntries = Object.entries(expected); + + if (depth > 1) { + expect(actual, `Expected actual to exist at ${path.join('')}`).to.exist; + expect( + Object.keys(actual), + `[${Object.keys(actual)}] length !== [${Object.keys(expected)}]` + ).to.have.lengthOf(Object.keys(expected).length); + } + + for (const [key, value] of expectedEntries) { + path.push(Array.isArray(expected) ? `[${key}]` : `.${key}`); // record what key we're at + depth += 1; + if (key === 'sort') { + // TODO: This is a workaround that works because all sorts in the specs + // are objects with one key; ideally we'd want to adjust the spec definitions + // to indicate whether order matters for any given key and set general + // expectations accordingly (see NODE-3235) + expect(Object.keys(value)).to.have.lengthOf(1); + expect(actual[key]).to.be.instanceOf(Map); + expect(actual[key].size).to.equal(1); + const expectedSortKey = Object.keys(value)[0]; + expect(actual[key]).to.have.all.keys(expectedSortKey); + const objFromActual = { [expectedSortKey]: actual[key].get(expectedSortKey) }; + resultCheck(objFromActual, value, entities, path, depth); + } else { + resultCheck(actual[key], value, entities, path, depth); + } + depth -= 1; + path.pop(); // if the recursion was successful we can drop the tested key + } + } + } else { + // Here's our recursion base case + // expected is: number | Long | string | boolean | null + if (isLong(actual) || isLong(expected)) { + // case (if either is a long than its safe to convert the other to confirm a match) + const actLong = Long.fromNumber((actual as unknown) as number) + const expLong = Long.fromNumber((expected as unknown) as number) + // Long requires special equality check + expect(actLong.equals(expLong), `at ${path.join('')}`).to.be.true; + } else { + // case + expect(actual, `at ${path.join('')}`).to.equal(expected); + } + } +} + +export function specialCheck( + actual: Document, + expected: SpecialOperator, + entities: EntitiesMap, + path: string[] = [], + depth = 0 +): boolean { + if (isUnsetOrMatchesOperator(expected)) { + // $$unsetOrMatches + if (actual === null || actual === undefined) return; + else { + depth += 1; + resultCheck(actual, expected.$$unsetOrMatches, entities, path, depth); + depth -= 1; + } + } else if (isMatchesEntityOperator(expected)) { + // $$matchesEntity + const entity = entities.get(expected.$$matchesEntity); + if ( + typeof actual === 'object' && // an object + actual && // that isn't null + 'equals' in actual && // with an equals + typeof actual.equals === 'function' // method + ) { + expect(actual.equals(entity)).to.be.true; + } else { + expect(actual).to.equal(entity); + } + } else if (isMatchesHexBytesOperator(expected)) { + // $$matchesHexBytes + const expectedBuffer = Buffer.from(expected.$$matchesHexBytes, 'hex'); + expect(expectedBuffer.every((byte, index) => byte === actual[index])).to.be.true; + } else if (isSessionLsidOperator(expected)) { + // $$sessionLsid + const session = entities.getEntity('session', expected.$$sessionLsid, false); + expect(session, `Session ${expected.$$sessionLsid} does not exist in entities`).to.exist; + const entitySessionHex = session.id.id.buffer.toString('hex').toUpperCase(); + const actualSessionHex = actual.id.buffer.toString('hex').toUpperCase(); + expect( + entitySessionHex, + `Session entity ${expected.$$sessionLsid} does not match lsid` + ).to.equal(actualSessionHex); + } else if (isTypeOperator(expected)) { + // $$type + let ok: boolean; + const types = Array.isArray(expected.$$type) ? expected.$$type : [expected.$$type]; + for (const type of types) { + ok ||= TYPE_MAP.get(type)(actual); + } + expect(ok, `Expected [${actual}] to be one of [${types}]`).to.be.true; + } else if (isExistsOperator(expected)) { + // $$exists + const actualExists = actual !== undefined && actual !== null; + expect((expected.$$exists && actualExists) || (!expected.$$exists && !actualExists)).to.be.true; + } else { + expect.fail(`Unknown special operator: ${JSON.stringify(expected)}`); + } +} + +export function matchesEvents( + expected: ExpectedEvent[], + actual: CommandEvent[], + entities: EntitiesMap +): void { + // TODO: NodeJS Driver has extra events + // expect(actual).to.have.lengthOf(expected.length); + + for (const [index, actualEvent] of actual.entries()) { + const expectedEvent = expected[index]; + + if (expectedEvent.commandStartedEvent && actualEvent instanceof CommandStartedEvent) { + resultCheck(actualEvent, expectedEvent.commandStartedEvent, entities, [ + `events[${index}].commandStartedEvent` + ]); + } else if ( + expectedEvent.commandSucceededEvent && + actualEvent instanceof CommandSucceededEvent + ) { + resultCheck(actualEvent, expectedEvent.commandSucceededEvent, entities, [ + `events[${index}].commandSucceededEvent` + ]); + } else if (expectedEvent.commandFailedEvent && actualEvent instanceof CommandFailedEvent) { + expect(actualEvent.commandName).to.equal(expectedEvent.commandFailedEvent.commandName); + } else { + expect.fail(`Events must be one of the known types, got ${actualEvent}`); + } + } +} + +export function expectErrorCheck( + error: Error | MongoError, + expected: ExpectedError, + entities: EntitiesMap +): boolean { + if (Object.keys(expected)[0] === 'isClientError' || Object.keys(expected)[0] === 'isError') { + // FIXME: We cannot tell if Error arose from driver and not from server + return; + } + + if (expected.errorContains != null) { + expect(error.message).to.include(expected.errorContains); + } + + if (!(error instanceof MongoError)) { + // if statement asserts type for TS, expect will always fail + expect(error).to.be.instanceOf(MongoError); + return; + } + + if (expected.errorCode != null) { + expect(error).to.have.property('code', expected.errorCode); + } + + if (expected.errorCodeName != null) { + expect(error).to.have.property('codeName', expected.errorCodeName); + } + + if (expected.errorLabelsContain != null) { + for (const errorLabel of expected.errorLabelsContain) { + expect( + error.hasErrorLabel(errorLabel), + `Error was supposed to have label ${errorLabel}, has [${error.errorLabels}]` + ).to.be.true; + } + } + + if (expected.errorLabelsOmit != null) { + for (const errorLabel of expected.errorLabelsOmit) { + expect( + error.hasErrorLabel(errorLabel), + `Error was supposed to have label ${errorLabel}, has [${error.errorLabels}]` + ).to.be.false; + } + } + + if (expected.expectResult != null) { + resultCheck(error, expected.expectResult, entities); + } +} diff --git a/test/functional/unified-spec-runner/operations.ts b/test/functional/unified-spec-runner/operations.ts new file mode 100644 index 0000000000..4c83f44aa3 --- /dev/null +++ b/test/functional/unified-spec-runner/operations.ts @@ -0,0 +1,509 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ +import { expect } from 'chai'; +import { Collection, Db, GridFSFile, MongoClient, ObjectId } from '../../../index'; +import ReadConcern from '../../../lib/read_concern'; +import ReadPreference from '../../../lib/core/topologies/read_preference'; +import WriteConcern from '../../../lib/write_concern'; +import { EventCollector } from '../../tools/utils'; +import { EntitiesMap } from './entities'; +import { expectErrorCheck, resultCheck } from './match'; +import type { OperationDescription, Document } from './schema'; +import { CommandStartedEvent } from '../../../lib/core/connection/apm'; +import { translateOptions } from './unified-utils'; + +export interface WriteConcernSettings { + /** The write concern */ + w?: number | 'majority'; + /** The write concern timeout */ + wtimeoutMS?: number; + /** The journal write concern */ + journal?: boolean; + + // legacy options + /** The journal write concern */ + j?: boolean; + /** The write concern timeout */ + wtimeout?: number; + /** The file sync write concern */ + fsync?: boolean | 1; +} + +export interface WriteConcernOptions { + /** Write Concern as an object */ + writeConcern?: WriteConcern | WriteConcernSettings; +} + +export declare interface SerializeOptions { + /** the serializer will check if keys are valid. */ + checkKeys?: boolean; + /** serialize the javascript functions **(default:false)**. */ + serializeFunctions?: boolean; + /** serialize will not emit undefined fields **(default:true)** */ + ignoreUndefined?: boolean; + /* Excluded from this release type: minInternalBufferSize */ + /** the index in the buffer where we wish to start serializing into */ + index?: number; +} + +export interface BSONSerializeOptions extends Omit { + /** Return document results as raw BSON buffers */ + fieldsAsRaw?: { [key: string]: boolean }; + /** Promotes BSON values to native types where possible, set to false to only receive wrapper types */ + promoteValues?: boolean; + /** Promotes Binary BSON values to native Node Buffers */ + promoteBuffers?: boolean; + /** Promotes long values to number if they fit inside the 53 bits resolution */ + promoteLongs?: boolean; + /** Serialize functions on any object */ + serializeFunctions?: boolean; + /** Specify if the BSON serializer should ignore undefined fields */ + ignoreUndefined?: boolean; + + raw?: boolean; +} + +export interface InsertOneOptions extends BSONSerializeOptions, WriteConcernOptions { + /** Allow driver to bypass schema validation in MongoDB 3.2 or higher. */ + bypassDocumentValidation?: boolean; + /** Force server to assign _id values instead of driver. */ + forceServerObjectId?: boolean; +} + + +interface OperationFunctionParams { + client: MongoClient; + operation: OperationDescription; + entities: EntitiesMap; +} + +type RunOperationFn = (p: OperationFunctionParams) => Promise; +export const operations = new Map(); + +operations.set('abortTransaction', async ({ entities, operation }) => { + const session = entities.getEntity('session', operation.object); + return session.abortTransaction(); +}); + +operations.set('aggregate', async ({ entities, operation }) => { + const dbOrCollection = entities.get(operation.object) as Db | Collection; + if (!(dbOrCollection instanceof Db || dbOrCollection instanceof Collection)) { + throw new Error(`Operation object '${operation.object}' must be a db or collection`); + } + return dbOrCollection + .aggregate(operation.arguments.pipeline, { + allowDiskUse: operation.arguments.allowDiskUse, + batchSize: operation.arguments.batchSize, + bypassDocumentValidation: operation.arguments.bypassDocumentValidation, + maxTimeMS: operation.arguments.maxTimeMS, + maxAwaitTimeMS: operation.arguments.maxAwaitTimeMS, + collation: operation.arguments.collation, + hint: operation.arguments.hint, + out: operation.arguments.out + }) + .toArray(); +}); + +operations.set('assertCollectionExists', async ({ operation, client }) => { + const collections = ( + await client + .db(operation.arguments.databaseName) + .listCollections({}, { nameOnly: true }) + .toArray() + ).map(({ name }) => name); + expect(collections).to.include(operation.arguments.collectionName); +}); + +operations.set('assertCollectionNotExists', async ({ operation, client }) => { + const collections = ( + await client + .db(operation.arguments.databaseName) + .listCollections({}, { nameOnly: true }) + .toArray() + ).map(({ name }) => name); + expect(collections).to.not.include(operation.arguments.collectionName); +}); + +operations.set('assertIndexExists', async ({ operation, client }) => { + const collection = client + .db(operation.arguments.databaseName) + .collection(operation.arguments.collectionName); + const indexes = (await collection.listIndexes().toArray()).map(({ name }) => name); + expect(indexes).to.include(operation.arguments.indexName); +}); + +operations.set('assertIndexNotExists', async ({ operation, client }) => { + const collection = client + .db(operation.arguments.databaseName) + .collection(operation.arguments.collectionName); + try { + expect(await collection.indexExists(operation.arguments.indexName)).to.be.true; + } catch (error) { + if (error.code === 26 || error.message.includes('ns does not exist')) { + return; + } + throw error; + } +}); + +operations.set('assertDifferentLsidOnLastTwoCommands', async ({ entities, operation }) => { + const client = entities.getEntity('client', operation.arguments.client); + expect(client.observedEvents.includes('commandStarted')).to.be.true; + + const startedEvents = client.events.filter( + ev => ev instanceof CommandStartedEvent + ) as CommandStartedEvent[]; + + expect(startedEvents).to.have.length.gte(2); + + const last = startedEvents[startedEvents.length - 1]; + const secondLast = startedEvents[startedEvents.length - 2]; + + expect(last.command).to.have.property('lsid'); + expect(secondLast.command).to.have.property('lsid'); + + expect(last.command.lsid.id.buffer.equals(secondLast.command.lsid.id.buffer)).to.be.false; +}); + +operations.set('assertSameLsidOnLastTwoCommands', async ({ entities, operation }) => { + const client = entities.getEntity('client', operation.arguments.client); + expect(client.observedEvents.includes('commandStarted')).to.be.true; + + const startedEvents = client.events.filter( + ev => ev instanceof CommandStartedEvent + ) as CommandStartedEvent[]; + + expect(startedEvents).to.have.length.gte(2); + + const last = startedEvents[startedEvents.length - 1]; + const secondLast = startedEvents[startedEvents.length - 2]; + + expect(last.command).to.have.property('lsid'); + expect(secondLast.command).to.have.property('lsid'); + + expect(last.command.lsid.id.buffer.equals(secondLast.command.lsid.id.buffer)).to.be.true; +}); + +operations.set('assertSessionDirty', async ({ entities, operation }) => { + const session = entities.getEntity('session', operation.arguments.session); + expect(session.serverSession.isDirty).to.be.true; +}); + +operations.set('assertSessionNotDirty', async ({ entities, operation }) => { + const session = entities.getEntity('session', operation.arguments.session); + expect(session.serverSession.isDirty).to.be.false; +}); + +operations.set('assertSessionPinned', async ({ entities, operation }) => { + const session = entities.getEntity('session', operation.arguments.session); + expect(session.transaction.isPinned).to.be.true; +}); + +operations.set('assertSessionUnpinned', async ({ entities, operation }) => { + const session = entities.getEntity('session', operation.arguments.session); + expect(session.transaction.isPinned).to.be.false; +}); + +operations.set('assertSessionTransactionState', async ({ entities, operation }) => { + const session = entities.getEntity('session', operation.arguments.session); + + const transactionStateTranslation = { + none: 'NO_TRANSACTION', + starting: 'STARTING_TRANSACTION', + in_progress: 'TRANSACTION_IN_PROGRESS', + committed: 'TRANSACTION_COMMITTED', + aborted: 'TRANSACTION_ABORTED' + }; + + const driverTransactionStateName = transactionStateTranslation[operation.arguments.state]; + expect(session.transaction.state).to.equal(driverTransactionStateName); +}); + +operations.set('bulkWrite', async ({ entities, operation }) => { + const collection = entities.getEntity('collection', operation.object); + return collection.bulkWrite(operation.arguments.requests); +}); + +operations.set('commitTransaction', async ({ entities, operation }) => { + const session = entities.getEntity('session', operation.object); + return session.commitTransaction(); +}); + +operations.set('createChangeStream', async ({ entities, operation }) => { + const watchable = entities.get(operation.object); + if (!('watch' in watchable)) { + throw new Error(`Entity ${operation.object} must be watchable`); + } + const changeStream = watchable.watch(operation.arguments.pipeline, { + fullDocument: operation.arguments.fullDocument, + maxAwaitTimeMS: operation.arguments.maxAwaitTimeMS, + resumeAfter: operation.arguments.resumeAfter, + startAfter: operation.arguments.startAfter, + startAtOperationTime: operation.arguments.startAtOperationTime, + batchSize: operation.arguments.batchSize + }); + changeStream.eventCollector = new EventCollector(changeStream, ['init', 'change', 'error']); + + return new Promise((resolve, reject) => { + const timeout = setTimeout(() => { + reject(new Error('Change stream never started')); + }, 2000); + + changeStream.cursor.once('init', () => { + clearTimeout(timeout); + resolve(changeStream); + }); + }); +}); + +operations.set('createCollection', async ({ entities, operation }) => { + const db = entities.getEntity('db', operation.object); + const session = entities.getEntity('session', operation.arguments.session, false); + await db.createCollection(operation.arguments.collection, { session }); +}); + +operations.set('createIndex', async ({ entities, operation }) => { + const collection = entities.getEntity('collection', operation.object); + const session = entities.getEntity('session', operation.arguments.session, false); + await collection.createIndex(operation.arguments.keys, { + session, + name: operation.arguments.name + }); +}); + +operations.set('deleteOne', async ({ entities, operation }) => { + const collection = entities.getEntity('collection', operation.object); + return collection.deleteOne(operation.arguments.filter); +}); + +operations.set('dropCollection', async ({ entities, operation }) => { + const db = entities.getEntity('db', operation.object); + return await db.dropCollection(operation.arguments.collection); +}); + +operations.set('endSession', async ({ entities, operation }) => { + const session = entities.getEntity('session', operation.object); + return session.endSession(); +}); + +operations.set('find', async ({ entities, operation }) => { + const collection = entities.getEntity('collection', operation.object); + const { filter, sort, batchSize, limit } = operation.arguments; + return collection.find(filter, { sort, batchSize, limit }).toArray(); +}); + +operations.set('findOneAndReplace', async ({ entities, operation }) => { + const collection = entities.getEntity('collection', operation.object); + const { filter, replacement, ...opts } = operation.arguments; + return collection.findOneAndReplace(filter, replacement, translateOptions(opts)); +}); + +operations.set('findOneAndUpdate', async ({ entities, operation }) => { + const collection = entities.getEntity('collection', operation.object); + const { filter, update, ...opts } = operation.arguments; + return (await collection.findOneAndUpdate(filter, update, translateOptions(opts))).value; +}); + +operations.set('failPoint', async ({ entities, operation }) => { + const client = entities.getEntity('client', operation.arguments.client); + return entities.failPoints.enableFailPoint(client, operation.arguments.failPoint); +}); + +operations.set('insertOne', async ({ entities, operation }) => { + const collection = entities.getEntity('collection', operation.object); + + const session = entities.getEntity('session', operation.arguments.session, false); + + const options = { + session + } as InsertOneOptions; + + return collection.insertOne(operation.arguments.document, options); +}); + +operations.set('insertMany', async ({ entities, operation }) => { + const collection = entities.getEntity('collection', operation.object); + + const session = entities.getEntity('session', operation.arguments.session, false); + + const options = { + session, + ordered: operation.arguments.ordered ?? true + }; + + return collection.insertMany(operation.arguments.documents, options); +}); + +operations.set('iterateUntilDocumentOrError', async ({ entities, operation }) => { + const changeStream = entities.getEntity('stream', operation.object); + // Either change or error promise will finish + return Promise.race([ + changeStream.eventCollector.waitAndShiftEvent('change'), + changeStream.eventCollector.waitAndShiftEvent('error') + ]); +}); + +operations.set('listDatabases', async ({ entities, operation }) => { + const client = entities.getEntity('client', operation.object); + return client.db().admin().listDatabases(); +}); + +operations.set('replaceOne', async ({ entities, operation }) => { + const collection = entities.getEntity('collection', operation.object); + return collection.replaceOne(operation.arguments.filter, operation.arguments.replacement, { + bypassDocumentValidation: operation.arguments.bypassDocumentValidation, + collation: operation.arguments.collation, + hint: operation.arguments.hint, + upsert: operation.arguments.upsert + }); +}); + +operations.set('startTransaction', async ({ entities, operation }) => { + const session = entities.getEntity('session', operation.object); + session.startTransaction(); +}); + +operations.set('targetedFailPoint', async ({ entities, operation }) => { + const session = entities.getEntity('session', operation.arguments.session); + expect(session.transaction.isPinned, 'Session must be pinned for a targetedFailPoint').to.be.true; + + let address: string + if(session.transaction._pinnedServer.s.description) + address = session.transaction._pinnedServer.s.description.address + if(session.transaction._pinnedServer.s.serverDescription) + address = session.transaction._pinnedServer.s.serverDescription.address + + expect(address).to.exist; + + await entities.failPoints.enableFailPoint( + address, + operation.arguments.failPoint + ); +}); + +operations.set('delete', async ({ entities, operation }) => { + const bucket = entities.getEntity('bucket', operation.object); + return bucket.delete(operation.arguments.id); +}); + +operations.set('download', async ({ entities, operation }) => { + const bucket = entities.getEntity('bucket', operation.object); + + const stream = bucket.openDownloadStream(operation.arguments.id); + return new Promise((resolve, reject) => { + const chunks = []; + stream.on('data', chunk => chunks.push(...chunk)); + stream.on('error', reject); + stream.on('end', () => resolve(chunks)); + }); +}); + +operations.set('upload', async ({ entities, operation }) => { + const bucket = entities.getEntity('bucket', operation.object); + + const stream = bucket.openUploadStream(operation.arguments.filename, { + chunkSizeBytes: operation.arguments.chunkSizeBytes + }); + + return new Promise((resolve, reject) => { + stream.end(Buffer.from(operation.arguments.source.$$hexBytes, 'hex'), (error, file) => { + if (error) reject(error); + resolve((file as GridFSFile)._id as ObjectId); + }); + }); +}); + +operations.set('withTransaction', async ({ entities, operation, client }) => { + const session = entities.getEntity('session', operation.object); + + const options = { + readConcern: ReadConcern.fromOptions(operation.arguments), + writeConcern: WriteConcern.fromOptions(operation.arguments), + readPreference: ReadPreference.fromOptions(operation.arguments), + maxCommitTimeMS: operation.arguments.maxCommitTimeMS + }; + + return session.withTransaction(async () => { + for (const callbackOperation of operation.arguments.callback) { + await executeOperationAndCheck(callbackOperation, entities, client); + } + }, options); +}); + +operations.set('countDocuments', async ({ entities, operation }) => { + const collection = entities.getEntity('collection', operation.object); + return collection.countDocuments(operation.arguments.filter as Document); +}); + +operations.set('deleteMany', async ({ entities, operation }) => { + const collection = entities.getEntity('collection', operation.object); + return collection.deleteMany(operation.arguments.filter); +}); + +operations.set('distinct', async ({ entities, operation }) => { + const collection = entities.getEntity('collection', operation.object); + return collection.distinct( + operation.arguments.fieldName as string, + operation.arguments.filter as Document + ); +}); + +operations.set('estimatedDocumentCount', async ({ entities, operation }) => { + const collection = entities.getEntity('collection', operation.object); + return collection.estimatedDocumentCount(operation.arguments); +}); + +operations.set('findOneAndDelete', async ({ entities, operation }) => { + const collection = entities.getEntity('collection', operation.object); + return collection.findOneAndDelete(operation.arguments.filter); +}); + +operations.set('runCommand', async ({ entities, operation }: OperationFunctionParams) => { + const db = entities.getEntity('db', operation.object); + return db.command(operation.arguments.command); +}); + +operations.set('updateMany', async ({ entities, operation }) => { + const collection = entities.getEntity('collection', operation.object); + return collection.updateMany(operation.arguments.filter, operation.arguments.update); +}); + +operations.set('updateOne', async ({ entities, operation }) => { + const collection = entities.getEntity('collection', operation.object); + return collection.updateOne(operation.arguments.filter, operation.arguments.update); +}); + +export async function executeOperationAndCheck( + operation: OperationDescription, + entities: EntitiesMap, + client: MongoClient +): Promise { + const opFunc = operations.get(operation.name); + expect(opFunc, `Unknown operation: ${operation.name}`).to.exist; + + let result; + + try { + result = await opFunc({ entities, operation, client }); + } catch (error) { + if (operation.expectError) { + expectErrorCheck(error, operation.expectError, entities); + return; + } else { + throw error; + } + } + + // We check the positive outcome here so the try-catch above doesn't catch our chai assertions + + if (operation.expectError) { + expect.fail(`Operation ${operation.name} succeeded but was not supposed to`); + } + + if (operation.expectResult) { + resultCheck(result, operation.expectResult, entities); + } + + if (operation.saveResultAsEntity) { + entities.set(operation.saveResultAsEntity, result); + } +} diff --git a/test/functional/unified-spec-runner/runner.ts b/test/functional/unified-spec-runner/runner.ts new file mode 100644 index 0000000000..98c9c86627 --- /dev/null +++ b/test/functional/unified-spec-runner/runner.ts @@ -0,0 +1,198 @@ +import { expect } from 'chai'; +import ReadPreference from '../../../lib/core/topologies/read_preference'; +import * as uni from './schema'; +import { zip, topologySatisfies, patchVersion } from './unified-utils'; +import { CommandEvent, EntitiesMap } from './entities'; +import { MongoDBNamespace } from '../../../lib/utils'; +import { executeOperationAndCheck } from './operations'; +import { matchesEvents } from './match'; +import { satisfies as semverSatisfies } from 'semver'; +import ReadConcern from '../../../lib/read_concern'; + +interface MetaPluginInfo { + metadata: { + sessions: { + skipLeakTests: boolean; + } + } + test(done?: (result?: boolean | Error) => void): void +} + +declare module "mocha" { + export interface TestFunction { + (testName: string, metaPlugInfo: MetaPluginInfo) + } +} + +export function ns(ns: string) { + return MongoDBNamespace.fromString(ns); +} + +export type TestConfiguration = InstanceType< + typeof import('../../tools/runner/config') +>; +interface MongoDBMochaTestContext extends Mocha.Context { + configuration: TestConfiguration; +} + +export async function runUnifiedTest( + ctx: MongoDBMochaTestContext, + unifiedSuite: uni.UnifiedSuite, + test: uni.Test, + testsToSkip?: string[] +): Promise { + // Some basic expectations we can catch early + expect(test).to.exist; + expect(unifiedSuite).to.exist; + expect(ctx).to.exist; + expect(ctx.configuration).to.exist; + + const schemaVersion = patchVersion(unifiedSuite.schemaVersion); + expect(semverSatisfies(schemaVersion, uni.SupportedVersion)).to.be.true; + + // If test.skipReason is specified, the test runner MUST skip this + // test and MAY use the string value to log a message. + if (test.skipReason) { + console.warn(`Skipping test ${test.description}: ${test.skipReason}.`); + ctx.skip(); + } + + if (testsToSkip?.includes(test.description)) { + ctx.skip(); + } + + const utilClient = ctx.configuration.newClient({ useUnifiedTopology: true }); + + let entities; + try { + await utilClient.connect(); + + // Must fetch parameters before checking runOnRequirements + ctx.configuration.parameters = await utilClient.db().admin().command({ getParameter: '*' }); + + // If test.runOnRequirements is specified, the test runner MUST skip the test unless one or more + // runOnRequirement objects are satisfied. + const allRequirements = [ + ...(unifiedSuite.runOnRequirements ?? []), + ...(test.runOnRequirements ?? []) + ]; + + for (const requirement of allRequirements) { + const met = await topologySatisfies(ctx.configuration, requirement, utilClient); + if (!met) { + return ctx.skip(); + } + } + + // 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 (unifiedSuite.initialData) { + for (const collData of unifiedSuite.initialData) { + const db = utilClient.db(collData.databaseName); + const collection = db.collection(collData.collectionName, { + writeConcern: { w: 'majority' } + }); + const collectionList = await db + .listCollections({ name: collData.collectionName }) + .toArray(); + if (collectionList.length !== 0) { + expect(await collection.drop()).to.be.true; + } + } + + for (const collData of unifiedSuite.initialData) { + const db = utilClient.db(collData.databaseName); + const collection = db.collection(collData.collectionName, { + writeConcern: { w: 'majority' } + }); + + if (!collData.documents?.length) { + await db.createCollection(collData.collectionName, { + writeConcern: { w: 'majority' } + }); + continue; + } + + await collection.insertMany(collData.documents); + } + } + + entities = await EntitiesMap.createEntities(ctx.configuration, unifiedSuite.createEntities); + + // Workaround for SERVER-39704: + // test runners MUST execute a non-transactional distinct command on + // each mongos server before running any test that might execute distinct within a transaction. + // To ease the implementation, test runners MAY execute distinct before every test. + if ( + ctx.topologyType === uni.TopologyType.sharded || + ctx.topologyType === uni.TopologyType.shardedReplicaset + ) { + for (const [, collection] of entities.mapOf('collection')) { + await utilClient.db(ns(collection.namespace).db).command({ + distinct: collection.collectionName, + key: '_id' + }); + } + } + + for (const operation of test.operations) { + await executeOperationAndCheck(operation, entities, utilClient); + } + + const clientEvents = new Map(); + // If any event listeners were enabled on any client entities, + // the test runner MUST now disable those event listeners. + for (const [id, client] of entities.mapOf('client')) { + clientEvents.set(id, client.stopCapturingEvents()); + } + + if (test.expectEvents) { + for (const expectedEventList of test.expectEvents) { + const clientId = expectedEventList.client; + const actualEvents = clientEvents.get(clientId); + + expect(actualEvents, `No client entity found with id ${clientId}`).to.exist; + matchesEvents(expectedEventList.events, actualEvents, entities); + } + } + + if (test.outcome) { + for (const collectionData of test.outcome) { + const collection = utilClient + .db(collectionData.databaseName) + .collection(collectionData.collectionName); + const findOpts = { + readConcern: new ReadConcern('local'), + readPreference: ReadPreference.primary, + sort: { _id: 1 } + }; + const documents = await collection.find({}, findOpts).toArray(); + + expect(documents).to.have.lengthOf(collectionData.documents.length); + for (const [expected, actual] of zip(collectionData.documents, documents)) { + expect(actual).to.include(expected, 'Test outcome did not match expected'); + } + } + } + } finally { + await utilClient.close(); + await entities?.cleanup(); + } +} + +export function runUnifiedSuite(specTests: uni.UnifiedSuite[], testsToSkip?: string[]): void { + for (const unifiedSuite of specTests) { + context(String(unifiedSuite.description), function () { + for (const test of unifiedSuite.tests) { + it(String(test.description), { + metadata: { sessions: { skipLeakTests: true } }, + test: async function () { + await runUnifiedTest(this, unifiedSuite, test, testsToSkip); + } + }); + } + }); + } +} diff --git a/test/functional/unified-spec-runner/schema.ts b/test/functional/unified-spec-runner/schema.ts new file mode 100644 index 0000000000..0f85e491e5 --- /dev/null +++ b/test/functional/unified-spec-runner/schema.ts @@ -0,0 +1,168 @@ +export const SupportedVersion = '^1.0'; + +export interface Document { + [key: string]: any; +} + +export type TagSet = { [key: string]: string }; + +export type W = number | 'majority'; + +export const ReadPreferenceMode = { + primary: 'primary', + primaryPreferred: 'primaryPreferred', + secondary: 'secondary', + secondaryPreferred: 'secondaryPreferred', + nearest: 'nearest' +} as const; + +export type ReadPreferenceModeId = keyof typeof ReadPreferenceMode; + +export const ReadConcernLevel = { + local: 'local', + majority: 'majority', + linearizable: 'linearizable', + available: 'available', + snapshot: 'snapshot' +} as const; + +export type ReadConcernLevelId = keyof typeof ReadConcernLevel; + +export interface OperationDescription { + name: string; + object: string; + arguments: Document; + expectError?: ExpectedError; + expectResult?: unknown; + saveResultAsEntity?: string; +} +export interface UnifiedSuite { + description: string; + schemaVersion: string; + runOnRequirements?: [RunOnRequirement, ...RunOnRequirement[]]; + createEntities?: [EntityDescription, ...EntityDescription[]]; + initialData?: [CollectionData, ...CollectionData[]]; + tests: [Test, ...Test[]]; + _yamlAnchors?: Document; +} +export const TopologyType = { + single: 'single', + replicaset: 'replicaset', + sharded: 'sharded', + shardedReplicaset: 'sharded-replicaset' +} as const; +export type TopologyId = typeof TopologyType[keyof typeof TopologyType]; +export interface RunOnRequirement { + maxServerVersion?: string; + minServerVersion?: string; + topologies?: TopologyId[]; + serverParameters?: Document; +} +export type ObservableEventId = + | 'commandStartedEvent' + | 'commandSucceededEvent' + | 'commandFailedEvent'; + +export interface ClientEntity { + id: string; + uriOptions?: Document; + useMultipleMongoses?: boolean; + observeEvents?: ObservableEventId[]; + ignoreCommandMonitoringEvents?: string[]; + serverApi?: ServerApi; +} +export interface DatabaseEntity { + id: string; + client: string; + databaseName: string; + databaseOptions?: CollectionOrDatabaseOptions; +} +export interface CollectionEntity { + id: string; + database: string; + collectionName: string; + collectionOptions?: CollectionOrDatabaseOptions; +} +export interface SessionEntity { + id: string; + client: string; + sessionOptions?: Document; +} +export interface BucketEntity { + id: string; + database: string; + bucketOptions?: Document; +} +export interface StreamEntity { + id: string; + hexBytes: string; +} +export type EntityDescription = + | { client: ClientEntity } + | { database: DatabaseEntity } + | { collection: CollectionEntity } + | { bucket: BucketEntity } + | { stream: StreamEntity } + | { session: SessionEntity }; +export interface ServerApi { + version: string; + strict?: boolean; + deprecationErrors?: boolean; +} +export interface CollectionOrDatabaseOptions { + readConcern?: { + level: ReadConcernLevelId; + }; + readPreference?: { + mode: ReadPreferenceModeId; + maxStalenessSeconds: number; + tags: TagSet[]; + hedge: { enabled: boolean }; + }; + writeConcern?: { + w: W; + wtimeoutMS: number; + journal: boolean; + }; +} +export interface CollectionData { + collectionName: string; + databaseName: string; + documents: Document[]; +} +export interface Test { + description: string; + runOnRequirements?: [RunOnRequirement, ...RunOnRequirement[]]; + skipReason?: string; + operations: OperationDescription[]; + expectEvents?: ExpectedEventsForClient[]; + outcome?: [CollectionData, ...CollectionData[]]; +} +export interface ExpectedEventsForClient { + client: string; + events: ExpectedEvent[]; +} +export interface ExpectedEvent { + commandStartedEvent?: { + command?: Document; + commandName?: string; + databaseName?: string; + }; + commandSucceededEvent?: { + reply?: Document; + commandName?: string; + }; + commandFailedEvent?: { + commandName?: string; + }; +} +export interface ExpectedError { + isError?: true; + isClientError?: boolean; + errorContains?: string; + errorCode?: number; + errorCodeName?: string; + errorLabelsContain?: string[]; + errorLabelsOmit?: string[]; + expectResult?: unknown; +} diff --git a/test/functional/unified-spec-runner/tsconfig.unified.json b/test/functional/unified-spec-runner/tsconfig.unified.json new file mode 100644 index 0000000000..25d99c8af6 --- /dev/null +++ b/test/functional/unified-spec-runner/tsconfig.unified.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "CommonJS", + "allowJs": false, + "importHelpers": true, + "esModuleInterop": true, + "moduleResolution": "node", + "strict": false, + "inlineSourceMap": true, + "downlevelIteration": true, + }, + "include": ["./*.ts"] +} diff --git a/test/functional/unified-spec-runner/unified-runner.test.js b/test/functional/unified-spec-runner/unified-runner.test.js new file mode 100644 index 0000000000..c8d3736670 --- /dev/null +++ b/test/functional/unified-spec-runner/unified-runner.test.js @@ -0,0 +1,33 @@ +'use strict'; +const loadSpecTests = require('../../spec/index').loadSpecTests; + +let runUnifiedSuite; +try { + runUnifiedSuite = require('./runner').runUnifiedSuite; +} catch (error) { + console.error('Unable to run unified spec tests, attempting to compile'); + const cp = require('child_process'); + try { + cp.execSync('npm run build:unified'); + console.error('Compiled! Please re-run!'); + process.exit(0); + } catch (error) { + console.error('Unable to compile! Run `npm run build:unified to see errors`'); + console.error(error); + process.exit(1); + } +} + +const SKIPPED_TESTS = [ + // commitTransaction retry seems to be swallowed by mongos in this case + 'unpin after transient error within a transaction and commit', + // These two tests need to run against multiple mongoses + 'Dirty explicit session is discarded', + // Will be implemented as part of NODE-2034 + 'Client side error in command starting transaction' +]; + +describe('Unified test format runner', function unifiedTestRunner() { + // Valid tests that should pass + runUnifiedSuite(loadSpecTests('unified-test-format/valid-pass'), SKIPPED_TESTS); +}); diff --git a/test/functional/unified-spec-runner/unified-utils.ts b/test/functional/unified-spec-runner/unified-utils.ts new file mode 100644 index 0000000000..843a97915f --- /dev/null +++ b/test/functional/unified-spec-runner/unified-utils.ts @@ -0,0 +1,90 @@ +import { expect } from 'chai'; +import type { CollectionOrDatabaseOptions, RunOnRequirement, Document } from './schema'; +import { gte as semverGte, lte as semverLte } from 'semver'; +import { MongoClient } from '../../../index'; +import { isDeepStrictEqual } from 'util'; +import { TestConfiguration } from './runner'; + +export async function topologySatisfies( + config: TestConfiguration, + r: RunOnRequirement, + utilClient: MongoClient +): Promise { + let ok = true; + if (r.minServerVersion) { + const minVersion = patchVersion(r.minServerVersion); + ok &&= semverGte(config.version, minVersion); + } + if (r.maxServerVersion) { + const maxVersion = patchVersion(r.maxServerVersion); + ok &&= semverLte(config.version, maxVersion); + } + + if (r.topologies) { + const topologyType = { + Single: 'single', + ReplicaSetNoPrimary: 'replicaset', + ReplicaSetWithPrimary: 'replicaset', + Sharded: 'sharded' + }[config.topologyType]; + + if (r.topologies.includes('sharded-replicaset') && topologyType === 'sharded') { + const shards = await utilClient.db('config').collection('shards').find({}).toArray(); + ok &&= shards.length > 0 && shards.every(shard => shard.host.split(',').length > 1); + } else { + if (!topologyType) throw new Error(`Topology undiscovered: ${config.topologyType}`); + ok &&= r.topologies.includes(topologyType); + } + } + + if (r.serverParameters) { + if (!config.parameters) throw new Error('Configuration does not have server parameters'); + for (const [name, value] of Object.entries(r.serverParameters)) { + if (name in config.parameters) { + ok &&= isDeepStrictEqual(config.parameters[name], value); + } + } + } + + return ok; +} + +/** Turns two lists into a joined list of tuples. Uses longer array length */ +export function* zip( + iter1: T[], + iter2: U[] +): Generator<[T | undefined, U | undefined], void> { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const longerArrayLength = Math.max(iter1.length, iter2.length); + for (let index = 0; index < longerArrayLength; index++) { + yield [iter1[index], iter2[index]]; + } +} + +/** Correct schema version to be semver compliant */ +export function patchVersion(version: string): string { + expect(version).to.be.a('string'); + const [major, minor, patch] = version.split('.'); + return `${major}.${minor ?? 0}.${patch ?? 0}`; +} + +type DbOptions = Document; +type CollectionOptions = Document; + +export function patchDbOptions(options: CollectionOrDatabaseOptions): DbOptions { + // TODO + return options as DbOptions; +} + +export function patchCollectionOptions(options: CollectionOrDatabaseOptions): CollectionOptions { + // TODO + return options as CollectionOptions; +} + +export function translateOptions(options: Document): Document { + const translatedOptions = { ...options }; + if (options.returnDocument) { + translatedOptions.returnDocument = options.returnDocument.toLowerCase(); + } + return translatedOptions as Document; +} diff --git a/test/spec/unified-test-format/Makefile b/test/spec/unified-test-format/Makefile new file mode 100644 index 0000000000..a177f9364c --- /dev/null +++ b/test/spec/unified-test-format/Makefile @@ -0,0 +1,24 @@ +SCHEMA=../schema-1.1.json + +.PHONY: all invalid valid-fail valid-pass versioned-api HAS_AJV + +all: invalid valid-fail valid-pass versioned-api + +invalid: HAS_AJV + @# Redirect stdout to hide expected validation errors + @ajv test -s $(SCHEMA) -d "invalid/*.yml" --invalid > /dev/null && echo "invalid/*.yml passed test" + +valid-fail: HAS_AJV + @ajv test -s $(SCHEMA) -d "valid-fail/*.yml" --valid + +valid-pass: HAS_AJV + @ajv test -s $(SCHEMA) -d "valid-pass/*.yml" --valid + +versioned-api: HAS_AJV + @ajv test -s $(SCHEMA) -d "../../versioned-api/tests/*.yml" --valid + +HAS_AJV: + @if ! command -v ajv > /dev/null; then \ + echo 'Error: need "npm install -g ajv-cli"' 1>&2; \ + exit 1; \ + fi diff --git a/test/spec/unified-test-format/invalid/collectionData-additionalProperties.json b/test/spec/unified-test-format/invalid/collectionData-additionalProperties.json new file mode 100644 index 0000000000..2d85093109 --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionData-additionalProperties.json @@ -0,0 +1,40 @@ +{ + "description": "collectionData-additionalProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "foo", + "foo": 0 + } + } + ], + "initialData": [ + { + "collectionName": "foo", + "databaseName": "foo", + "documents": [], + "foo": 0 + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/collectionData-additionalProperties.yml b/test/spec/unified-test-format/invalid/collectionData-additionalProperties.yml new file mode 100644 index 0000000000..6a2256a639 --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionData-additionalProperties.yml @@ -0,0 +1,26 @@ +description: "collectionData-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" + foo: 0 + +initialData: + - collectionName: *collection0Name + databaseName: *database0Name + documents: [] + foo: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/collectionData-collectionName-required.json b/test/spec/unified-test-format/invalid/collectionData-collectionName-required.json new file mode 100644 index 0000000000..040dd86a1c --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionData-collectionName-required.json @@ -0,0 +1,38 @@ +{ + "description": "collectionData-collectionName-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "foo", + "foo": 0 + } + } + ], + "initialData": [ + { + "databaseName": "foo", + "documents": [] + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/collectionData-collectionName-required.yml b/test/spec/unified-test-format/invalid/collectionData-collectionName-required.yml new file mode 100644 index 0000000000..2f20805581 --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionData-collectionName-required.yml @@ -0,0 +1,24 @@ +description: "collectionData-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" + foo: 0 + +initialData: + - databaseName: *database0Name + documents: [] + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/collectionData-collectionName-type.json b/test/spec/unified-test-format/invalid/collectionData-collectionName-type.json new file mode 100644 index 0000000000..676d822e5e --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionData-collectionName-type.json @@ -0,0 +1,39 @@ +{ + "description": "collectionData-collectionName-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "foo", + "foo": 0 + } + } + ], + "initialData": [ + { + "collectionName": 0, + "databaseName": "foo", + "documents": [] + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/collectionData-collectionName-type.yml b/test/spec/unified-test-format/invalid/collectionData-collectionName-type.yml new file mode 100644 index 0000000000..a9da0e0129 --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionData-collectionName-type.yml @@ -0,0 +1,25 @@ +description: "collectionData-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" + foo: 0 + +initialData: + - collectionName: 0 + databaseName: *database0Name + documents: [] + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/collectionData-databaseName-required.json b/test/spec/unified-test-format/invalid/collectionData-databaseName-required.json new file mode 100644 index 0000000000..7548f9d5be --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionData-databaseName-required.json @@ -0,0 +1,38 @@ +{ + "description": "collectionData-databaseName-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "foo", + "foo": 0 + } + } + ], + "initialData": [ + { + "collectionName": "foo", + "documents": [] + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/collectionData-databaseName-required.yml b/test/spec/unified-test-format/invalid/collectionData-databaseName-required.yml new file mode 100644 index 0000000000..d8d6e4d571 --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionData-databaseName-required.yml @@ -0,0 +1,24 @@ +description: "collectionData-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" + foo: 0 + +initialData: + - collectionName: *collection0Name + documents: [] + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/collectionData-databaseName-type.json b/test/spec/unified-test-format/invalid/collectionData-databaseName-type.json new file mode 100644 index 0000000000..ef719bbf6a --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionData-databaseName-type.json @@ -0,0 +1,39 @@ +{ + "description": "collectionData-databaseName-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "foo", + "foo": 0 + } + } + ], + "initialData": [ + { + "collectionName": "foo", + "databaseName": 0, + "documents": [] + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/collectionData-databaseName-type.yml b/test/spec/unified-test-format/invalid/collectionData-databaseName-type.yml new file mode 100644 index 0000000000..27dfaafee1 --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionData-databaseName-type.yml @@ -0,0 +1,25 @@ +description: "collectionData-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" + foo: 0 + +initialData: + - collectionName: *collection0Name + databaseName: 0 + documents: [] + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/collectionData-documents-items.json b/test/spec/unified-test-format/invalid/collectionData-documents-items.json new file mode 100644 index 0000000000..2916718d50 --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionData-documents-items.json @@ -0,0 +1,41 @@ +{ + "description": "collectionData-documents-items", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "foo", + "foo": 0 + } + } + ], + "initialData": [ + { + "collectionName": "foo", + "databaseName": "foo", + "documents": [ + 0 + ] + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/collectionData-documents-items.yml b/test/spec/unified-test-format/invalid/collectionData-documents-items.yml new file mode 100644 index 0000000000..6e860e896f --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionData-documents-items.yml @@ -0,0 +1,25 @@ +description: "collectionData-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" + foo: 0 + +initialData: + - collectionName: *collection0Name + databaseName: *database0Name + documents: [0] + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/collectionData-documents-required.json b/test/spec/unified-test-format/invalid/collectionData-documents-required.json new file mode 100644 index 0000000000..7b8a7ead2a --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionData-documents-required.json @@ -0,0 +1,38 @@ +{ + "description": "collectionData-documents-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "foo", + "foo": 0 + } + } + ], + "initialData": [ + { + "collectionName": "foo", + "databaseName": "foo" + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/collectionData-documents-required.yml b/test/spec/unified-test-format/invalid/collectionData-documents-required.yml new file mode 100644 index 0000000000..0452842bc7 --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionData-documents-required.yml @@ -0,0 +1,24 @@ +description: "collectionData-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" + foo: 0 + +initialData: + - collectionName: *collection0Name + databaseName: *database0Name + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/collectionData-documents-type.json b/test/spec/unified-test-format/invalid/collectionData-documents-type.json new file mode 100644 index 0000000000..953cabae6e --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionData-documents-type.json @@ -0,0 +1,39 @@ +{ + "description": "collectionData-documents-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "foo", + "foo": 0 + } + } + ], + "initialData": [ + { + "collectionName": "foo", + "databaseName": "foo", + "documents": 0 + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/collectionData-documents-type.yml b/test/spec/unified-test-format/invalid/collectionData-documents-type.yml new file mode 100644 index 0000000000..db6d8b417a --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionData-documents-type.yml @@ -0,0 +1,25 @@ +description: "collectionData-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" + foo: 0 + +initialData: + - collectionName: *collection0Name + databaseName: *database0Name + documents: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-additionalProperties.json b/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-additionalProperties.json new file mode 100644 index 0000000000..beef260eed --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-additionalProperties.json @@ -0,0 +1,27 @@ +{ + "description": "collectionOrDatabaseOptions-additionalProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo", + "databaseOptions": { + "foo": 0 + } + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-additionalProperties.yml b/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-additionalProperties.yml new file mode 100644 index 0000000000..e5b92562a2 --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-additionalProperties.yml @@ -0,0 +1,17 @@ +description: "collectionOrDatabaseOptions-additionalProperties" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: "foo" + databaseOptions: + foo: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-readConcern-type.json b/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-readConcern-type.json new file mode 100644 index 0000000000..1b9f4bcbea --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-readConcern-type.json @@ -0,0 +1,27 @@ +{ + "description": "collectionOrDatabaseOptions-readConcern-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo", + "databaseOptions": { + "readConcern": 0 + } + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-readConcern-type.yml b/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-readConcern-type.yml new file mode 100644 index 0000000000..671a5b0241 --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-readConcern-type.yml @@ -0,0 +1,17 @@ +description: "collectionOrDatabaseOptions-readConcern-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: "foo" + databaseOptions: + readConcern: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-readPreference-type.json b/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-readPreference-type.json new file mode 100644 index 0000000000..988b594d13 --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-readPreference-type.json @@ -0,0 +1,27 @@ +{ + "description": "collectionOrDatabaseOptions-readPreference-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo", + "databaseOptions": { + "readPreference": 0 + } + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-readPreference-type.yml b/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-readPreference-type.yml new file mode 100644 index 0000000000..84b328fc46 --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-readPreference-type.yml @@ -0,0 +1,17 @@ +description: "collectionOrDatabaseOptions-readPreference-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: "foo" + databaseOptions: + readPreference: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-writeConcern-type.json b/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-writeConcern-type.json new file mode 100644 index 0000000000..bd2157c5cb --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-writeConcern-type.json @@ -0,0 +1,27 @@ +{ + "description": "collectionOrDatabaseOptions-writeConcern-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo", + "databaseOptions": { + "writeConcern": 0 + } + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-writeConcern-type.yml b/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-writeConcern-type.yml new file mode 100644 index 0000000000..5dc3f8b63c --- /dev/null +++ b/test/spec/unified-test-format/invalid/collectionOrDatabaseOptions-writeConcern-type.yml @@ -0,0 +1,17 @@ +description: "collectionOrDatabaseOptions-writeConcern-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: "foo" + databaseOptions: + writeConcern: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/createEntities-items.json b/test/spec/unified-test-format/invalid/createEntities-items.json new file mode 100644 index 0000000000..8e9d6ff702 --- /dev/null +++ b/test/spec/unified-test-format/invalid/createEntities-items.json @@ -0,0 +1,13 @@ +{ + "description": "createEntities-items", + "schemaVersion": "1.0", + "createEntities": [ + 0 + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/createEntities-items.yml b/test/spec/unified-test-format/invalid/createEntities-items.yml new file mode 100644 index 0000000000..f0d00e33b2 --- /dev/null +++ b/test/spec/unified-test-format/invalid/createEntities-items.yml @@ -0,0 +1,9 @@ +description: "createEntities-items" + +schemaVersion: "1.0" + +createEntities: [0] + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/createEntities-minItems.json b/test/spec/unified-test-format/invalid/createEntities-minItems.json new file mode 100644 index 0000000000..3654923d28 --- /dev/null +++ b/test/spec/unified-test-format/invalid/createEntities-minItems.json @@ -0,0 +1,11 @@ +{ + "description": "createEntities-minItems", + "schemaVersion": "1.0", + "createEntities": [], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/createEntities-minItems.yml b/test/spec/unified-test-format/invalid/createEntities-minItems.yml new file mode 100644 index 0000000000..11641ea7d8 --- /dev/null +++ b/test/spec/unified-test-format/invalid/createEntities-minItems.yml @@ -0,0 +1,9 @@ +description: "createEntities-minItems" + +schemaVersion: "1.0" + +createEntities: [] + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/createEntities-type.json b/test/spec/unified-test-format/invalid/createEntities-type.json new file mode 100644 index 0000000000..ce3c382c93 --- /dev/null +++ b/test/spec/unified-test-format/invalid/createEntities-type.json @@ -0,0 +1,11 @@ +{ + "description": "createEntities-type", + "schemaVersion": "1.0", + "createEntities": 0, + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/createEntities-type.yml b/test/spec/unified-test-format/invalid/createEntities-type.yml new file mode 100644 index 0000000000..c181f31922 --- /dev/null +++ b/test/spec/unified-test-format/invalid/createEntities-type.yml @@ -0,0 +1,9 @@ +description: "createEntities-type" + +schemaVersion: "1.0" + +createEntities: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/description-required.json b/test/spec/unified-test-format/invalid/description-required.json new file mode 100644 index 0000000000..e4e0d0efdf --- /dev/null +++ b/test/spec/unified-test-format/invalid/description-required.json @@ -0,0 +1,9 @@ +{ + "schemaVersion": "1.0", + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/description-required.yml b/test/spec/unified-test-format/invalid/description-required.yml new file mode 100644 index 0000000000..5bc6ecff5e --- /dev/null +++ b/test/spec/unified-test-format/invalid/description-required.yml @@ -0,0 +1,7 @@ +# description: "description-required" + +schemaVersion: "1.0" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-additionalProperties.json b/test/spec/unified-test-format/invalid/entity-additionalProperties.json new file mode 100644 index 0000000000..38b8898787 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-additionalProperties.json @@ -0,0 +1,15 @@ +{ + "description": "entity-additionalProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "foo": 0 + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-additionalProperties.yml b/test/spec/unified-test-format/invalid/entity-additionalProperties.yml new file mode 100644 index 0000000000..4978518c5e --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-additionalProperties.yml @@ -0,0 +1,10 @@ +description: "entity-additionalProperties" + +schemaVersion: "1.0" + +createEntities: + - foo: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-bucket-additionalProperties.json b/test/spec/unified-test-format/invalid/entity-bucket-additionalProperties.json new file mode 100644 index 0000000000..46f9b4038e --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-bucket-additionalProperties.json @@ -0,0 +1,31 @@ +{ + "description": "entity-bucket-additionalProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "bucket": { + "id": "bucket0", + "database": "database0", + "foo": 0 + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-bucket-additionalProperties.yml b/test/spec/unified-test-format/invalid/entity-bucket-additionalProperties.yml new file mode 100644 index 0000000000..e864aab955 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-bucket-additionalProperties.yml @@ -0,0 +1,19 @@ +description: "entity-bucket-additionalProperties" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: "foo" + - bucket: + id: &bucket0 "bucket0" + database: *database0 + foo: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-bucket-bucketOptions-type.json b/test/spec/unified-test-format/invalid/entity-bucket-bucketOptions-type.json new file mode 100644 index 0000000000..c3d7423e65 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-bucket-bucketOptions-type.json @@ -0,0 +1,31 @@ +{ + "description": "entity-bucket-bucketOptions-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "bucket": { + "id": "bucket0", + "database": "database0", + "bucketOptions": 0 + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-bucket-bucketOptions-type.yml b/test/spec/unified-test-format/invalid/entity-bucket-bucketOptions-type.yml new file mode 100644 index 0000000000..2d80f5ca3f --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-bucket-bucketOptions-type.yml @@ -0,0 +1,19 @@ +description: "entity-bucket-bucketOptions-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: "foo" + - bucket: + id: &bucket0 "bucket0" + database: *database0 + bucketOptions: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-bucket-database-required.json b/test/spec/unified-test-format/invalid/entity-bucket-database-required.json new file mode 100644 index 0000000000..1fde5a96c9 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-bucket-database-required.json @@ -0,0 +1,29 @@ +{ + "description": "entity-bucket-database-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "bucket": { + "id": "bucket0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-bucket-database-required.yml b/test/spec/unified-test-format/invalid/entity-bucket-database-required.yml new file mode 100644 index 0000000000..df7f8d9457 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-bucket-database-required.yml @@ -0,0 +1,17 @@ +description: "entity-bucket-database-required" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: "foo" + - bucket: + id: &bucket0 "bucket0" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-bucket-database-type.json b/test/spec/unified-test-format/invalid/entity-bucket-database-type.json new file mode 100644 index 0000000000..798d273fb0 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-bucket-database-type.json @@ -0,0 +1,30 @@ +{ + "description": "entity-bucket-database-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "bucket": { + "id": "bucket0", + "database": 0 + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-bucket-database-type.yml b/test/spec/unified-test-format/invalid/entity-bucket-database-type.yml new file mode 100644 index 0000000000..e735d16e16 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-bucket-database-type.yml @@ -0,0 +1,18 @@ +description: "entity-bucket-database-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: "foo" + - bucket: + id: &bucket0 "bucket0" + database: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-bucket-id-required.json b/test/spec/unified-test-format/invalid/entity-bucket-id-required.json new file mode 100644 index 0000000000..c547d8ea3c --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-bucket-id-required.json @@ -0,0 +1,29 @@ +{ + "description": "entity-bucket-id-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "bucket": { + "database": "database0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-bucket-id-required.yml b/test/spec/unified-test-format/invalid/entity-bucket-id-required.yml new file mode 100644 index 0000000000..b47435870f --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-bucket-id-required.yml @@ -0,0 +1,17 @@ +description: "entity-bucket-id-required" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: "foo" + - bucket: + database: *database0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-bucket-id-type.json b/test/spec/unified-test-format/invalid/entity-bucket-id-type.json new file mode 100644 index 0000000000..f4e10ee630 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-bucket-id-type.json @@ -0,0 +1,30 @@ +{ + "description": "entity-bucket-id-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "bucket": { + "id": 0, + "database": "database0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-bucket-id-type.yml b/test/spec/unified-test-format/invalid/entity-bucket-id-type.yml new file mode 100644 index 0000000000..33522fea32 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-bucket-id-type.yml @@ -0,0 +1,18 @@ +description: "entity-bucket-id-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: "foo" + - bucket: + id: 0 + database: *database0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-client-additionalProperties.json b/test/spec/unified-test-format/invalid/entity-client-additionalProperties.json new file mode 100644 index 0000000000..467e1d6ae1 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-additionalProperties.json @@ -0,0 +1,18 @@ +{ + "description": "entity-client-additionalProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "foo": 0 + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-client-additionalProperties.yml b/test/spec/unified-test-format/invalid/entity-client-additionalProperties.yml new file mode 100644 index 0000000000..b93e51d08a --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-additionalProperties.yml @@ -0,0 +1,12 @@ +description: "entity-client-additionalProperties" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + foo: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-client-id-required.json b/test/spec/unified-test-format/invalid/entity-client-id-required.json new file mode 100644 index 0000000000..4be2fbf8e8 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-id-required.json @@ -0,0 +1,15 @@ +{ + "description": "entity-client-id-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": {} + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-client-id-required.yml b/test/spec/unified-test-format/invalid/entity-client-id-required.yml new file mode 100644 index 0000000000..794a025f23 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-id-required.yml @@ -0,0 +1,10 @@ +description: "entity-client-id-required" + +schemaVersion: "1.0" + +createEntities: + - client: {} + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-client-id-type.json b/test/spec/unified-test-format/invalid/entity-client-id-type.json new file mode 100644 index 0000000000..cdc7cbc0e7 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-id-type.json @@ -0,0 +1,17 @@ +{ + "description": "entity-client-id-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": 0 + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-client-id-type.yml b/test/spec/unified-test-format/invalid/entity-client-id-type.yml new file mode 100644 index 0000000000..fc872b2b22 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-id-type.yml @@ -0,0 +1,11 @@ +description: "entity-client-id-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-items.json b/test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-items.json new file mode 100644 index 0000000000..1252ac82d7 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-items.json @@ -0,0 +1,20 @@ +{ + "description": "entity-client-ignoreCommandMonitoringEvents-items", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "ignoreCommandMonitoringEvents": [ + 0 + ] + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-items.yml b/test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-items.yml new file mode 100644 index 0000000000..8f63e4d7e6 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-items.yml @@ -0,0 +1,12 @@ +description: "entity-client-ignoreCommandMonitoringEvents-items" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + ignoreCommandMonitoringEvents: [0] + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-minItems.json b/test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-minItems.json new file mode 100644 index 0000000000..e78068a442 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-minItems.json @@ -0,0 +1,18 @@ +{ + "description": "entity-client-ignoreCommandMonitoringEvents-minItems", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "ignoreCommandMonitoringEvents": [] + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-minItems.yml b/test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-minItems.yml new file mode 100644 index 0000000000..128282c6f3 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-minItems.yml @@ -0,0 +1,12 @@ +description: "entity-client-ignoreCommandMonitoringEvents-minItems" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + ignoreCommandMonitoringEvents: [] + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-type.json b/test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-type.json new file mode 100644 index 0000000000..5ac2b340c5 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-type.json @@ -0,0 +1,18 @@ +{ + "description": "entity-client-ignoreCommandMonitoringEvents-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "ignoreCommandMonitoringEvents": 0 + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-type.yml b/test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-type.yml new file mode 100644 index 0000000000..9fa8bfa323 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-ignoreCommandMonitoringEvents-type.yml @@ -0,0 +1,12 @@ +description: "entity-client-ignoreCommandMonitoringEvents-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + ignoreCommandMonitoringEvents: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-client-observeEvents-enum.json b/test/spec/unified-test-format/invalid/entity-client-observeEvents-enum.json new file mode 100644 index 0000000000..c39c94eee2 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-observeEvents-enum.json @@ -0,0 +1,20 @@ +{ + "description": "entity-client-observeEvents-enum", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "foo" + ] + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-client-observeEvents-enum.yml b/test/spec/unified-test-format/invalid/entity-client-observeEvents-enum.yml new file mode 100644 index 0000000000..5deaeb6212 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-observeEvents-enum.yml @@ -0,0 +1,12 @@ +description: "entity-client-observeEvents-enum" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + observeEvents: ["foo"] + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-client-observeEvents-items.json b/test/spec/unified-test-format/invalid/entity-client-observeEvents-items.json new file mode 100644 index 0000000000..3aee11e3d5 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-observeEvents-items.json @@ -0,0 +1,20 @@ +{ + "description": "entity-client-observeEvents-items", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + 0 + ] + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-client-observeEvents-items.yml b/test/spec/unified-test-format/invalid/entity-client-observeEvents-items.yml new file mode 100644 index 0000000000..ad73f22699 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-observeEvents-items.yml @@ -0,0 +1,12 @@ +description: "entity-client-observeEvents-items" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + observeEvents: [0] + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-client-observeEvents-minItems.json b/test/spec/unified-test-format/invalid/entity-client-observeEvents-minItems.json new file mode 100644 index 0000000000..e70d90c0a7 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-observeEvents-minItems.json @@ -0,0 +1,18 @@ +{ + "description": "entity-client-observeEvents-minItems", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [] + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-client-observeEvents-minItems.yml b/test/spec/unified-test-format/invalid/entity-client-observeEvents-minItems.yml new file mode 100644 index 0000000000..bd16e78c94 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-observeEvents-minItems.yml @@ -0,0 +1,12 @@ +description: "entity-client-observeEvents-minItems" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + observeEvents: [] + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-client-observeEvents-type.json b/test/spec/unified-test-format/invalid/entity-client-observeEvents-type.json new file mode 100644 index 0000000000..c144e32369 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-observeEvents-type.json @@ -0,0 +1,18 @@ +{ + "description": "entity-client-observeEvents-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": 0 + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-client-observeEvents-type.yml b/test/spec/unified-test-format/invalid/entity-client-observeEvents-type.yml new file mode 100644 index 0000000000..b75e97faea --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-observeEvents-type.yml @@ -0,0 +1,12 @@ +description: "entity-client-observeEvents-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + observeEvents: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-client-serverApi-deprecationErrors-type.json b/test/spec/unified-test-format/invalid/entity-client-serverApi-deprecationErrors-type.json new file mode 100644 index 0000000000..b688dae631 --- /dev/null +++ b/test/spec/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/spec/unified-test-format/invalid/entity-client-serverApi-deprecationErrors-type.yml b/test/spec/unified-test-format/invalid/entity-client-serverApi-deprecationErrors-type.yml new file mode 100644 index 0000000000..9e17cca0b7 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-serverApi-deprecationErrors-type.yml @@ -0,0 +1,14 @@ +description: "entity-client-serverApi-version-type" + +schemaVersion: "1.1" + +createEntities: + - client: + id: &client0 "client0" + serverApi: + version: "1" + deprecationErrors: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-client-serverApi-strict-type.json b/test/spec/unified-test-format/invalid/entity-client-serverApi-strict-type.json new file mode 100644 index 0000000000..0b2fdc4849 --- /dev/null +++ b/test/spec/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/spec/unified-test-format/invalid/entity-client-serverApi-strict-type.yml b/test/spec/unified-test-format/invalid/entity-client-serverApi-strict-type.yml new file mode 100644 index 0000000000..7aba8a30ea --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-serverApi-strict-type.yml @@ -0,0 +1,14 @@ +description: "entity-client-serverApi-version-type" + +schemaVersion: "1.1" + +createEntities: + - client: + id: &client0 "client0" + serverApi: + version: "1" + strict: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-client-serverApi-type.json b/test/spec/unified-test-format/invalid/entity-client-serverApi-type.json new file mode 100644 index 0000000000..20c9d1dce3 --- /dev/null +++ b/test/spec/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/spec/unified-test-format/invalid/entity-client-serverApi-type.yml b/test/spec/unified-test-format/invalid/entity-client-serverApi-type.yml new file mode 100644 index 0000000000..1fc641f9f5 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-serverApi-type.yml @@ -0,0 +1,12 @@ +description: "entity-client-serverApi-type" + +schemaVersion: "1.1" + +createEntities: + - client: + id: &client0 "client0" + serverApi: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-client-serverApi-version-required.json b/test/spec/unified-test-format/invalid/entity-client-serverApi-version-required.json new file mode 100644 index 0000000000..8bef92b06f --- /dev/null +++ b/test/spec/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/spec/unified-test-format/invalid/entity-client-serverApi-version-required.yml b/test/spec/unified-test-format/invalid/entity-client-serverApi-version-required.yml new file mode 100644 index 0000000000..218c7f76b0 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-serverApi-version-required.yml @@ -0,0 +1,12 @@ +description: "entity-client-serverApi-version-required" + +schemaVersion: "1.1" + +createEntities: + - client: + id: &client0 "client0" + serverApi: {} + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-client-serverApi-version-type.json b/test/spec/unified-test-format/invalid/entity-client-serverApi-version-type.json new file mode 100644 index 0000000000..2c36ff57ed --- /dev/null +++ b/test/spec/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/spec/unified-test-format/invalid/entity-client-serverApi-version-type.yml b/test/spec/unified-test-format/invalid/entity-client-serverApi-version-type.yml new file mode 100644 index 0000000000..27530b8517 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-serverApi-version-type.yml @@ -0,0 +1,13 @@ +description: "entity-client-serverApi-version-type" + +schemaVersion: "1.1" + +createEntities: + - client: + id: &client0 "client0" + serverApi: + version: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-client-uriOptions-type.json b/test/spec/unified-test-format/invalid/entity-client-uriOptions-type.json new file mode 100644 index 0000000000..4252480e98 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-uriOptions-type.json @@ -0,0 +1,18 @@ +{ + "description": "entity-client-uriOptions-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "uriOptions": 0 + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-client-uriOptions-type.yml b/test/spec/unified-test-format/invalid/entity-client-uriOptions-type.yml new file mode 100644 index 0000000000..09bc9f25d3 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-uriOptions-type.yml @@ -0,0 +1,12 @@ +description: "entity-client-uriOptions-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + uriOptions: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-client-useMultipleMongoses-type.json b/test/spec/unified-test-format/invalid/entity-client-useMultipleMongoses-type.json new file mode 100644 index 0000000000..e429cd71f8 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-useMultipleMongoses-type.json @@ -0,0 +1,18 @@ +{ + "description": "entity-client-useMultipleMongoses-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": 0 + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-client-useMultipleMongoses-type.yml b/test/spec/unified-test-format/invalid/entity-client-useMultipleMongoses-type.yml new file mode 100644 index 0000000000..ef5e4baae9 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-client-useMultipleMongoses-type.yml @@ -0,0 +1,12 @@ +description: "entity-client-useMultipleMongoses-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + useMultipleMongoses: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-collection-additionalProperties.json b/test/spec/unified-test-format/invalid/entity-collection-additionalProperties.json new file mode 100644 index 0000000000..90ee2b1ca0 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-collection-additionalProperties.json @@ -0,0 +1,32 @@ +{ + "description": "entity-collection-additionalProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "foo", + "foo": 0 + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-collection-additionalProperties.yml b/test/spec/unified-test-format/invalid/entity-collection-additionalProperties.yml new file mode 100644 index 0000000000..2010de017a --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-collection-additionalProperties.yml @@ -0,0 +1,20 @@ +description: "entity-collection-additionalProperties" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: "foo" + - collection: + id: &collection0 "collection0" + database: *database0 + collectionName: "foo" + foo: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-collection-collectionName-required.json b/test/spec/unified-test-format/invalid/entity-collection-collectionName-required.json new file mode 100644 index 0000000000..2446722e5e --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-collection-collectionName-required.json @@ -0,0 +1,30 @@ +{ + "description": "entity-collection-collectionName-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-collection-collectionName-required.yml b/test/spec/unified-test-format/invalid/entity-collection-collectionName-required.yml new file mode 100644 index 0000000000..97e1616207 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-collection-collectionName-required.yml @@ -0,0 +1,18 @@ +description: "entity-collection-collectionName-required" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: "foo" + - collection: + id: &collection0 "collection0" + database: *database0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-collection-collectionName-type.json b/test/spec/unified-test-format/invalid/entity-collection-collectionName-type.json new file mode 100644 index 0000000000..ccad66aac9 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-collection-collectionName-type.json @@ -0,0 +1,31 @@ +{ + "description": "entity-collection-collectionName-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": 0 + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-collection-collectionName-type.yml b/test/spec/unified-test-format/invalid/entity-collection-collectionName-type.yml new file mode 100644 index 0000000000..46bcb473f8 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-collection-collectionName-type.yml @@ -0,0 +1,19 @@ +description: "entity-collection-collectionName-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: "foo" + - collection: + id: &collection0 "collection0" + database: *database0 + collectionName: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-collection-collectionOptions-type.json b/test/spec/unified-test-format/invalid/entity-collection-collectionOptions-type.json new file mode 100644 index 0000000000..52220c1cd1 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-collection-collectionOptions-type.json @@ -0,0 +1,32 @@ +{ + "description": "entity-collection-collectionOptions-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "foo", + "collectionOptions": 0 + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-collection-collectionOptions-type.yml b/test/spec/unified-test-format/invalid/entity-collection-collectionOptions-type.yml new file mode 100644 index 0000000000..58d101981d --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-collection-collectionOptions-type.yml @@ -0,0 +1,20 @@ +description: "entity-collection-collectionOptions-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: "foo" + - collection: + id: &collection0 "collection0" + database: *database0 + collectionName: "foo" + collectionOptions: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-collection-database-required.json b/test/spec/unified-test-format/invalid/entity-collection-database-required.json new file mode 100644 index 0000000000..ba96b43f76 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-collection-database-required.json @@ -0,0 +1,30 @@ +{ + "description": "entity-collection-database-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "collectionName": "foo" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-collection-database-required.yml b/test/spec/unified-test-format/invalid/entity-collection-database-required.yml new file mode 100644 index 0000000000..6a584cd9b6 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-collection-database-required.yml @@ -0,0 +1,18 @@ +description: "entity-collection-database-required" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: "foo" + - collection: + id: &collection0 "collection0" + collectionName: "foo" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-collection-database-type.json b/test/spec/unified-test-format/invalid/entity-collection-database-type.json new file mode 100644 index 0000000000..b87134498d --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-collection-database-type.json @@ -0,0 +1,31 @@ +{ + "description": "entity-collection-database-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": "collection0", + "database": 0, + "collectionName": "foo" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-collection-database-type.yml b/test/spec/unified-test-format/invalid/entity-collection-database-type.yml new file mode 100644 index 0000000000..8ed3c743e9 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-collection-database-type.yml @@ -0,0 +1,19 @@ +description: "entity-collection-database-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: "foo" + - collection: + id: &collection0 "collection0" + database: 0 + collectionName: "foo" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-collection-id-required.json b/test/spec/unified-test-format/invalid/entity-collection-id-required.json new file mode 100644 index 0000000000..84e5352ead --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-collection-id-required.json @@ -0,0 +1,30 @@ +{ + "description": "entity-collection-id-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "database": "database0", + "collectionName": "foo" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-collection-id-required.yml b/test/spec/unified-test-format/invalid/entity-collection-id-required.yml new file mode 100644 index 0000000000..83de062263 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-collection-id-required.yml @@ -0,0 +1,18 @@ +description: "entity-collection-id-required" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: "foo" + - collection: + database: *database0 + collectionName: "foo" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-collection-id-type.json b/test/spec/unified-test-format/invalid/entity-collection-id-type.json new file mode 100644 index 0000000000..f0821e5250 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-collection-id-type.json @@ -0,0 +1,31 @@ +{ + "description": "entity-collection-id-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + }, + { + "collection": { + "id": 0, + "database": "database0", + "collectionName": "foo" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-collection-id-type.yml b/test/spec/unified-test-format/invalid/entity-collection-id-type.yml new file mode 100644 index 0000000000..c7bfa502ee --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-collection-id-type.yml @@ -0,0 +1,19 @@ +description: "entity-collection-id-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: "foo" + - collection: + id: 0 + database: *database0 + collectionName: "foo" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-database-additionalProperties.json b/test/spec/unified-test-format/invalid/entity-database-additionalProperties.json new file mode 100644 index 0000000000..964cd27966 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-database-additionalProperties.json @@ -0,0 +1,25 @@ +{ + "description": "entity-database-additionalProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo", + "foo": 0 + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-database-additionalProperties.yml b/test/spec/unified-test-format/invalid/entity-database-additionalProperties.yml new file mode 100644 index 0000000000..dcfdc048dc --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-database-additionalProperties.yml @@ -0,0 +1,16 @@ +description: "entity-database-additionalProperties" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: "foo" + foo: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-database-client-required.json b/test/spec/unified-test-format/invalid/entity-database-client-required.json new file mode 100644 index 0000000000..54f99cf13e --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-database-client-required.json @@ -0,0 +1,23 @@ +{ + "description": "entity-database-client-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "databaseName": "foo" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-database-client-required.yml b/test/spec/unified-test-format/invalid/entity-database-client-required.yml new file mode 100644 index 0000000000..6e271b1859 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-database-client-required.yml @@ -0,0 +1,14 @@ +description: "entity-database-client-required" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + databaseName: "foo" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-database-client-type.json b/test/spec/unified-test-format/invalid/entity-database-client-type.json new file mode 100644 index 0000000000..ff4584c405 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-database-client-type.json @@ -0,0 +1,24 @@ +{ + "description": "entity-database-client-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": 0, + "databaseName": "foo" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-database-client-type.yml b/test/spec/unified-test-format/invalid/entity-database-client-type.yml new file mode 100644 index 0000000000..fe04610863 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-database-client-type.yml @@ -0,0 +1,15 @@ +description: "entity-database-client-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: 0 + databaseName: "foo" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-database-databaseName-required.json b/test/spec/unified-test-format/invalid/entity-database-databaseName-required.json new file mode 100644 index 0000000000..64cca95c49 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-database-databaseName-required.json @@ -0,0 +1,23 @@ +{ + "description": "entity-database-databaseName-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-database-databaseName-required.yml b/test/spec/unified-test-format/invalid/entity-database-databaseName-required.yml new file mode 100644 index 0000000000..cd2c6e77a0 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-database-databaseName-required.yml @@ -0,0 +1,14 @@ +description: "entity-database-databaseName-required" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-database-databaseName-type.json b/test/spec/unified-test-format/invalid/entity-database-databaseName-type.json new file mode 100644 index 0000000000..bd01aef781 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-database-databaseName-type.json @@ -0,0 +1,24 @@ +{ + "description": "entity-database-databaseName-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": 0 + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-database-databaseName-type.yml b/test/spec/unified-test-format/invalid/entity-database-databaseName-type.yml new file mode 100644 index 0000000000..34ec075b64 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-database-databaseName-type.yml @@ -0,0 +1,15 @@ +description: "entity-database-databaseName-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-database-databaseOptions-type.json b/test/spec/unified-test-format/invalid/entity-database-databaseOptions-type.json new file mode 100644 index 0000000000..bc22ad3129 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-database-databaseOptions-type.json @@ -0,0 +1,25 @@ +{ + "description": "entity-database-databaseOptions-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo", + "databaseOptions": 0 + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-database-databaseOptions-type.yml b/test/spec/unified-test-format/invalid/entity-database-databaseOptions-type.yml new file mode 100644 index 0000000000..77828e5390 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-database-databaseOptions-type.yml @@ -0,0 +1,16 @@ +description: "entity-database-databaseOptions-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: &database0 "database0" + client: *client0 + databaseName: "foo" + databaseOptions: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-database-id-required.json b/test/spec/unified-test-format/invalid/entity-database-id-required.json new file mode 100644 index 0000000000..0b65cf1159 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-database-id-required.json @@ -0,0 +1,23 @@ +{ + "description": "entity-database-id-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "client": "client0", + "databaseName": "foo" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-database-id-required.yml b/test/spec/unified-test-format/invalid/entity-database-id-required.yml new file mode 100644 index 0000000000..51e63b4ab1 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-database-id-required.yml @@ -0,0 +1,14 @@ +description: "entity-database-id-required" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + client: *client0 + databaseName: "foo" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-database-id-type.json b/test/spec/unified-test-format/invalid/entity-database-id-type.json new file mode 100644 index 0000000000..98b5789d04 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-database-id-type.json @@ -0,0 +1,24 @@ +{ + "description": "entity-database-id-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": 0, + "client": "client0", + "databaseName": "foo" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-database-id-type.yml b/test/spec/unified-test-format/invalid/entity-database-id-type.yml new file mode 100644 index 0000000000..1174c36ca4 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-database-id-type.yml @@ -0,0 +1,15 @@ +description: "entity-database-id-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - database: + id: 0 + client: *client0 + databaseName: "foo" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-maxProperties.json b/test/spec/unified-test-format/invalid/entity-maxProperties.json new file mode 100644 index 0000000000..f4a6b7c914 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-maxProperties.json @@ -0,0 +1,22 @@ +{ + "description": "entity-maxProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + }, + "database": { + "id": "database0", + "client": "client0", + "databaseName": "foo" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-maxProperties.yml b/test/spec/unified-test-format/invalid/entity-maxProperties.yml new file mode 100644 index 0000000000..c6f8bcffc5 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-maxProperties.yml @@ -0,0 +1,15 @@ +description: "entity-maxProperties" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + database: + id: &database0 "database0" + client: *client0 + databaseName: "foo" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-minProperties.json b/test/spec/unified-test-format/invalid/entity-minProperties.json new file mode 100644 index 0000000000..d89949ce30 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-minProperties.json @@ -0,0 +1,13 @@ +{ + "description": "entity-minProperties", + "schemaVersion": "1.0", + "createEntities": [ + {} + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-minProperties.yml b/test/spec/unified-test-format/invalid/entity-minProperties.yml new file mode 100644 index 0000000000..d758bd5745 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-minProperties.yml @@ -0,0 +1,10 @@ +description: "entity-minProperties" + +schemaVersion: "1.0" + +createEntities: + - {} + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-session-additionalProperties.json b/test/spec/unified-test-format/invalid/entity-session-additionalProperties.json new file mode 100644 index 0000000000..ab4cd2014f --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-session-additionalProperties.json @@ -0,0 +1,24 @@ +{ + "description": "entity-session-additionalProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "session": { + "id": "session0", + "client": "client0", + "foo": 0 + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-session-additionalProperties.yml b/test/spec/unified-test-format/invalid/entity-session-additionalProperties.yml new file mode 100644 index 0000000000..1bb2233043 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-session-additionalProperties.yml @@ -0,0 +1,15 @@ +description: "entity-session-additionalProperties" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - session: + id: &session0 "session0" + client: *client0 + foo: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-session-client-required.json b/test/spec/unified-test-format/invalid/entity-session-client-required.json new file mode 100644 index 0000000000..8c9ed72e99 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-session-client-required.json @@ -0,0 +1,22 @@ +{ + "description": "entity-session-client-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "session": { + "id": "session0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-session-client-required.yml b/test/spec/unified-test-format/invalid/entity-session-client-required.yml new file mode 100644 index 0000000000..3c1fe4e3c0 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-session-client-required.yml @@ -0,0 +1,13 @@ +description: "entity-session-client-required" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - session: + id: &session0 "session0" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-session-client-type.json b/test/spec/unified-test-format/invalid/entity-session-client-type.json new file mode 100644 index 0000000000..b5ccc3f60f --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-session-client-type.json @@ -0,0 +1,23 @@ +{ + "description": "entity-session-client-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "session": { + "id": "session0", + "client": 0 + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-session-client-type.yml b/test/spec/unified-test-format/invalid/entity-session-client-type.yml new file mode 100644 index 0000000000..60353c08db --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-session-client-type.yml @@ -0,0 +1,14 @@ +description: "entity-session-client-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - session: + id: &session0 "session0" + client: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-session-id-required.json b/test/spec/unified-test-format/invalid/entity-session-id-required.json new file mode 100644 index 0000000000..3e5d5c5439 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-session-id-required.json @@ -0,0 +1,22 @@ +{ + "description": "entity-session-id-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "session": { + "client": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-session-id-required.yml b/test/spec/unified-test-format/invalid/entity-session-id-required.yml new file mode 100644 index 0000000000..2aa4269d16 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-session-id-required.yml @@ -0,0 +1,13 @@ +description: "entity-session-id-required" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - session: + client: *client0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-session-id-type.json b/test/spec/unified-test-format/invalid/entity-session-id-type.json new file mode 100644 index 0000000000..dcd46e5be7 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-session-id-type.json @@ -0,0 +1,23 @@ +{ + "description": "entity-session-id-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "session": { + "id": 0, + "client": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-session-id-type.yml b/test/spec/unified-test-format/invalid/entity-session-id-type.yml new file mode 100644 index 0000000000..058dcdb1b7 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-session-id-type.yml @@ -0,0 +1,14 @@ +description: "entity-session-id-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - session: + id: 0 + client: *client0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-session-sessionOptions-type.json b/test/spec/unified-test-format/invalid/entity-session-sessionOptions-type.json new file mode 100644 index 0000000000..0ee15891eb --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-session-sessionOptions-type.json @@ -0,0 +1,24 @@ +{ + "description": "entity-session-sessionOptions-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "session": { + "id": "session0", + "client": "client0", + "sessionOptions": 0 + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-session-sessionOptions-type.yml b/test/spec/unified-test-format/invalid/entity-session-sessionOptions-type.yml new file mode 100644 index 0000000000..2d651f690b --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-session-sessionOptions-type.yml @@ -0,0 +1,15 @@ +description: "entity-session-sessionOptions-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + - session: + id: &session0 "session0" + client: *client0 + sessionOptions: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-stream-additionalProperties.json b/test/spec/unified-test-format/invalid/entity-stream-additionalProperties.json new file mode 100644 index 0000000000..c8e76e9985 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-stream-additionalProperties.json @@ -0,0 +1,19 @@ +{ + "description": "entity-stream-additionalProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "stream": { + "id": "stream0", + "hexBytes": "FF", + "foo": 0 + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-stream-additionalProperties.yml b/test/spec/unified-test-format/invalid/entity-stream-additionalProperties.yml new file mode 100644 index 0000000000..e2f4f8e93d --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-stream-additionalProperties.yml @@ -0,0 +1,13 @@ +description: "entity-stream-additionalProperties" + +schemaVersion: "1.0" + +createEntities: + - stream: + id: &stream0 "stream0" + hexBytes: "FF" + foo: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-stream-hexBytes-pattern.json b/test/spec/unified-test-format/invalid/entity-stream-hexBytes-pattern.json new file mode 100644 index 0000000000..7381893b55 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-stream-hexBytes-pattern.json @@ -0,0 +1,18 @@ +{ + "description": "entity-stream-hexBytes-pattern", + "schemaVersion": "1.0", + "createEntities": [ + { + "stream": { + "id": "stream0", + "hexBytes": "FFF" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-stream-hexBytes-pattern.yml b/test/spec/unified-test-format/invalid/entity-stream-hexBytes-pattern.yml new file mode 100644 index 0000000000..3e1aa8e45d --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-stream-hexBytes-pattern.yml @@ -0,0 +1,12 @@ +description: "entity-stream-hexBytes-pattern" + +schemaVersion: "1.0" + +createEntities: + - stream: + id: &stream0 "stream0" + hexBytes: "FFF" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-stream-hexBytes-required.json b/test/spec/unified-test-format/invalid/entity-stream-hexBytes-required.json new file mode 100644 index 0000000000..cc3bf09b20 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-stream-hexBytes-required.json @@ -0,0 +1,17 @@ +{ + "description": "entity-stream-hexBytes-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "stream": { + "id": "stream0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-stream-hexBytes-required.yml b/test/spec/unified-test-format/invalid/entity-stream-hexBytes-required.yml new file mode 100644 index 0000000000..b1a4b98561 --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-stream-hexBytes-required.yml @@ -0,0 +1,11 @@ +description: "entity-stream-hexBytes-required" + +schemaVersion: "1.0" + +createEntities: + - stream: + id: &stream0 "stream0" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-stream-hexBytes-type.json b/test/spec/unified-test-format/invalid/entity-stream-hexBytes-type.json new file mode 100644 index 0000000000..e6e2299eac --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-stream-hexBytes-type.json @@ -0,0 +1,18 @@ +{ + "description": "entity-stream-hexBytes-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "stream": { + "id": "stream0", + "hexBytes": 0 + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-stream-hexBytes-type.yml b/test/spec/unified-test-format/invalid/entity-stream-hexBytes-type.yml new file mode 100644 index 0000000000..79b8188c5b --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-stream-hexBytes-type.yml @@ -0,0 +1,12 @@ +description: "entity-stream-hexBytes-type" + +schemaVersion: "1.0" + +createEntities: + - stream: + id: &stream0 "stream0" + hexBytes: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-stream-id-required.json b/test/spec/unified-test-format/invalid/entity-stream-id-required.json new file mode 100644 index 0000000000..ff814d4e9c --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-stream-id-required.json @@ -0,0 +1,17 @@ +{ + "description": "entity-stream-id-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "stream": { + "hexBytes": "FF" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-stream-id-required.yml b/test/spec/unified-test-format/invalid/entity-stream-id-required.yml new file mode 100644 index 0000000000..0ca388aade --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-stream-id-required.yml @@ -0,0 +1,11 @@ +description: "entity-stream-id-required" + +schemaVersion: "1.0" + +createEntities: + - stream: + hexBytes: "FF" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/entity-stream-id-type.json b/test/spec/unified-test-format/invalid/entity-stream-id-type.json new file mode 100644 index 0000000000..5fc654d97e --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-stream-id-type.json @@ -0,0 +1,18 @@ +{ + "description": "entity-stream-id-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "stream": { + "id": 0, + "hexBytes": "FF" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/entity-stream-id-type.yml b/test/spec/unified-test-format/invalid/entity-stream-id-type.yml new file mode 100644 index 0000000000..d7b17952cb --- /dev/null +++ b/test/spec/unified-test-format/invalid/entity-stream-id-type.yml @@ -0,0 +1,12 @@ +description: "entity-stream-id-type" + +schemaVersion: "1.0" + +createEntities: + - stream: + id: 0 + hexBytes: "FF" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/expectedError-additionalProperties.json b/test/spec/unified-test-format/invalid/expectedError-additionalProperties.json new file mode 100644 index 0000000000..3a79df8e34 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-additionalProperties.json @@ -0,0 +1,25 @@ +{ + "description": "expectedError-additionalProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectError": { + "foo": 0 + } + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedError-additionalProperties.yml b/test/spec/unified-test-format/invalid/expectedError-additionalProperties.yml new file mode 100644 index 0000000000..6146367962 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-additionalProperties.yml @@ -0,0 +1,15 @@ +description: "expectedError-additionalProperties" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectError: + foo: 0 diff --git a/test/spec/unified-test-format/invalid/expectedError-errorCode-type.json b/test/spec/unified-test-format/invalid/expectedError-errorCode-type.json new file mode 100644 index 0000000000..b6b6f5d05a --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-errorCode-type.json @@ -0,0 +1,25 @@ +{ + "description": "expectedError-errorCode-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectError": { + "errorCode": "foo" + } + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedError-errorCode-type.yml b/test/spec/unified-test-format/invalid/expectedError-errorCode-type.yml new file mode 100644 index 0000000000..2110e9c6ad --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-errorCode-type.yml @@ -0,0 +1,15 @@ +description: "expectedError-errorCode-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectError: + errorCode: "foo" diff --git a/test/spec/unified-test-format/invalid/expectedError-errorCodeName-type.json b/test/spec/unified-test-format/invalid/expectedError-errorCodeName-type.json new file mode 100644 index 0000000000..3ac5e43045 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-errorCodeName-type.json @@ -0,0 +1,25 @@ +{ + "description": "expectedError-errorCodeName-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectError": { + "errorCodeName": 0 + } + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedError-errorCodeName-type.yml b/test/spec/unified-test-format/invalid/expectedError-errorCodeName-type.yml new file mode 100644 index 0000000000..c35ec3ed4a --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-errorCodeName-type.yml @@ -0,0 +1,15 @@ +description: "expectedError-errorCodeName-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectError: + errorCodeName: 0 diff --git a/test/spec/unified-test-format/invalid/expectedError-errorContains-type.json b/test/spec/unified-test-format/invalid/expectedError-errorContains-type.json new file mode 100644 index 0000000000..847a987dff --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-errorContains-type.json @@ -0,0 +1,25 @@ +{ + "description": "expectedError-errorContains-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectError": { + "errorContains": 0 + } + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedError-errorContains-type.yml b/test/spec/unified-test-format/invalid/expectedError-errorContains-type.yml new file mode 100644 index 0000000000..f4989b61e3 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-errorContains-type.yml @@ -0,0 +1,15 @@ +description: "expectedError-errorContains-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectError: + errorContains: 0 diff --git a/test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-items.json b/test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-items.json new file mode 100644 index 0000000000..4eab56ad18 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-items.json @@ -0,0 +1,27 @@ +{ + "description": "expectedError-errorLabelsContain-items", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectError": { + "errorLabelsContain": [ + 0 + ] + } + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-items.yml b/test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-items.yml new file mode 100644 index 0000000000..4382fa645a --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-items.yml @@ -0,0 +1,15 @@ +description: "expectedError-errorLabelsContain-items" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectError: + errorLabelsContain: [0] diff --git a/test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-minItems.json b/test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-minItems.json new file mode 100644 index 0000000000..48162110aa --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-minItems.json @@ -0,0 +1,25 @@ +{ + "description": "expectedError-errorLabelsContain-minItems", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectError": { + "errorLabelsContain": [] + } + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-minItems.yml b/test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-minItems.yml new file mode 100644 index 0000000000..ebd650e11a --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-minItems.yml @@ -0,0 +1,15 @@ +description: "expectedError-errorLabelsContain-minItems" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectError: + errorLabelsContain: [] diff --git a/test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-type.json b/test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-type.json new file mode 100644 index 0000000000..a0aba918b5 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-type.json @@ -0,0 +1,25 @@ +{ + "description": "expectedError-errorLabelsContain-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectError": { + "errorLabelsContain": 0 + } + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-type.yml b/test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-type.yml new file mode 100644 index 0000000000..537cfb9cfe --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-errorLabelsContain-type.yml @@ -0,0 +1,15 @@ +description: "expectedError-errorLabelsContain-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectError: + errorLabelsContain: 0 diff --git a/test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-items.json b/test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-items.json new file mode 100644 index 0000000000..6c94d07135 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-items.json @@ -0,0 +1,27 @@ +{ + "description": "expectedError-errorLabelsOmit-items", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectError": { + "errorLabelsOmit": [ + 0 + ] + } + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-items.yml b/test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-items.yml new file mode 100644 index 0000000000..d80711ef0f --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-items.yml @@ -0,0 +1,15 @@ +description: "expectedError-errorLabelsOmit-items" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectError: + errorLabelsOmit: [0] diff --git a/test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-minItems.json b/test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-minItems.json new file mode 100644 index 0000000000..88c6582028 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-minItems.json @@ -0,0 +1,25 @@ +{ + "description": "expectedError-errorLabelsOmit-minItems", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectError": { + "errorLabelsOmit": [] + } + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-minItems.yml b/test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-minItems.yml new file mode 100644 index 0000000000..205162cf67 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-minItems.yml @@ -0,0 +1,15 @@ +description: "expectedError-errorLabelsOmit-minItems" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectError: + errorLabelsOmit: [] diff --git a/test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-type.json b/test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-type.json new file mode 100644 index 0000000000..5f57114fea --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-type.json @@ -0,0 +1,25 @@ +{ + "description": "expectedError-errorLabelsOmit-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectError": { + "errorLabelsOmit": 0 + } + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-type.yml b/test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-type.yml new file mode 100644 index 0000000000..6c1947b043 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-errorLabelsOmit-type.yml @@ -0,0 +1,15 @@ +description: "expectedError-errorLabelsOmit-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectError: + errorLabelsOmit: 0 diff --git a/test/spec/unified-test-format/invalid/expectedError-isClientError-type.json b/test/spec/unified-test-format/invalid/expectedError-isClientError-type.json new file mode 100644 index 0000000000..bfcc06679b --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-isClientError-type.json @@ -0,0 +1,25 @@ +{ + "description": "expectedError-isClientError-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectError": { + "isClientError": 0 + } + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedError-isClientError-type.yml b/test/spec/unified-test-format/invalid/expectedError-isClientError-type.yml new file mode 100644 index 0000000000..8b8afc1061 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-isClientError-type.yml @@ -0,0 +1,15 @@ +description: "expectedError-isClientError-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectError: + isClientError: 0 diff --git a/test/spec/unified-test-format/invalid/expectedError-isError-const.json b/test/spec/unified-test-format/invalid/expectedError-isError-const.json new file mode 100644 index 0000000000..6a398bbf22 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-isError-const.json @@ -0,0 +1,25 @@ +{ + "description": "expectedError-isError-const", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectError": { + "isError": false + } + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedError-isError-const.yml b/test/spec/unified-test-format/invalid/expectedError-isError-const.yml new file mode 100644 index 0000000000..347ae2965a --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-isError-const.yml @@ -0,0 +1,15 @@ +description: "expectedError-isError-const" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectError: + isError: false diff --git a/test/spec/unified-test-format/invalid/expectedError-isError-type.json b/test/spec/unified-test-format/invalid/expectedError-isError-type.json new file mode 100644 index 0000000000..354aff31f4 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-isError-type.json @@ -0,0 +1,25 @@ +{ + "description": "expectedError-isError-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectError": { + "isError": 0 + } + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedError-isError-type.yml b/test/spec/unified-test-format/invalid/expectedError-isError-type.yml new file mode 100644 index 0000000000..3e53f4af90 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-isError-type.yml @@ -0,0 +1,15 @@ +description: "expectedError-isError-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectError: + isError: 0 diff --git a/test/spec/unified-test-format/invalid/expectedError-minProperties.json b/test/spec/unified-test-format/invalid/expectedError-minProperties.json new file mode 100644 index 0000000000..10e0b89ab7 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-minProperties.json @@ -0,0 +1,23 @@ +{ + "description": "expectedError-minProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectError": {} + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedError-minProperties.yml b/test/spec/unified-test-format/invalid/expectedError-minProperties.yml new file mode 100644 index 0000000000..5292d85008 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedError-minProperties.yml @@ -0,0 +1,14 @@ +description: "expectedError-minProperties" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectError: {} diff --git a/test/spec/unified-test-format/invalid/expectedEvent-additionalProperties.json b/test/spec/unified-test-format/invalid/expectedEvent-additionalProperties.json new file mode 100644 index 0000000000..2c4f7d27e7 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEvent-additionalProperties.json @@ -0,0 +1,32 @@ +{ + "description": "expectedEvent-additionalProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "foo": 0 + } + ] + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedEvent-additionalProperties.yml b/test/spec/unified-test-format/invalid/expectedEvent-additionalProperties.yml new file mode 100644 index 0000000000..c2c1cb5a7c --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEvent-additionalProperties.yml @@ -0,0 +1,17 @@ +description: "expectedEvent-additionalProperties" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectEvents: + - client: *client0 + events: + - foo: 0 diff --git a/test/spec/unified-test-format/invalid/expectedEvent-commandFailedEvent-commandName-type.json b/test/spec/unified-test-format/invalid/expectedEvent-commandFailedEvent-commandName-type.json new file mode 100644 index 0000000000..ea6078faae --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEvent-commandFailedEvent-commandName-type.json @@ -0,0 +1,34 @@ +{ + "description": "expectedEvent-commandFailedEvent-commandName-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandFailedEvent": { + "commandName": 0 + } + } + ] + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedEvent-commandFailedEvent-commandName-type.yml b/test/spec/unified-test-format/invalid/expectedEvent-commandFailedEvent-commandName-type.yml new file mode 100644 index 0000000000..57504b78f8 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEvent-commandFailedEvent-commandName-type.yml @@ -0,0 +1,18 @@ +description: "expectedEvent-commandFailedEvent-commandName-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectEvents: + - client: *client0 + events: + - commandFailedEvent: + commandName: 0 diff --git a/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-additionalProperties.json b/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-additionalProperties.json new file mode 100644 index 0000000000..ee6eb50658 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-additionalProperties.json @@ -0,0 +1,34 @@ +{ + "description": "expectedEvent-commandStartedEvent-additionalProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "foo": 0 + } + } + ] + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-additionalProperties.yml b/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-additionalProperties.yml new file mode 100644 index 0000000000..6ea724ddfb --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-additionalProperties.yml @@ -0,0 +1,18 @@ +description: "expectedEvent-commandStartedEvent-additionalProperties" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + foo: 0 diff --git a/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-command-type.json b/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-command-type.json new file mode 100644 index 0000000000..4c9483caf3 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-command-type.json @@ -0,0 +1,34 @@ +{ + "description": "expectedEvent-commandStartedEvent-command-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": 0 + } + } + ] + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-command-type.yml b/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-command-type.yml new file mode 100644 index 0000000000..91ba129869 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-command-type.yml @@ -0,0 +1,18 @@ +description: "expectedEvent-commandStartedEvent-command-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: 0 diff --git a/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-commandName-type.json b/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-commandName-type.json new file mode 100644 index 0000000000..a5a66096a0 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-commandName-type.json @@ -0,0 +1,34 @@ +{ + "description": "expectedEvent-commandStartedEvent-commandName-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "commandName": 0 + } + } + ] + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-commandName-type.yml b/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-commandName-type.yml new file mode 100644 index 0000000000..07c968cdd4 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-commandName-type.yml @@ -0,0 +1,18 @@ +description: "expectedEvent-commandStartedEvent-commandName-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + commandName: 0 diff --git a/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-databaseName-type.json b/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-databaseName-type.json new file mode 100644 index 0000000000..dc040ec108 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-databaseName-type.json @@ -0,0 +1,34 @@ +{ + "description": "expectedEvent-commandStartedEvent-databaseName-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "databaseName": 0 + } + } + ] + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-databaseName-type.yml b/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-databaseName-type.yml new file mode 100644 index 0000000000..355d90d6f7 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEvent-commandStartedEvent-databaseName-type.yml @@ -0,0 +1,18 @@ +description: "expectedEvent-commandStartedEvent-databaseName-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + databaseName: 0 diff --git a/test/spec/unified-test-format/invalid/expectedEvent-commandSucceededEvent-commandName-type.json b/test/spec/unified-test-format/invalid/expectedEvent-commandSucceededEvent-commandName-type.json new file mode 100644 index 0000000000..4a20e906b9 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEvent-commandSucceededEvent-commandName-type.json @@ -0,0 +1,34 @@ +{ + "description": "expectedEvent-commandSucceededEvent-commandName-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandSucceededEvent": { + "commandName": 0 + } + } + ] + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedEvent-commandSucceededEvent-commandName-type.yml b/test/spec/unified-test-format/invalid/expectedEvent-commandSucceededEvent-commandName-type.yml new file mode 100644 index 0000000000..740b377fa2 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEvent-commandSucceededEvent-commandName-type.yml @@ -0,0 +1,18 @@ +description: "expectedEvent-commandSucceededEvent-commandName-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectEvents: + - client: *client0 + events: + - commandSucceededEvent: + commandName: 0 diff --git a/test/spec/unified-test-format/invalid/expectedEvent-commandSucceededEvent-reply-type.json b/test/spec/unified-test-format/invalid/expectedEvent-commandSucceededEvent-reply-type.json new file mode 100644 index 0000000000..5464542751 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEvent-commandSucceededEvent-reply-type.json @@ -0,0 +1,34 @@ +{ + "description": "expectedEvent-commandSucceededEvent-reply-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandSucceededEvent": { + "reply": 0 + } + } + ] + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedEvent-commandSucceededEvent-reply-type.yml b/test/spec/unified-test-format/invalid/expectedEvent-commandSucceededEvent-reply-type.yml new file mode 100644 index 0000000000..5a4b35e272 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEvent-commandSucceededEvent-reply-type.yml @@ -0,0 +1,18 @@ +description: "expectedEvent-commandSucceededEvent-reply-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectEvents: + - client: *client0 + events: + - commandSucceededEvent: + reply: 0 diff --git a/test/spec/unified-test-format/invalid/expectedEvent-maxProperties.json b/test/spec/unified-test-format/invalid/expectedEvent-maxProperties.json new file mode 100644 index 0000000000..f01441946f --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEvent-maxProperties.json @@ -0,0 +1,33 @@ +{ + "description": "expectedEvent-maxProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": {}, + "commandSucceededEvent": {} + } + ] + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedEvent-maxProperties.yml b/test/spec/unified-test-format/invalid/expectedEvent-maxProperties.yml new file mode 100644 index 0000000000..d349133ea1 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEvent-maxProperties.yml @@ -0,0 +1,18 @@ +description: "expectedEvent-maxProperties" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectEvents: + - client: *client0 + events: + - commandStartedEvent: {} + commandSucceededEvent: {} diff --git a/test/spec/unified-test-format/invalid/expectedEvent-minProperties.json b/test/spec/unified-test-format/invalid/expectedEvent-minProperties.json new file mode 100644 index 0000000000..ebcc494894 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEvent-minProperties.json @@ -0,0 +1,30 @@ +{ + "description": "expectedEvent-minProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectEvents": [ + { + "client": "client0", + "events": [ + {} + ] + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedEvent-minProperties.yml b/test/spec/unified-test-format/invalid/expectedEvent-minProperties.yml new file mode 100644 index 0000000000..88de63a898 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEvent-minProperties.yml @@ -0,0 +1,17 @@ +description: "expectedEvent-minProperties" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectEvents: + - client: *client0 + events: + - {} diff --git a/test/spec/unified-test-format/invalid/expectedEventsForClient-additionalProperties.json b/test/spec/unified-test-format/invalid/expectedEventsForClient-additionalProperties.json new file mode 100644 index 0000000000..6ecf5931fb --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEventsForClient-additionalProperties.json @@ -0,0 +1,29 @@ +{ + "description": "expectedEventsForClient-additionalProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectEvents": [ + { + "client": "client0", + "events": [], + "foo": 0 + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedEventsForClient-additionalProperties.yml b/test/spec/unified-test-format/invalid/expectedEventsForClient-additionalProperties.yml new file mode 100644 index 0000000000..a15835d1ca --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEventsForClient-additionalProperties.yml @@ -0,0 +1,17 @@ +description: "expectedEventsForClient-additionalProperties" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectEvents: + - client: *client0 + events: [] + foo: 0 diff --git a/test/spec/unified-test-format/invalid/expectedEventsForClient-client-required.json b/test/spec/unified-test-format/invalid/expectedEventsForClient-client-required.json new file mode 100644 index 0000000000..b879db8598 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEventsForClient-client-required.json @@ -0,0 +1,27 @@ +{ + "description": "expectedEventsForClient-client-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectEvents": [ + { + "events": [] + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedEventsForClient-client-required.yml b/test/spec/unified-test-format/invalid/expectedEventsForClient-client-required.yml new file mode 100644 index 0000000000..57db7b07e2 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEventsForClient-client-required.yml @@ -0,0 +1,15 @@ +description: "expectedEventsForClient-client-required" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectEvents: + - events: [] diff --git a/test/spec/unified-test-format/invalid/expectedEventsForClient-client-type.json b/test/spec/unified-test-format/invalid/expectedEventsForClient-client-type.json new file mode 100644 index 0000000000..4ee5427df1 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEventsForClient-client-type.json @@ -0,0 +1,28 @@ +{ + "description": "expectedEventsForClient-client-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectEvents": [ + { + "client": 0, + "events": [] + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedEventsForClient-client-type.yml b/test/spec/unified-test-format/invalid/expectedEventsForClient-client-type.yml new file mode 100644 index 0000000000..015fd7849b --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEventsForClient-client-type.yml @@ -0,0 +1,16 @@ +description: "expectedEventsForClient-client-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectEvents: + - client: 0 + events: [] diff --git a/test/spec/unified-test-format/invalid/expectedEventsForClient-events-items.json b/test/spec/unified-test-format/invalid/expectedEventsForClient-events-items.json new file mode 100644 index 0000000000..ee8ce4a403 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEventsForClient-events-items.json @@ -0,0 +1,30 @@ +{ + "description": "expectedEventsForClient-events-items", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectEvents": [ + { + "client": "client0", + "events": [ + 0 + ] + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedEventsForClient-events-items.yml b/test/spec/unified-test-format/invalid/expectedEventsForClient-events-items.yml new file mode 100644 index 0000000000..e5a6f4606b --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEventsForClient-events-items.yml @@ -0,0 +1,16 @@ +description: "expectedEventsForClient-events-items" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectEvents: + - client: *client0 + events: [0] diff --git a/test/spec/unified-test-format/invalid/expectedEventsForClient-events-required.json b/test/spec/unified-test-format/invalid/expectedEventsForClient-events-required.json new file mode 100644 index 0000000000..7f1bc6fb53 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEventsForClient-events-required.json @@ -0,0 +1,27 @@ +{ + "description": "expectedEventsForClient-events-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectEvents": [ + { + "client": "client0" + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedEventsForClient-events-required.yml b/test/spec/unified-test-format/invalid/expectedEventsForClient-events-required.yml new file mode 100644 index 0000000000..dd14eb2b8e --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEventsForClient-events-required.yml @@ -0,0 +1,15 @@ +description: "expectedEventsForClient-events-required" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectEvents: + - client: *client0 diff --git a/test/spec/unified-test-format/invalid/expectedEventsForClient-events-type.json b/test/spec/unified-test-format/invalid/expectedEventsForClient-events-type.json new file mode 100644 index 0000000000..f171fc2b93 --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEventsForClient-events-type.json @@ -0,0 +1,28 @@ +{ + "description": "expectedEventsForClient-events-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectEvents": [ + { + "client": "client0", + "events": 0 + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/expectedEventsForClient-events-type.yml b/test/spec/unified-test-format/invalid/expectedEventsForClient-events-type.yml new file mode 100644 index 0000000000..b51730f4ff --- /dev/null +++ b/test/spec/unified-test-format/invalid/expectedEventsForClient-events-type.yml @@ -0,0 +1,16 @@ +description: "expectedEventsForClient-events-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectEvents: + - client: *client0 + events: 0 diff --git a/test/spec/unified-test-format/invalid/initialData-items.json b/test/spec/unified-test-format/invalid/initialData-items.json new file mode 100644 index 0000000000..9c27d554f9 --- /dev/null +++ b/test/spec/unified-test-format/invalid/initialData-items.json @@ -0,0 +1,13 @@ +{ + "description": "initialData-items", + "schemaVersion": "1.0", + "initialData": [ + 0 + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/initialData-items.yml b/test/spec/unified-test-format/invalid/initialData-items.yml new file mode 100644 index 0000000000..87fa3e562b --- /dev/null +++ b/test/spec/unified-test-format/invalid/initialData-items.yml @@ -0,0 +1,9 @@ +description: "initialData-items" + +schemaVersion: "1.0" + +initialData: [0] + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/initialData-minItems.json b/test/spec/unified-test-format/invalid/initialData-minItems.json new file mode 100644 index 0000000000..984100a2be --- /dev/null +++ b/test/spec/unified-test-format/invalid/initialData-minItems.json @@ -0,0 +1,11 @@ +{ + "description": "initialData-minItems", + "schemaVersion": "1.0", + "initialData": [], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/initialData-minItems.yml b/test/spec/unified-test-format/invalid/initialData-minItems.yml new file mode 100644 index 0000000000..dc1afde97f --- /dev/null +++ b/test/spec/unified-test-format/invalid/initialData-minItems.yml @@ -0,0 +1,9 @@ +description: "initialData-minItems" + +schemaVersion: "1.0" + +initialData: [] + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/initialData-type.json b/test/spec/unified-test-format/invalid/initialData-type.json new file mode 100644 index 0000000000..c33585e03a --- /dev/null +++ b/test/spec/unified-test-format/invalid/initialData-type.json @@ -0,0 +1,11 @@ +{ + "description": "initialData-type", + "schemaVersion": "1.0", + "initialData": 0, + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/initialData-type.yml b/test/spec/unified-test-format/invalid/initialData-type.yml new file mode 100644 index 0000000000..946c0e4364 --- /dev/null +++ b/test/spec/unified-test-format/invalid/initialData-type.yml @@ -0,0 +1,9 @@ +description: "initialData-type" + +schemaVersion: "1.0" + +initialData: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/operation-additionalProperties.json b/test/spec/unified-test-format/invalid/operation-additionalProperties.json new file mode 100644 index 0000000000..8f2f1434ec --- /dev/null +++ b/test/spec/unified-test-format/invalid/operation-additionalProperties.json @@ -0,0 +1,23 @@ +{ + "description": "operation-additionalProperties", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "foo": 0 + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/operation-additionalProperties.yml b/test/spec/unified-test-format/invalid/operation-additionalProperties.yml new file mode 100644 index 0000000000..d5dbef8e8f --- /dev/null +++ b/test/spec/unified-test-format/invalid/operation-additionalProperties.yml @@ -0,0 +1,14 @@ +description: "operation-additionalProperties" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + foo: 0 diff --git a/test/spec/unified-test-format/invalid/operation-arguments-type.json b/test/spec/unified-test-format/invalid/operation-arguments-type.json new file mode 100644 index 0000000000..a22f3921c3 --- /dev/null +++ b/test/spec/unified-test-format/invalid/operation-arguments-type.json @@ -0,0 +1,23 @@ +{ + "description": "operation-arguments-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "arguments": 0 + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/operation-arguments-type.yml b/test/spec/unified-test-format/invalid/operation-arguments-type.yml new file mode 100644 index 0000000000..1564f21601 --- /dev/null +++ b/test/spec/unified-test-format/invalid/operation-arguments-type.yml @@ -0,0 +1,14 @@ +description: "operation-arguments-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + arguments: 0 diff --git a/test/spec/unified-test-format/invalid/operation-expectError-conflicts_with_expectResult.json b/test/spec/unified-test-format/invalid/operation-expectError-conflicts_with_expectResult.json new file mode 100644 index 0000000000..bc15fbac76 --- /dev/null +++ b/test/spec/unified-test-format/invalid/operation-expectError-conflicts_with_expectResult.json @@ -0,0 +1,26 @@ +{ + "description": "operation-expectError-conflicts_with_expectResult", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectError": { + "isError": true + }, + "expectResult": {} + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/operation-expectError-conflicts_with_expectResult.yml b/test/spec/unified-test-format/invalid/operation-expectError-conflicts_with_expectResult.yml new file mode 100644 index 0000000000..aa9430fdb1 --- /dev/null +++ b/test/spec/unified-test-format/invalid/operation-expectError-conflicts_with_expectResult.yml @@ -0,0 +1,16 @@ +description: "operation-expectError-conflicts_with_expectResult" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectError: + isError: true + expectResult: {} diff --git a/test/spec/unified-test-format/invalid/operation-expectError-conflicts_with_saveResultAsEntity.json b/test/spec/unified-test-format/invalid/operation-expectError-conflicts_with_saveResultAsEntity.json new file mode 100644 index 0000000000..dead4a3b9d --- /dev/null +++ b/test/spec/unified-test-format/invalid/operation-expectError-conflicts_with_saveResultAsEntity.json @@ -0,0 +1,26 @@ +{ + "description": "operation-expectError-conflicts_with_saveResultAsEntity", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectError": { + "isError": true + }, + "saveResultAsEntity": "foo" + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/operation-expectError-conflicts_with_saveResultAsEntity.yml b/test/spec/unified-test-format/invalid/operation-expectError-conflicts_with_saveResultAsEntity.yml new file mode 100644 index 0000000000..6c369598fe --- /dev/null +++ b/test/spec/unified-test-format/invalid/operation-expectError-conflicts_with_saveResultAsEntity.yml @@ -0,0 +1,16 @@ +description: "operation-expectError-conflicts_with_saveResultAsEntity" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectError: + isError: true + saveResultAsEntity: "foo" diff --git a/test/spec/unified-test-format/invalid/operation-expectError-type.json b/test/spec/unified-test-format/invalid/operation-expectError-type.json new file mode 100644 index 0000000000..b224ba3535 --- /dev/null +++ b/test/spec/unified-test-format/invalid/operation-expectError-type.json @@ -0,0 +1,23 @@ +{ + "description": "operation-expectError-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectError": 0 + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/operation-expectError-type.yml b/test/spec/unified-test-format/invalid/operation-expectError-type.yml new file mode 100644 index 0000000000..55588d4359 --- /dev/null +++ b/test/spec/unified-test-format/invalid/operation-expectError-type.yml @@ -0,0 +1,14 @@ +description: "operation-expectError-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectError: 0 diff --git a/test/spec/unified-test-format/invalid/operation-expectEvents-type.json b/test/spec/unified-test-format/invalid/operation-expectEvents-type.json new file mode 100644 index 0000000000..ecd4c011a9 --- /dev/null +++ b/test/spec/unified-test-format/invalid/operation-expectEvents-type.json @@ -0,0 +1,23 @@ +{ + "description": "operation-expectEvents-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "expectEvents": 0 + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/operation-expectEvents-type.yml b/test/spec/unified-test-format/invalid/operation-expectEvents-type.yml new file mode 100644 index 0000000000..2c9936ed28 --- /dev/null +++ b/test/spec/unified-test-format/invalid/operation-expectEvents-type.yml @@ -0,0 +1,14 @@ +description: "operation-expectEvents-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + expectEvents: 0 diff --git a/test/spec/unified-test-format/invalid/operation-name-required.json b/test/spec/unified-test-format/invalid/operation-name-required.json new file mode 100644 index 0000000000..42fcb3a308 --- /dev/null +++ b/test/spec/unified-test-format/invalid/operation-name-required.json @@ -0,0 +1,21 @@ +{ + "description": "operation-name-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "object": "client0" + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/operation-name-required.yml b/test/spec/unified-test-format/invalid/operation-name-required.yml new file mode 100644 index 0000000000..253cb579b9 --- /dev/null +++ b/test/spec/unified-test-format/invalid/operation-name-required.yml @@ -0,0 +1,12 @@ +description: "operation-name-required" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - object: *client0 diff --git a/test/spec/unified-test-format/invalid/operation-name-type.json b/test/spec/unified-test-format/invalid/operation-name-type.json new file mode 100644 index 0000000000..2f91da078a --- /dev/null +++ b/test/spec/unified-test-format/invalid/operation-name-type.json @@ -0,0 +1,22 @@ +{ + "description": "operation-name-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": 0, + "object": "client0" + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/operation-name-type.yml b/test/spec/unified-test-format/invalid/operation-name-type.yml new file mode 100644 index 0000000000..f9323050b5 --- /dev/null +++ b/test/spec/unified-test-format/invalid/operation-name-type.yml @@ -0,0 +1,13 @@ +description: "operation-name-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: 0 + object: *client0 diff --git a/test/spec/unified-test-format/invalid/operation-object-required.json b/test/spec/unified-test-format/invalid/operation-object-required.json new file mode 100644 index 0000000000..c0410ce3fd --- /dev/null +++ b/test/spec/unified-test-format/invalid/operation-object-required.json @@ -0,0 +1,21 @@ +{ + "description": "operation-object-required", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo" + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/operation-object-required.yml b/test/spec/unified-test-format/invalid/operation-object-required.yml new file mode 100644 index 0000000000..eec6101bbe --- /dev/null +++ b/test/spec/unified-test-format/invalid/operation-object-required.yml @@ -0,0 +1,12 @@ +description: "operation-object-required" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" diff --git a/test/spec/unified-test-format/invalid/operation-object-type.json b/test/spec/unified-test-format/invalid/operation-object-type.json new file mode 100644 index 0000000000..edb0a0b51a --- /dev/null +++ b/test/spec/unified-test-format/invalid/operation-object-type.json @@ -0,0 +1,22 @@ +{ + "description": "operation-object-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": 0 + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/operation-object-type.yml b/test/spec/unified-test-format/invalid/operation-object-type.yml new file mode 100644 index 0000000000..fb8e10267b --- /dev/null +++ b/test/spec/unified-test-format/invalid/operation-object-type.yml @@ -0,0 +1,13 @@ +description: "operation-object-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: 0 diff --git a/test/spec/unified-test-format/invalid/operation-saveResultAsEntity-type.json b/test/spec/unified-test-format/invalid/operation-saveResultAsEntity-type.json new file mode 100644 index 0000000000..65ead94c7a --- /dev/null +++ b/test/spec/unified-test-format/invalid/operation-saveResultAsEntity-type.json @@ -0,0 +1,23 @@ +{ + "description": "operation-saveResultAsEntity-type", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [ + { + "name": "foo", + "object": "client0", + "saveResultAsEntity": 0 + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/operation-saveResultAsEntity-type.yml b/test/spec/unified-test-format/invalid/operation-saveResultAsEntity-type.yml new file mode 100644 index 0000000000..7d20938f32 --- /dev/null +++ b/test/spec/unified-test-format/invalid/operation-saveResultAsEntity-type.yml @@ -0,0 +1,14 @@ +description: "operation-saveResultAsEntity-type" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 "client0" + +tests: + - description: "foo" + operations: + - name: "foo" + object: *client0 + saveResultAsEntity: 0 diff --git a/test/spec/unified-test-format/invalid/runOnRequirement-additionalProperties.json b/test/spec/unified-test-format/invalid/runOnRequirement-additionalProperties.json new file mode 100644 index 0000000000..79fa687e45 --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirement-additionalProperties.json @@ -0,0 +1,16 @@ +{ + "description": "runOnRequirement-additionalProperties", + "schemaVersion": "1.0", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "foo": 0 + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/runOnRequirement-additionalProperties.yml b/test/spec/unified-test-format/invalid/runOnRequirement-additionalProperties.yml new file mode 100644 index 0000000000..044b803d29 --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirement-additionalProperties.yml @@ -0,0 +1,11 @@ +description: "runOnRequirement-additionalProperties" + +schemaVersion: "1.0" + +runOnRequirements: + - minServerVersion: "4.0" + foo: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/runOnRequirement-maxServerVersion-pattern.json b/test/spec/unified-test-format/invalid/runOnRequirement-maxServerVersion-pattern.json new file mode 100644 index 0000000000..78766eb925 --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirement-maxServerVersion-pattern.json @@ -0,0 +1,15 @@ +{ + "description": "runOnRequirement-maxServerVersion-pattern", + "schemaVersion": "1.0", + "runOnRequirements": [ + { + "maxServerVersion": "1.2.3.4" + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/runOnRequirement-maxServerVersion-pattern.yml b/test/spec/unified-test-format/invalid/runOnRequirement-maxServerVersion-pattern.yml new file mode 100644 index 0000000000..ce5af27df5 --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirement-maxServerVersion-pattern.yml @@ -0,0 +1,10 @@ +description: "runOnRequirement-maxServerVersion-pattern" + +schemaVersion: "1.0" + +runOnRequirements: + - maxServerVersion: "1.2.3.4" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/runOnRequirement-maxServerVersion-type.json b/test/spec/unified-test-format/invalid/runOnRequirement-maxServerVersion-type.json new file mode 100644 index 0000000000..ffc9118ba2 --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirement-maxServerVersion-type.json @@ -0,0 +1,15 @@ +{ + "description": "runOnRequirement-maxServerVersion-type", + "schemaVersion": "1.0", + "runOnRequirements": [ + { + "maxServerVersion": 0 + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/runOnRequirement-maxServerVersion-type.yml b/test/spec/unified-test-format/invalid/runOnRequirement-maxServerVersion-type.yml new file mode 100644 index 0000000000..a63df28232 --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirement-maxServerVersion-type.yml @@ -0,0 +1,10 @@ +description: "runOnRequirement-maxServerVersion-type" + +schemaVersion: "1.0" + +runOnRequirements: + - maxServerVersion: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/runOnRequirement-minProperties.json b/test/spec/unified-test-format/invalid/runOnRequirement-minProperties.json new file mode 100644 index 0000000000..c2bfed3be7 --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirement-minProperties.json @@ -0,0 +1,13 @@ +{ + "description": "runOnRequirement-minProperties", + "schemaVersion": "1.0", + "runOnRequirements": [ + {} + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/runOnRequirement-minProperties.yml b/test/spec/unified-test-format/invalid/runOnRequirement-minProperties.yml new file mode 100644 index 0000000000..e8b91fd4f5 --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirement-minProperties.yml @@ -0,0 +1,10 @@ +description: "runOnRequirement-minProperties" + +schemaVersion: "1.0" + +runOnRequirements: + - {} + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/runOnRequirement-minServerVersion-pattern.json b/test/spec/unified-test-format/invalid/runOnRequirement-minServerVersion-pattern.json new file mode 100644 index 0000000000..19abc1755f --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirement-minServerVersion-pattern.json @@ -0,0 +1,15 @@ +{ + "description": "runOnRequirement-minServerVersion-pattern", + "schemaVersion": "1.0", + "runOnRequirements": [ + { + "minServerVersion": "1.2.3.4" + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/runOnRequirement-minServerVersion-pattern.yml b/test/spec/unified-test-format/invalid/runOnRequirement-minServerVersion-pattern.yml new file mode 100644 index 0000000000..69d4986665 --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirement-minServerVersion-pattern.yml @@ -0,0 +1,10 @@ +description: "runOnRequirement-minServerVersion-pattern" + +schemaVersion: "1.0" + +runOnRequirements: + - minServerVersion: "1.2.3.4" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/runOnRequirement-minServerVersion-type.json b/test/spec/unified-test-format/invalid/runOnRequirement-minServerVersion-type.json new file mode 100644 index 0000000000..688d1c67ee --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirement-minServerVersion-type.json @@ -0,0 +1,15 @@ +{ + "description": "runOnRequirement-minServerVersion-type", + "schemaVersion": "1.0", + "runOnRequirements": [ + { + "minServerVersion": 0 + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/runOnRequirement-minServerVersion-type.yml b/test/spec/unified-test-format/invalid/runOnRequirement-minServerVersion-type.yml new file mode 100644 index 0000000000..e2727c5800 --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirement-minServerVersion-type.yml @@ -0,0 +1,10 @@ +description: "runOnRequirement-minServerVersion-type" + +schemaVersion: "1.0" + +runOnRequirements: + - minServerVersion: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/runOnRequirement-topologies-enum.json b/test/spec/unified-test-format/invalid/runOnRequirement-topologies-enum.json new file mode 100644 index 0000000000..f62e5040d4 --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirement-topologies-enum.json @@ -0,0 +1,17 @@ +{ + "description": "runOnRequirement-topologies-enum", + "schemaVersion": "1.0", + "runOnRequirements": [ + { + "topologies": [ + "foo" + ] + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/runOnRequirement-topologies-enum.yml b/test/spec/unified-test-format/invalid/runOnRequirement-topologies-enum.yml new file mode 100644 index 0000000000..924a67515d --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirement-topologies-enum.yml @@ -0,0 +1,10 @@ +description: "runOnRequirement-topologies-enum" + +schemaVersion: "1.0" + +runOnRequirements: + - topologies: ["foo"] + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/runOnRequirement-topologies-items.json b/test/spec/unified-test-format/invalid/runOnRequirement-topologies-items.json new file mode 100644 index 0000000000..a205b3293d --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirement-topologies-items.json @@ -0,0 +1,17 @@ +{ + "description": "runOnRequirement-topologies-items", + "schemaVersion": "1.0", + "runOnRequirements": [ + { + "topologies": [ + 0 + ] + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/runOnRequirement-topologies-items.yml b/test/spec/unified-test-format/invalid/runOnRequirement-topologies-items.yml new file mode 100644 index 0000000000..7b2265fb26 --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirement-topologies-items.yml @@ -0,0 +1,10 @@ +description: "runOnRequirement-topologies-items" + +schemaVersion: "1.0" + +runOnRequirements: + - topologies: [0] + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/runOnRequirement-topologies-minItems.json b/test/spec/unified-test-format/invalid/runOnRequirement-topologies-minItems.json new file mode 100644 index 0000000000..16f29b3f4b --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirement-topologies-minItems.json @@ -0,0 +1,15 @@ +{ + "description": "runOnRequirement-topologies-minItems", + "schemaVersion": "1.0", + "runOnRequirements": [ + { + "topologies": [] + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/runOnRequirement-topologies-minItems.yml b/test/spec/unified-test-format/invalid/runOnRequirement-topologies-minItems.yml new file mode 100644 index 0000000000..3e6d11ab8f --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirement-topologies-minItems.yml @@ -0,0 +1,10 @@ +description: "runOnRequirement-topologies-minItems" + +schemaVersion: "1.0" + +runOnRequirements: + - topologies: [] + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/runOnRequirement-topologies-type.json b/test/spec/unified-test-format/invalid/runOnRequirement-topologies-type.json new file mode 100644 index 0000000000..f6d147cd6f --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirement-topologies-type.json @@ -0,0 +1,15 @@ +{ + "description": "runOnRequirement-topologies-type", + "schemaVersion": "1.0", + "runOnRequirements": [ + { + "topologies": 0 + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/runOnRequirement-topologies-type.yml b/test/spec/unified-test-format/invalid/runOnRequirement-topologies-type.yml new file mode 100644 index 0000000000..5a1652d8d9 --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirement-topologies-type.yml @@ -0,0 +1,10 @@ +description: "runOnRequirement-topologies-type" + +schemaVersion: "1.0" + +runOnRequirements: + - topologies: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/runOnRequirements-items.json b/test/spec/unified-test-format/invalid/runOnRequirements-items.json new file mode 100644 index 0000000000..40ec84a3f3 --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirements-items.json @@ -0,0 +1,13 @@ +{ + "description": "runOnRequirements-items", + "schemaVersion": "1.0", + "runOnRequirements": [ + 0 + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/runOnRequirements-items.yml b/test/spec/unified-test-format/invalid/runOnRequirements-items.yml new file mode 100644 index 0000000000..a86bbb1318 --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirements-items.yml @@ -0,0 +1,9 @@ +description: "runOnRequirements-items" + +schemaVersion: "1.0" + +runOnRequirements: [0] + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/runOnRequirements-minItems.json b/test/spec/unified-test-format/invalid/runOnRequirements-minItems.json new file mode 100644 index 0000000000..4ca9f99b5d --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirements-minItems.json @@ -0,0 +1,11 @@ +{ + "description": "runOnRequirements-minItems", + "schemaVersion": "1.0", + "runOnRequirements": [], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/runOnRequirements-minItems.yml b/test/spec/unified-test-format/invalid/runOnRequirements-minItems.yml new file mode 100644 index 0000000000..034786a220 --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirements-minItems.yml @@ -0,0 +1,9 @@ +description: "runOnRequirements-minItems" + +schemaVersion: "1.0" + +runOnRequirements: [] + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/runOnRequirements-type.json b/test/spec/unified-test-format/invalid/runOnRequirements-type.json new file mode 100644 index 0000000000..98b859f3ea --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirements-type.json @@ -0,0 +1,11 @@ +{ + "description": "runOnRequirements-type", + "schemaVersion": "1.0", + "runOnRequirements": 0, + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/runOnRequirements-type.yml b/test/spec/unified-test-format/invalid/runOnRequirements-type.yml new file mode 100644 index 0000000000..42afc21ced --- /dev/null +++ b/test/spec/unified-test-format/invalid/runOnRequirements-type.yml @@ -0,0 +1,9 @@ +description: "runOnRequirements-type" + +schemaVersion: "1.0" + +runOnRequirements: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/schemaVersion-pattern.json b/test/spec/unified-test-format/invalid/schemaVersion-pattern.json new file mode 100644 index 0000000000..bcb8980516 --- /dev/null +++ b/test/spec/unified-test-format/invalid/schemaVersion-pattern.json @@ -0,0 +1,10 @@ +{ + "description": "schemaVersion-pattern", + "schemaVersion": "1.2.3.4", + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/schemaVersion-pattern.yml b/test/spec/unified-test-format/invalid/schemaVersion-pattern.yml new file mode 100644 index 0000000000..3d36ee64b5 --- /dev/null +++ b/test/spec/unified-test-format/invalid/schemaVersion-pattern.yml @@ -0,0 +1,7 @@ +description: "schemaVersion-pattern" + +schemaVersion: "1.2.3.4" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/schemaVersion-required.json b/test/spec/unified-test-format/invalid/schemaVersion-required.json new file mode 100644 index 0000000000..7388ff0bf1 --- /dev/null +++ b/test/spec/unified-test-format/invalid/schemaVersion-required.json @@ -0,0 +1,9 @@ +{ + "description": "schemaVersion-required", + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/schemaVersion-required.yml b/test/spec/unified-test-format/invalid/schemaVersion-required.yml new file mode 100644 index 0000000000..14a13872d8 --- /dev/null +++ b/test/spec/unified-test-format/invalid/schemaVersion-required.yml @@ -0,0 +1,5 @@ +description: "schemaVersion-required" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/invalid/schemaVersion-type.json b/test/spec/unified-test-format/invalid/schemaVersion-type.json new file mode 100644 index 0000000000..646473a209 --- /dev/null +++ b/test/spec/unified-test-format/invalid/schemaVersion-type.json @@ -0,0 +1,10 @@ +{ + "description": "schemaVersion-type", + "schemaVersion": 0, + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/invalid/schemaVersion-type.yml b/test/spec/unified-test-format/invalid/schemaVersion-type.yml new file mode 100644 index 0000000000..9dfeed1e78 --- /dev/null +++ b/test/spec/unified-test-format/invalid/schemaVersion-type.yml @@ -0,0 +1,7 @@ +description: "schemaVersion-type" + +schemaVersion: 0 + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/valid-fail/entity-bucket-database-undefined.json b/test/spec/unified-test-format/valid-fail/entity-bucket-database-undefined.json new file mode 100644 index 0000000000..7f7f1978c3 --- /dev/null +++ b/test/spec/unified-test-format/valid-fail/entity-bucket-database-undefined.json @@ -0,0 +1,18 @@ +{ + "description": "entity-bucket-database-undefined", + "schemaVersion": "1.0", + "createEntities": [ + { + "bucket": { + "id": "bucket0", + "database": "foo" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/valid-fail/entity-bucket-database-undefined.yml b/test/spec/unified-test-format/valid-fail/entity-bucket-database-undefined.yml new file mode 100644 index 0000000000..7aeda8e1ac --- /dev/null +++ b/test/spec/unified-test-format/valid-fail/entity-bucket-database-undefined.yml @@ -0,0 +1,12 @@ +description: "entity-bucket-database-undefined" + +schemaVersion: "1.0" + +createEntities: + - bucket: + id: &bucket0 "bucket0" + database: "foo" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/valid-fail/entity-client-apiVersion-unsupported.json b/test/spec/unified-test-format/valid-fail/entity-client-apiVersion-unsupported.json new file mode 100644 index 0000000000..d92d23dcaf --- /dev/null +++ b/test/spec/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/spec/unified-test-format/valid-fail/entity-client-apiVersion-unsupported.yml b/test/spec/unified-test-format/valid-fail/entity-client-apiVersion-unsupported.yml new file mode 100644 index 0000000000..7c626a308b --- /dev/null +++ b/test/spec/unified-test-format/valid-fail/entity-client-apiVersion-unsupported.yml @@ -0,0 +1,13 @@ +description: "entity-client-apiVersion-unsupported" + +schemaVersion: "1.1" + +createEntities: + - client: + id: &client0 client0 + serverApi: + version: "server_will_never_support_this_api_version" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/valid-fail/entity-collection-database-undefined.json b/test/spec/unified-test-format/valid-fail/entity-collection-database-undefined.json new file mode 100644 index 0000000000..20b0733e34 --- /dev/null +++ b/test/spec/unified-test-format/valid-fail/entity-collection-database-undefined.json @@ -0,0 +1,19 @@ +{ + "description": "entity-collection-database-undefined", + "schemaVersion": "1.0", + "createEntities": [ + { + "collection": { + "id": "collection0", + "database": "foo", + "collectionName": "foo" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/valid-fail/entity-collection-database-undefined.yml b/test/spec/unified-test-format/valid-fail/entity-collection-database-undefined.yml new file mode 100644 index 0000000000..a66b6ed292 --- /dev/null +++ b/test/spec/unified-test-format/valid-fail/entity-collection-database-undefined.yml @@ -0,0 +1,13 @@ +description: "entity-collection-database-undefined" + +schemaVersion: "1.0" + +createEntities: + - collection: + id: &collection0 "collection0" + database: "foo" + collectionName: "foo" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/valid-fail/entity-database-client-undefined.json b/test/spec/unified-test-format/valid-fail/entity-database-client-undefined.json new file mode 100644 index 0000000000..0f8110e6d3 --- /dev/null +++ b/test/spec/unified-test-format/valid-fail/entity-database-client-undefined.json @@ -0,0 +1,19 @@ +{ + "description": "entity-database-client-undefined", + "schemaVersion": "1.0", + "createEntities": [ + { + "database": { + "id": "database0", + "client": "foo", + "databaseName": "foo" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/valid-fail/entity-database-client-undefined.yml b/test/spec/unified-test-format/valid-fail/entity-database-client-undefined.yml new file mode 100644 index 0000000000..34b58cece5 --- /dev/null +++ b/test/spec/unified-test-format/valid-fail/entity-database-client-undefined.yml @@ -0,0 +1,13 @@ +description: "entity-database-client-undefined" + +schemaVersion: "1.0" + +createEntities: + - database: + id: &database0 "database0" + client: "foo" + databaseName: "foo" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/valid-fail/entity-session-client-undefined.json b/test/spec/unified-test-format/valid-fail/entity-session-client-undefined.json new file mode 100644 index 0000000000..260356436a --- /dev/null +++ b/test/spec/unified-test-format/valid-fail/entity-session-client-undefined.json @@ -0,0 +1,18 @@ +{ + "description": "entity-session-client-undefined", + "schemaVersion": "1.0", + "createEntities": [ + { + "session": { + "id": "session0", + "client": "foo" + } + } + ], + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/valid-fail/entity-session-client-undefined.yml b/test/spec/unified-test-format/valid-fail/entity-session-client-undefined.yml new file mode 100644 index 0000000000..16eaea46b7 --- /dev/null +++ b/test/spec/unified-test-format/valid-fail/entity-session-client-undefined.yml @@ -0,0 +1,12 @@ +description: "entity-session-client-undefined" + +schemaVersion: "1.0" + +createEntities: + - session: + id: &session0 "session0" + client: "foo" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/valid-fail/returnDocument-enum-invalid.json b/test/spec/unified-test-format/valid-fail/returnDocument-enum-invalid.json new file mode 100644 index 0000000000..ea425fb568 --- /dev/null +++ b/test/spec/unified-test-format/valid-fail/returnDocument-enum-invalid.json @@ -0,0 +1,66 @@ +{ + "description": "returnDocument-enum-invalid", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "test" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + } + ], + "tests": [ + { + "description": "FindOneAndReplace returnDocument invalid enum value", + "operations": [ + { + "name": "findOneAndReplace", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + }, + "replacement": { + "_id": 1, + "x": 111 + }, + "returnDocument": "invalid" + } + } + ] + }, + { + "description": "FindOneAndUpdate returnDocument invalid enum value", + "operations": [ + { + "name": "findOneAndUpdate", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + }, + "update": { + "$inc": { + "x": 1 + } + }, + "returnDocument": "invalid" + } + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/valid-fail/returnDocument-enum-invalid.yml b/test/spec/unified-test-format/valid-fail/returnDocument-enum-invalid.yml new file mode 100644 index 0000000000..b877f5e965 --- /dev/null +++ b/test/spec/unified-test-format/valid-fail/returnDocument-enum-invalid.yml @@ -0,0 +1,34 @@ +description: "returnDocument-enum-invalid" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + - database: + id: &database0 database0 + client: *client0 + databaseName: &databaseName test + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collectionName coll + +tests: + - description: "FindOneAndReplace returnDocument invalid enum value" + operations: + - name: findOneAndReplace + object: *collection0 + arguments: + filter: { _id: 1 } + replacement: { _id: 1, x: 111 } + returnDocument: invalid + + - description: "FindOneAndUpdate returnDocument invalid enum value" + operations: + - name: findOneAndUpdate + object: *collection0 + arguments: + filter: { _id: 1 } + update: { $inc: { x : 1 }} + returnDocument: invalid diff --git a/test/spec/unified-test-format/valid-fail/schemaVersion-unsupported.json b/test/spec/unified-test-format/valid-fail/schemaVersion-unsupported.json new file mode 100644 index 0000000000..ceb5532917 --- /dev/null +++ b/test/spec/unified-test-format/valid-fail/schemaVersion-unsupported.json @@ -0,0 +1,10 @@ +{ + "description": "schemaVersion-unsupported", + "schemaVersion": "0.1", + "tests": [ + { + "description": "foo", + "operations": [] + } + ] +} diff --git a/test/spec/unified-test-format/valid-fail/schemaVersion-unsupported.yml b/test/spec/unified-test-format/valid-fail/schemaVersion-unsupported.yml new file mode 100644 index 0000000000..0cb6994d24 --- /dev/null +++ b/test/spec/unified-test-format/valid-fail/schemaVersion-unsupported.yml @@ -0,0 +1,7 @@ +description: "schemaVersion-unsupported" + +schemaVersion: "0.1" + +tests: + - description: "foo" + operations: [] diff --git a/test/spec/unified-test-format/valid-pass/poc-change-streams.json b/test/spec/unified-test-format/valid-pass/poc-change-streams.json new file mode 100644 index 0000000000..2a2c41a682 --- /dev/null +++ b/test/spec/unified-test-format/valid-pass/poc-change-streams.json @@ -0,0 +1,414 @@ +{ + "description": "poc-change-streams", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ], + "ignoreCommandMonitoringEvents": [ + "getMore", + "killCursors" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "change-stream-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "test" + } + }, + { + "client": { + "id": "client1", + "useMultipleMongoses": false + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "change-stream-tests" + } + }, + { + "database": { + "id": "database2", + "client": "client1", + "databaseName": "change-stream-tests-2" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "test" + } + }, + { + "collection": { + "id": "collection2", + "database": "database1", + "collectionName": "test2" + } + }, + { + "collection": { + "id": "collection3", + "database": "database2", + "collectionName": "test" + } + } + ], + "initialData": [ + { + "collectionName": "test", + "databaseName": "change-stream-tests", + "documents": [] + }, + { + "collectionName": "test2", + "databaseName": "change-stream-tests", + "documents": [] + }, + { + "collectionName": "test", + "databaseName": "change-stream-tests-2", + "documents": [] + } + ], + "tests": [ + { + "description": "Executing a watch helper on a MongoClient results in notifications for changes to all collections in all databases in the cluster.", + "runOnRequirements": [ + { + "minServerVersion": "3.8.0", + "topologies": [ + "replicaset" + ] + } + ], + "operations": [ + { + "name": "createChangeStream", + "object": "client0", + "arguments": { + "pipeline": [] + }, + "saveResultAsEntity": "changeStream0" + }, + { + "name": "insertOne", + "object": "collection2", + "arguments": { + "document": { + "x": 1 + } + } + }, + { + "name": "insertOne", + "object": "collection3", + "arguments": { + "document": { + "y": 1 + } + } + }, + { + "name": "insertOne", + "object": "collection1", + "arguments": { + "document": { + "z": 1 + } + } + }, + { + "name": "iterateUntilDocumentOrError", + "object": "changeStream0", + "expectResult": { + "operationType": "insert", + "ns": { + "db": "change-stream-tests", + "coll": "test2" + }, + "fullDocument": { + "_id": { + "$$type": "objectId" + }, + "x": 1 + } + } + }, + { + "name": "iterateUntilDocumentOrError", + "object": "changeStream0", + "expectResult": { + "operationType": "insert", + "ns": { + "db": "change-stream-tests-2", + "coll": "test" + }, + "fullDocument": { + "_id": { + "$$type": "objectId" + }, + "y": 1 + } + } + }, + { + "name": "iterateUntilDocumentOrError", + "object": "changeStream0", + "expectResult": { + "operationType": "insert", + "ns": { + "db": "change-stream-tests", + "coll": "test" + }, + "fullDocument": { + "_id": { + "$$type": "objectId" + }, + "z": 1 + } + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": 1, + "cursor": {}, + "pipeline": [ + { + "$changeStream": { + "allChangesForCluster": true, + "fullDocument": { + "$$unsetOrMatches": "default" + } + } + } + ] + }, + "commandName": "aggregate", + "databaseName": "admin" + } + } + ] + } + ] + }, + { + "description": "Test consecutive resume", + "runOnRequirements": [ + { + "minServerVersion": "4.1.7", + "topologies": [ + "replicaset" + ] + } + ], + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "getMore" + ], + "closeConnection": true + } + } + } + }, + { + "name": "createChangeStream", + "object": "collection0", + "arguments": { + "batchSize": 1, + "pipeline": [] + }, + "saveResultAsEntity": "changeStream0" + }, + { + "name": "insertOne", + "object": "collection1", + "arguments": { + "document": { + "x": 1 + } + } + }, + { + "name": "insertOne", + "object": "collection1", + "arguments": { + "document": { + "x": 2 + } + } + }, + { + "name": "insertOne", + "object": "collection1", + "arguments": { + "document": { + "x": 3 + } + } + }, + { + "name": "iterateUntilDocumentOrError", + "object": "changeStream0", + "expectResult": { + "operationType": "insert", + "ns": { + "db": "change-stream-tests", + "coll": "test" + }, + "fullDocument": { + "_id": { + "$$type": "objectId" + }, + "x": 1 + } + } + }, + { + "name": "iterateUntilDocumentOrError", + "object": "changeStream0", + "expectResult": { + "operationType": "insert", + "ns": { + "db": "change-stream-tests", + "coll": "test" + }, + "fullDocument": { + "_id": { + "$$type": "objectId" + }, + "x": 2 + } + } + }, + { + "name": "iterateUntilDocumentOrError", + "object": "changeStream0", + "expectResult": { + "operationType": "insert", + "ns": { + "db": "change-stream-tests", + "coll": "test" + }, + "fullDocument": { + "_id": { + "$$type": "objectId" + }, + "x": 3 + } + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "test", + "cursor": { + "batchSize": 1 + }, + "pipeline": [ + { + "$changeStream": { + "fullDocument": { + "$$unsetOrMatches": "default" + } + } + } + ] + }, + "commandName": "aggregate", + "databaseName": "change-stream-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "test", + "cursor": { + "batchSize": 1 + }, + "pipeline": [ + { + "$changeStream": { + "fullDocument": { + "$$unsetOrMatches": "default" + }, + "resumeAfter": { + "$$exists": true + } + } + } + ] + }, + "commandName": "aggregate", + "databaseName": "change-stream-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "test", + "cursor": { + "batchSize": 1 + }, + "pipeline": [ + { + "$changeStream": { + "fullDocument": { + "$$unsetOrMatches": "default" + }, + "resumeAfter": { + "$$exists": true + } + } + } + ] + }, + "commandName": "aggregate", + "databaseName": "change-stream-tests" + } + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/valid-pass/poc-change-streams.yml b/test/spec/unified-test-format/valid-pass/poc-change-streams.yml new file mode 100644 index 0000000000..df83513d27 --- /dev/null +++ b/test/spec/unified-test-format/valid-pass/poc-change-streams.yml @@ -0,0 +1,220 @@ +description: "poc-change-streams" + +schemaVersion: "1.0" + +createEntities: + # Entities for creating changeStreams + - client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: [ commandStartedEvent ] + # Original tests do not observe getMore commands but only because event + # assertions ignore extra events. killCursors is explicitly ignored. + ignoreCommandMonitoringEvents: [ getMore, killCursors ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name change-stream-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name test + # Entities for executing insert operations + - client: + id: &client1 client1 + useMultipleMongoses: false + - database: + id: &database1 database1 + client: *client1 + databaseName: &database1Name change-stream-tests + - database: + id: &database2 database2 + client: *client1 + databaseName: &database2Name change-stream-tests-2 + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: &collection1Name test + - collection: + id: &collection2 collection2 + database: *database1 + collectionName: &collection2Name test2 + - collection: + id: &collection3 collection3 + database: *database2 + collectionName: &collection3Name test + +initialData: + - collectionName: *collection1Name + databaseName: *database1Name + documents: [] + - collectionName: *collection2Name + databaseName: *database1Name + documents: [] + - collectionName: *collection3Name + databaseName: *database2Name + documents: [] + +tests: + - description: "Executing a watch helper on a MongoClient results in notifications for changes to all collections in all databases in the cluster." + runOnRequirements: + - minServerVersion: "3.8.0" + topologies: [ replicaset ] + operations: + - name: createChangeStream + object: *client0 + arguments: + pipeline: [] + saveResultAsEntity: &changeStream0 changeStream0 + - name: insertOne + object: *collection2 + arguments: + document: { x: 1 } + - name: insertOne + object: *collection3 + arguments: + document: { y: 1 } + - name: insertOne + object: *collection1 + arguments: + document: { z: 1 } + - name: iterateUntilDocumentOrError + object: *changeStream0 + expectResult: + operationType: insert + ns: + db: *database1Name + coll: *collection2Name + fullDocument: + _id: { $$type: objectId } + x: 1 + - name: iterateUntilDocumentOrError + object: *changeStream0 + expectResult: + operationType: insert + ns: + db: *database2Name + coll: *collection3Name + fullDocument: + # Original tests did not include _id, but matching now only permits + # extra keys for root-level documents. + _id: { $$type: objectId } + y: 1 + - name: iterateUntilDocumentOrError + object: *changeStream0 + expectResult: + operationType: insert + ns: + db: *database1Name + coll: *collection1Name + fullDocument: + _id: { $$type: objectId } + z: 1 + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + aggregate: 1 + cursor: {} + pipeline: + - $changeStream: + allChangesForCluster: true + # Some drivers may send a default value for fullDocument + # or omit it entirely (see: SPEC-1350). + fullDocument: { $$unsetOrMatches: default } + commandName: aggregate + databaseName: admin + + - description: "Test consecutive resume" + runOnRequirements: + - minServerVersion: "4.1.7" + topologies: [ replicaset ] + operations: + - name: failPoint + object: testRunner + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ getMore ] + closeConnection: true + - name: createChangeStream + object: *collection0 + arguments: + batchSize: 1 + pipeline: [] + saveResultAsEntity: *changeStream0 + - name: insertOne + object: *collection1 + arguments: + document: { x: 1 } + - name: insertOne + object: *collection1 + arguments: + document: { x: 2 } + - name: insertOne + object: *collection1 + arguments: + document: { x: 3 } + - name: iterateUntilDocumentOrError + object: *changeStream0 + expectResult: + operationType: insert + ns: + db: *database1Name + coll: *collection1Name + fullDocument: + _id: { $$type: objectId } + x: 1 + - name: iterateUntilDocumentOrError + object: *changeStream0 + expectResult: + operationType: insert + ns: + db: *database1Name + coll: *collection1Name + fullDocument: + _id: { $$type: objectId } + x: 2 + - name: iterateUntilDocumentOrError + object: *changeStream0 + expectResult: + operationType: insert + ns: + db: *database1Name + coll: *collection1Name + fullDocument: + _id: { $$type: objectId } + x: 3 + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + aggregate: *collection1Name + cursor: { batchSize: 1 } + pipeline: + - $changeStream: + fullDocument: { $$unsetOrMatches: default } + commandName: aggregate + databaseName: *database1Name + # The original test only asserted the first command, since expected + # events were only an ordered subset. This file does ignore getMore + # commands but we must expect the subsequent aggregate commands, since + # each failed getMore will resume. While doing so we can also assert + # that those commands include a resume token. + - &resumingAggregate + commandStartedEvent: + command: + aggregate: *collection1Name + cursor: { batchSize: 1 } + pipeline: + - $changeStream: + fullDocument: { $$unsetOrMatches: default } + resumeAfter: { $$exists: true } + commandName: aggregate + databaseName: *database0Name + - *resumingAggregate diff --git a/test/spec/unified-test-format/valid-pass/poc-command-monitoring.json b/test/spec/unified-test-format/valid-pass/poc-command-monitoring.json new file mode 100644 index 0000000000..499396e0ba --- /dev/null +++ b/test/spec/unified-test-format/valid-pass/poc-command-monitoring.json @@ -0,0 +1,222 @@ +{ + "description": "poc-command-monitoring", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent", + "commandSucceededEvent", + "commandFailedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "command-monitoring-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "test" + } + } + ], + "initialData": [ + { + "collectionName": "test", + "databaseName": "command-monitoring-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + }, + { + "_id": 4, + "x": 44 + }, + { + "_id": 5, + "x": 55 + } + ] + } + ], + "tests": [ + { + "description": "A successful find event with a getmore and the server kills the cursor", + "runOnRequirements": [ + { + "minServerVersion": "3.1", + "topologies": [ + "single", + "replicaset" + ] + } + ], + "operations": [ + { + "name": "find", + "object": "collection0", + "arguments": { + "filter": { + "_id": { + "$gte": 1 + } + }, + "sort": { + "_id": 1 + }, + "batchSize": 3, + "limit": 4 + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "test", + "filter": { + "_id": { + "$gte": 1 + } + }, + "sort": { + "_id": 1 + }, + "batchSize": 3, + "limit": 4 + }, + "commandName": "find", + "databaseName": "command-monitoring-tests" + } + }, + { + "commandSucceededEvent": { + "reply": { + "ok": 1, + "cursor": { + "id": { + "$$type": [ + "int", + "long" + ] + }, + "ns": "command-monitoring-tests.test", + "firstBatch": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + }, + "commandName": "find" + } + }, + { + "commandStartedEvent": { + "command": { + "getMore": { + "$$type": [ + "int", + "long" + ] + }, + "collection": "test", + "batchSize": 1 + }, + "commandName": "getMore", + "databaseName": "command-monitoring-tests" + } + }, + { + "commandSucceededEvent": { + "reply": { + "ok": 1, + "cursor": { + "id": 0, + "ns": "command-monitoring-tests.test", + "nextBatch": [ + { + "_id": 4, + "x": 44 + } + ] + } + }, + "commandName": "getMore" + } + } + ] + } + ] + }, + { + "description": "A failed find event", + "operations": [ + { + "name": "find", + "object": "collection0", + "arguments": { + "filter": { + "$or": true + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "test", + "filter": { + "$or": true + } + }, + "commandName": "find", + "databaseName": "command-monitoring-tests" + } + }, + { + "commandFailedEvent": { + "commandName": "find" + } + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/valid-pass/poc-command-monitoring.yml b/test/spec/unified-test-format/valid-pass/poc-command-monitoring.yml new file mode 100644 index 0000000000..19a282327c --- /dev/null +++ b/test/spec/unified-test-format/valid-pass/poc-command-monitoring.yml @@ -0,0 +1,101 @@ +description: "poc-command-monitoring" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: + - commandStartedEvent + - commandSucceededEvent + - commandFailedEvent + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name command-monitoring-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name test + +initialData: + - collectionName: *collection0Name + databaseName: *database0Name + documents: + - { _id: 1, x: 11 } + - { _id: 2, x: 22 } + - { _id: 3, x: 33 } + - { _id: 4, x: 44 } + - { _id: 5, x: 55 } + +tests: + - description: "A successful find event with a getmore and the server kills the cursor" + runOnRequirements: + - minServerVersion: "3.1" + topologies: [ single, replicaset ] + operations: + - name: find + object: *collection0 + arguments: + filter: { _id: { $gte: 1 }} + sort: { _id: 1 } + batchSize: 3 + limit: 4 + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + find: *collection0Name + filter: { _id: { $gte : 1 } } + sort: { _id: 1 } + batchSize: 3 + limit: 4 + commandName: find + databaseName: *database0Name + - commandSucceededEvent: + reply: + ok: 1 + cursor: + id: { $$type: [ int, long ] } + ns: &namespace command-monitoring-tests.test + firstBatch: + - { _id: 1, x: 11 } + - { _id: 2, x: 22 } + - { _id: 3, x: 33 } + commandName: find + - commandStartedEvent: + command: + getMore: { $$type: [ int, long ] } + collection: *collection0Name + batchSize: 1 + commandName: getMore + databaseName: *database0Name + - commandSucceededEvent: + reply: + ok: 1 + cursor: + id: 0 + ns: *namespace + nextBatch: + - { _id: 4, x: 44 } + commandName: getMore + + - description: "A failed find event" + operations: + - name: find + object: *collection0 + arguments: + filter: { $or: true } + expectError: { isError: true } + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + find: *collection0Name + filter: { $or: true } + commandName: find + databaseName: *database0Name + - commandFailedEvent: + commandName: find diff --git a/test/spec/unified-test-format/valid-pass/poc-crud.json b/test/spec/unified-test-format/valid-pass/poc-crud.json new file mode 100644 index 0000000000..2ed86d6150 --- /dev/null +++ b/test/spec/unified-test-format/valid-pass/poc-crud.json @@ -0,0 +1,446 @@ +{ + "description": "poc-crud", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "crud-tests" + } + }, + { + "database": { + "id": "database1", + "client": "client0", + "databaseName": "admin" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll0" + } + }, + { + "collection": { + "id": "collection1", + "database": "database0", + "collectionName": "coll1" + } + }, + { + "collection": { + "id": "collection2", + "database": "database0", + "collectionName": "coll2", + "collectionOptions": { + "readConcern": { + "level": "majority" + } + } + } + } + ], + "initialData": [ + { + "collectionName": "coll0", + "databaseName": "crud-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + } + ] + }, + { + "collectionName": "coll1", + "databaseName": "crud-tests", + "documents": [ + { + "_id": 1, + "x": 11 + } + ] + }, + { + "collectionName": "coll2", + "databaseName": "crud-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + }, + { + "collectionName": "aggregate_out", + "databaseName": "crud-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "BulkWrite with mixed ordered operations", + "operations": [ + { + "name": "bulkWrite", + "object": "collection0", + "arguments": { + "requests": [ + { + "insertOne": { + "document": { + "_id": 3, + "x": 33 + } + } + }, + { + "updateOne": { + "filter": { + "_id": 2 + }, + "update": { + "$inc": { + "x": 1 + } + } + } + }, + { + "updateMany": { + "filter": { + "_id": { + "$gt": 1 + } + }, + "update": { + "$inc": { + "x": 1 + } + } + } + }, + { + "insertOne": { + "document": { + "_id": 4, + "x": 44 + } + } + }, + { + "deleteMany": { + "filter": { + "x": { + "$nin": [ + 24, + 34 + ] + } + } + } + }, + { + "replaceOne": { + "filter": { + "_id": 4 + }, + "replacement": { + "_id": 4, + "x": 44 + }, + "upsert": true + } + } + ], + "ordered": true + }, + "expectResult": { + "deletedCount": 2, + "insertedCount": 2, + "insertedIds": { + "$$unsetOrMatches": { + "0": 3, + "3": 4 + } + }, + "matchedCount": 3, + "modifiedCount": 3, + "upsertedCount": 1, + "upsertedIds": { + "5": 4 + } + } + } + ], + "outcome": [ + { + "collectionName": "coll0", + "databaseName": "crud-tests", + "documents": [ + { + "_id": 2, + "x": 24 + }, + { + "_id": 3, + "x": 34 + }, + { + "_id": 4, + "x": 44 + } + ] + } + ] + }, + { + "description": "InsertMany continue-on-error behavior with unordered (duplicate key in requests)", + "operations": [ + { + "name": "insertMany", + "object": "collection1", + "arguments": { + "documents": [ + { + "_id": 2, + "x": 22 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ], + "ordered": false + }, + "expectError": { + "expectResult": { + "deletedCount": 0, + "insertedCount": 2, + "matchedCount": 0, + "modifiedCount": 0, + "upsertedCount": 0, + "upsertedIds": {} + } + } + } + ], + "outcome": [ + { + "collectionName": "coll1", + "databaseName": "crud-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ] + }, + { + "description": "ReplaceOne prohibits atomic modifiers", + "operations": [ + { + "name": "replaceOne", + "object": "collection1", + "arguments": { + "filter": { + "_id": 1 + }, + "replacement": { + "$set": { + "x": 22 + } + } + }, + "expectError": { + "isClientError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [] + } + ], + "outcome": [ + { + "collectionName": "coll1", + "databaseName": "crud-tests", + "documents": [ + { + "_id": 1, + "x": 11 + } + ] + } + ] + }, + { + "description": "readConcern majority with out stage", + "runOnRequirements": [ + { + "minServerVersion": "4.1.0", + "topologies": [ + "replicaset", + "sharded-replicaset" + ] + } + ], + "operations": [ + { + "name": "aggregate", + "object": "collection2", + "arguments": { + "pipeline": [ + { + "$sort": { + "x": 1 + } + }, + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$out": "aggregate_out" + } + ] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll2", + "pipeline": [ + { + "$sort": { + "x": 1 + } + }, + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$out": "aggregate_out" + } + ], + "readConcern": { + "level": "majority" + } + }, + "commandName": "aggregate", + "databaseName": "crud-tests" + } + } + ] + } + ], + "outcome": [ + { + "collectionName": "aggregate_out", + "databaseName": "crud-tests", + "documents": [ + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ] + }, + { + "description": "Aggregate with $listLocalSessions", + "runOnRequirements": [ + { + "minServerVersion": "3.6.0" + } + ], + "operations": [ + { + "name": "aggregate", + "object": "database1", + "arguments": { + "pipeline": [ + { + "$listLocalSessions": {} + }, + { + "$limit": 1 + }, + { + "$addFields": { + "dummy": "dummy field" + } + }, + { + "$project": { + "_id": 0, + "dummy": 1 + } + } + ] + }, + "expectResult": [ + { + "dummy": "dummy field" + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/valid-pass/poc-crud.yml b/test/spec/unified-test-format/valid-pass/poc-crud.yml new file mode 100644 index 0000000000..7d101a077a --- /dev/null +++ b/test/spec/unified-test-format/valid-pass/poc-crud.yml @@ -0,0 +1,183 @@ +description: "poc-crud" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name crud-tests + - database: + id: &database1 database1 + client: *client0 + databaseName: &database1Name admin + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name coll0 + - collection: + id: &collection1 collection1 + database: *database0 + collectionName: &collection1Name coll1 + - collection: + id: &collection2 collection2 + database: *database0 + collectionName: &collection2Name coll2 + collectionOptions: + readConcern: { level: majority } + +initialData: + - collectionName: *collection0Name + databaseName: *database0Name + documents: + - { _id: 1, x: 11 } + - { _id: 2, x: 22 } + - collectionName: *collection1Name + databaseName: *database0Name + documents: + - { _id: 1, x: 11 } + - collectionName: *collection2Name + databaseName: *database0Name + documents: + - { _id: 1, x: 11 } + - { _id: 2, x: 22 } + - { _id: 3, x: 33 } + - collectionName: &out aggregate_out + databaseName: *database0Name + documents: [] + +tests: + - description: "BulkWrite with mixed ordered operations" + operations: + - name: bulkWrite + object: *collection0 + arguments: + requests: + - insertOne: + document: { _id: 3, x: 33 } + - updateOne: + filter: { _id: 2 } + update: { $inc: { x: 1 } } + - updateMany: + filter: { _id: { $gt: 1 } } + update: { $inc: { x: 1 } } + - insertOne: + document: { _id: 4, x: 44 } + - deleteMany: + filter: { x: { $nin: [ 24, 34 ] } } + - replaceOne: + filter: { _id: 4 } + replacement: { _id: 4, x: 44 } + upsert: true + ordered: true + expectResult: + deletedCount: 2 + insertedCount: 2 + insertedIds: { $$unsetOrMatches: { 0: 3, 3: 4 } } + matchedCount: 3 + modifiedCount: 3 + upsertedCount: 1 + upsertedIds: { 5: 4 } + outcome: + - collectionName: *collection0Name + databaseName: *database0Name + documents: + - {_id: 2, x: 24 } + - {_id: 3, x: 34 } + - {_id: 4, x: 44 } + + - description: "InsertMany continue-on-error behavior with unordered (duplicate key in requests)" + operations: + - name: insertMany + object: *collection1 + arguments: + documents: + - { _id: 2, x: 22 } + - { _id: 2, x: 22 } + - { _id: 3, x: 33 } + ordered: false + expectError: + expectResult: + deletedCount: 0 + insertedCount: 2 + # Since the map of insertedIds is generated before execution it + # could indicate inserts that did not actually succeed. We omit + # this field rather than expect drivers to provide an accurate + # map filtered by write errors. + matchedCount: 0 + modifiedCount: 0 + upsertedCount: 0 + upsertedIds: { } + outcome: + - collectionName: *collection1Name + databaseName: *database0Name + documents: + - { _id: 1, x: 11 } + - { _id: 2, x: 22 } + - { _id: 3, x: 33 } + + - description: "ReplaceOne prohibits atomic modifiers" + operations: + - name: replaceOne + object: *collection1 + arguments: + filter: { _id: 1 } + replacement: { $set: { x: 22 }} + expectError: + isClientError: true + expectEvents: + - client: *client0 + events: [] + outcome: + - collectionName: *collection1Name + databaseName: *database0Name + documents: + - { _id: 1, x: 11 } + + - description: "readConcern majority with out stage" + runOnRequirements: + - minServerVersion: "4.1.0" + topologies: [ replicaset, sharded-replicaset ] + operations: + - name: aggregate + object: *collection2 + arguments: + pipeline: &pipeline + - $sort: { x : 1 } + - $match: { _id: { $gt: 1 } } + - $out: *out + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + aggregate: *collection2Name + pipeline: *pipeline + readConcern: { level: majority } + # The following two assertions were not in the original test + commandName: aggregate + databaseName: *database0Name + outcome: + - collectionName: *out + databaseName: *database0Name + documents: + - { _id: 2, x: 22 } + - { _id: 3, x: 33 } + + - description: "Aggregate with $listLocalSessions" + runOnRequirements: + - minServerVersion: "3.6.0" + operations: + - name: aggregate + object: *database1 + arguments: + pipeline: + - $listLocalSessions: { } + - $limit: 1 + - $addFields: { dummy: "dummy field"} + - $project: { _id: 0, dummy: 1} + expectResult: + - { dummy: "dummy field" } diff --git a/test/spec/unified-test-format/valid-pass/poc-gridfs.json b/test/spec/unified-test-format/valid-pass/poc-gridfs.json new file mode 100644 index 0000000000..1f07a19bf6 --- /dev/null +++ b/test/spec/unified-test-format/valid-pass/poc-gridfs.json @@ -0,0 +1,301 @@ +{ + "description": "poc-gridfs", + "schemaVersion": "1.0", + "createEntities": [ + { + "client": { + "id": "client0" + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "gridfs-tests" + } + }, + { + "bucket": { + "id": "bucket0", + "database": "database0" + } + }, + { + "collection": { + "id": "bucket0_files_collection", + "database": "database0", + "collectionName": "fs.files" + } + }, + { + "collection": { + "id": "bucket0_chunks_collection", + "database": "database0", + "collectionName": "fs.chunks" + } + } + ], + "initialData": [ + { + "collectionName": "fs.files", + "databaseName": "gridfs-tests", + "documents": [ + { + "_id": { + "$oid": "000000000000000000000005" + }, + "length": 10, + "chunkSize": 4, + "uploadDate": { + "$date": "1970-01-01T00:00:00.000Z" + }, + "md5": "57d83cd477bfb1ccd975ab33d827a92b", + "filename": "length-10", + "contentType": "application/octet-stream", + "aliases": [], + "metadata": {} + } + ] + }, + { + "collectionName": "fs.chunks", + "databaseName": "gridfs-tests", + "documents": [ + { + "_id": { + "$oid": "000000000000000000000005" + }, + "files_id": { + "$oid": "000000000000000000000005" + }, + "n": 0, + "data": { + "$binary": { + "base64": "ESIzRA==", + "subType": "00" + } + } + }, + { + "_id": { + "$oid": "000000000000000000000006" + }, + "files_id": { + "$oid": "000000000000000000000005" + }, + "n": 1, + "data": { + "$binary": { + "base64": "VWZ3iA==", + "subType": "00" + } + } + }, + { + "_id": { + "$oid": "000000000000000000000007" + }, + "files_id": { + "$oid": "000000000000000000000005" + }, + "n": 2, + "data": { + "$binary": { + "base64": "mao=", + "subType": "00" + } + } + } + ] + } + ], + "tests": [ + { + "description": "Delete when length is 10", + "operations": [ + { + "name": "delete", + "object": "bucket0", + "arguments": { + "id": { + "$oid": "000000000000000000000005" + } + } + } + ], + "outcome": [ + { + "collectionName": "fs.files", + "databaseName": "gridfs-tests", + "documents": [] + }, + { + "collectionName": "fs.chunks", + "databaseName": "gridfs-tests", + "documents": [] + } + ] + }, + { + "description": "Download when there are three chunks", + "operations": [ + { + "name": "download", + "object": "bucket0", + "arguments": { + "id": { + "$oid": "000000000000000000000005" + } + }, + "expectResult": { + "$$matchesHexBytes": "112233445566778899aa" + } + } + ] + }, + { + "description": "Download when files entry does not exist", + "operations": [ + { + "name": "download", + "object": "bucket0", + "arguments": { + "id": { + "$oid": "000000000000000000000000" + } + }, + "expectError": { + "isError": true + } + } + ] + }, + { + "description": "Download when an intermediate chunk is missing", + "operations": [ + { + "name": "deleteOne", + "object": "bucket0_chunks_collection", + "arguments": { + "filter": { + "files_id": { + "$oid": "000000000000000000000005" + }, + "n": 1 + } + }, + "expectResult": { + "deletedCount": 1 + } + }, + { + "name": "download", + "object": "bucket0", + "arguments": { + "id": { + "$oid": "000000000000000000000005" + } + }, + "expectError": { + "isError": true + } + } + ] + }, + { + "description": "Upload when length is 5", + "operations": [ + { + "name": "upload", + "object": "bucket0", + "arguments": { + "filename": "filename", + "source": { + "$$hexBytes": "1122334455" + }, + "chunkSizeBytes": 4 + }, + "expectResult": { + "$$type": "objectId" + }, + "saveResultAsEntity": "oid0" + }, + { + "name": "find", + "object": "bucket0_files_collection", + "arguments": { + "filter": {}, + "sort": { + "uploadDate": -1 + }, + "limit": 1 + }, + "expectResult": [ + { + "_id": { + "$$matchesEntity": "oid0" + }, + "length": 5, + "chunkSize": 4, + "uploadDate": { + "$$type": "date" + }, + "md5": { + "$$unsetOrMatches": "283d4fea5dded59cf837d3047328f5af" + }, + "filename": "filename" + } + ] + }, + { + "name": "find", + "object": "bucket0_chunks_collection", + "arguments": { + "filter": { + "_id": { + "$gt": { + "$oid": "000000000000000000000007" + } + } + }, + "sort": { + "n": 1 + } + }, + "expectResult": [ + { + "_id": { + "$$type": "objectId" + }, + "files_id": { + "$$matchesEntity": "oid0" + }, + "n": 0, + "data": { + "$binary": { + "base64": "ESIzRA==", + "subType": "00" + } + } + }, + { + "_id": { + "$$type": "objectId" + }, + "files_id": { + "$$matchesEntity": "oid0" + }, + "n": 1, + "data": { + "$binary": { + "base64": "VQ==", + "subType": "00" + } + } + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/valid-pass/poc-gridfs.yml b/test/spec/unified-test-format/valid-pass/poc-gridfs.yml new file mode 100644 index 0000000000..9f60537420 --- /dev/null +++ b/test/spec/unified-test-format/valid-pass/poc-gridfs.yml @@ -0,0 +1,155 @@ +description: "poc-gridfs" + +schemaVersion: "1.0" + +createEntities: + - client: + id: &client0 client0 + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name gridfs-tests + - bucket: + id: &bucket0 bucket0 + database: *database0 + - collection: + id: &bucket0_files_collection bucket0_files_collection + database: *database0 + collectionName: &bucket0_files_collectionName fs.files + - collection: + id: &bucket0_chunks_collection bucket0_chunks_collection + database: *database0 + collectionName: &bucket0_chunks_collectionName fs.chunks + +initialData: + - collectionName: *bucket0_files_collectionName + databaseName: *database0Name + documents: + - _id: { $oid: "000000000000000000000005" } + length: 10 + chunkSize: 4 + uploadDate: { $date: "1970-01-01T00:00:00.000Z" } + md5: "57d83cd477bfb1ccd975ab33d827a92b" + filename: "length-10" + contentType: "application/octet-stream" + aliases: [] + metadata: {} + - collectionName: *bucket0_chunks_collectionName + databaseName: *database0Name + documents: + - _id: { $oid: "000000000000000000000005" } + files_id: { $oid: "000000000000000000000005" } + n: 0 + data: { $binary: { base64: "ESIzRA==", subType: "00" } } # hex: 11223344 + - _id: { $oid: "000000000000000000000006" } + files_id: { $oid: "000000000000000000000005" } + n: 1 + data: { $binary: { base64: "VWZ3iA==", subType: "00" } } # hex: 55667788 + - _id: { $oid: "000000000000000000000007" } + files_id: { $oid: "000000000000000000000005" } + n: 2 + data: { $binary: { base64: "mao=", subType: "00" } } # hex: 99aa + +tests: + # Changed from original test ("length is 8") to operate on same initialData + - description: "Delete when length is 10" + operations: + - name: delete + object: *bucket0 + arguments: + id: { $oid: "000000000000000000000005" } + # Original test uses "assert.data" syntax to modify outcome collection for + # comparison. This can be accomplished using "outcome" directly. + outcome: + - collectionName: *bucket0_files_collectionName + databaseName: *database0Name + documents: [] + - collectionName: *bucket0_chunks_collectionName + databaseName: *database0Name + documents: [] + + - description: "Download when there are three chunks" + operations: + # Original test uses "download" operation. We use an explicit operation + # that returns a stream and then assert the contents of that stream. + - name: download + object: *bucket0 + arguments: + id: { $oid: "000000000000000000000005" } + expectResult: { $$matchesHexBytes: "112233445566778899aa" } + + - description: "Download when files entry does not exist" + operations: + - name: download + object: *bucket0 + arguments: + id: { $oid: "000000000000000000000000" } + # Original test expects "FileNotFound" error, which isn't specified + expectError: { isError: true } + + - description: "Download when an intermediate chunk is missing" + operations: + # Original test uses "arrange" syntax to modify initialData. This can be + # accomplished as a delete operation on the chunks collection. + - name: deleteOne + object: *bucket0_chunks_collection + arguments: + filter: + files_id: { $oid: "000000000000000000000005" } + n: 1 + expectResult: + deletedCount: 1 + - name: download + object: *bucket0 + arguments: + id: { $oid: "000000000000000000000005" } + # Original test expects "ChunkIsMissing" error, which isn't specified + expectError: { isError: true } + + - description: "Upload when length is 5" + operations: + # Original test uses "upload" operation. We use an explicit operation + # that takes a stream, which has been created from the expected hex bytes. + - name: upload + object: *bucket0 + arguments: + filename: filename + source: { $$hexBytes: "1122334455" } + chunkSizeBytes: 4 + # Original test references the result directly in "assert.data". Here, + # we need to save the result as an entity, which we can later reference. + expectResult: { $$type: objectId } + saveResultAsEntity: &oid0 oid0 + # "outcome" does not allow operators, but we can perform the assertions + # with separate find operations. + - name: find + object: *bucket0_files_collection + arguments: + filter: {} + sort: { uploadDate: -1 } + limit: 1 + expectResult: + - _id: { $$matchesEntity: *oid0 } + length: 5 + chunkSize: 4 + uploadDate: { $$type: date } + # The md5 field is deprecated so some drivers do not calculate it when uploading files. + md5: { $$unsetOrMatches: "283d4fea5dded59cf837d3047328f5af" } + filename: filename + - name: find + object: *bucket0_chunks_collection + arguments: + # We cannot use the saved ObjectId when querying, but filtering by a + # non-zero timestamp will exclude initialData and sort can return the + # expected chunks in order. + filter: { _id: { $gt: { $oid: "000000000000000000000007" } } } + sort: { n: 1 } + expectResult: + - _id: { $$type: objectId } + files_id: { $$matchesEntity: *oid0 } + n: 0 + data: { $binary: { base64: "ESIzRA==", subType: "00" } } # hex 11223344 + - _id: { $$type: objectId } + files_id: { $$matchesEntity: *oid0 } + n: 1 + data: { $binary: { base64: "VQ==", subType: "00" } } # hex 55 diff --git a/test/spec/unified-test-format/valid-pass/poc-retryable-reads.json b/test/spec/unified-test-format/valid-pass/poc-retryable-reads.json new file mode 100644 index 0000000000..2b65d501a7 --- /dev/null +++ b/test/spec/unified-test-format/valid-pass/poc-retryable-reads.json @@ -0,0 +1,433 @@ +{ + "description": "poc-retryable-reads", + "schemaVersion": "1.0", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "single", + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "client": { + "id": "client1", + "uriOptions": { + "retryReads": false + }, + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-reads-tests" + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-reads-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-reads-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "tests": [ + { + "description": "Aggregate succeeds after InterruptedAtShutdown", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "aggregate" + ], + "errorCode": 11600 + } + } + } + }, + { + "name": "aggregate", + "object": "collection0", + "arguments": { + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "expectResult": [ + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "aggregate": "coll", + "pipeline": [ + { + "$match": { + "_id": { + "$gt": 1 + } + } + }, + { + "$sort": { + "x": 1 + } + } + ] + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Find succeeds on second attempt", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "closeConnection": true + } + } + } + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 2 + }, + "expectResult": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + } + ] + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 2 + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {}, + "sort": { + "_id": 1 + }, + "limit": 2 + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Find fails on first attempt", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "find" + ], + "closeConnection": true + } + } + } + }, + { + "name": "find", + "object": "collection1", + "arguments": { + "filter": {} + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {} + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "Find fails on second attempt", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "find" + ], + "closeConnection": true + } + } + } + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "filter": {} + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {} + }, + "databaseName": "retryable-reads-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "coll", + "filter": {} + }, + "databaseName": "retryable-reads-tests" + } + } + ] + } + ] + }, + { + "description": "ListDatabases succeeds on second attempt", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "listDatabases" + ], + "closeConnection": true + } + } + } + }, + { + "name": "listDatabases", + "object": "client0" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + }, + { + "commandStartedEvent": { + "command": { + "listDatabases": 1 + } + } + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/valid-pass/poc-retryable-reads.yml b/test/spec/unified-test-format/valid-pass/poc-retryable-reads.yml new file mode 100644 index 0000000000..c1ea7ec696 --- /dev/null +++ b/test/spec/unified-test-format/valid-pass/poc-retryable-reads.yml @@ -0,0 +1,193 @@ +description: "poc-retryable-reads" + +schemaVersion: "1.0" + +runOnRequirements: + - minServerVersion: "4.0" + topologies: [ single, replicaset ] + - minServerVersion: "4.1.7" + topologies: [ sharded ] + +createEntities: + - client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: [ commandStartedEvent ] + - client: + id: &client1 client1 + uriOptions: { retryReads: false } + useMultipleMongoses: false + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &databaseName retryable-reads-tests + - database: + id: &database1 database1 + client: *client1 + databaseName: *databaseName + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collectionName coll + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collectionName + +initialData: + - collectionName: *collectionName + databaseName: *databaseName + documents: + - {_id: 1, x: 11} + - {_id: 2, x: 22} + - {_id: 3, x: 33} + +tests: + - description: "Aggregate succeeds after InterruptedAtShutdown" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: { times: 1 } + data: + failCommands: [ aggregate ] + errorCode: 11600 # InterruptedAtShutdown + - name: aggregate + object: *collection0 + arguments: + pipeline: &pipeline + - $match: { _id: { $gt: 1 } } + - $sort: { x: 1 } + expectResult: + - { _id: 2, x: 22 } + - { _id: 3, x: 33 } + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + aggregate: *collectionName + pipeline: *pipeline + databaseName: *databaseName + - commandStartedEvent: + command: + aggregate: *collectionName + pipeline: *pipeline + databaseName: *databaseName + + - description: "Find succeeds on second attempt" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: { times: 1 } + data: + failCommands: [ find ] + closeConnection: true + # Find options and expected result changed to use common initialData + - name: find + object: collection0 + arguments: + filter: {} + sort: { _id: 1 } + limit: 2 + expectResult: + - { _id: 1, x: 11 } + - { _id: 2, x: 22 } + expectEvents: + - client: *client0 + events: + - &findAttempt + commandStartedEvent: + command: + find: *collectionName + filter: {} + sort: { _id: 1 } + limit: 2 + databaseName: *databaseName + - *findAttempt + + - description: "Find fails on first attempt" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: { times: 1 } + data: + failCommands: [ find ] + closeConnection: true + - name: find + object: collection1 # client uses retryReads=false + arguments: + filter: {} + # Other arguments in the original test are not relevant + expectError: { isError: true } + expectEvents: + - client: *client1 + events: + - commandStartedEvent: + command: + find: *collectionName + filter: {} + databaseName: *databaseName + + - description: "Find fails on second attempt" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ find ] + closeConnection: true + - name: find + object: collection0 + arguments: + filter: {} + # Other arguments in the original test are not relevant + expectError: { isError: true } + expectEvents: + - client: *client0 + events: + - &findAttempt + commandStartedEvent: + command: + find: *collectionName + filter: {} + databaseName: *databaseName + - *findAttempt + + - description: "ListDatabases succeeds on second attempt" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: { times: 1 } + data: + failCommands: [ listDatabases ] + closeConnection: true + - name: listDatabases + object: *client0 + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: { listDatabases: 1 } + - commandStartedEvent: + command: { listDatabases: 1 } diff --git a/test/spec/unified-test-format/valid-pass/poc-retryable-writes.json b/test/spec/unified-test-format/valid-pass/poc-retryable-writes.json new file mode 100644 index 0000000000..30c1d54152 --- /dev/null +++ b/test/spec/unified-test-format/valid-pass/poc-retryable-writes.json @@ -0,0 +1,485 @@ +{ + "description": "poc-retryable-writes", + "schemaVersion": "1.0", + "runOnRequirements": [ + { + "minServerVersion": "3.6", + "topologies": [ + "replicaset" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "client": { + "id": "client1", + "uriOptions": { + "retryWrites": false + }, + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "retryable-writes-tests" + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "retryable-writes-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "coll" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "coll" + } + } + ], + "initialData": [ + { + "collectionName": "coll", + "databaseName": "retryable-writes-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + } + ] + } + ], + "tests": [ + { + "description": "FindOneAndUpdate is committed on first attempt", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "onPrimaryTransactionalWrite", + "mode": { + "times": 1 + } + } + } + }, + { + "name": "findOneAndUpdate", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + }, + "update": { + "$inc": { + "x": 1 + } + }, + "returnDocument": "Before" + }, + "expectResult": { + "_id": 1, + "x": 11 + } + } + ], + "outcome": [ + { + "collectionName": "coll", + "databaseName": "retryable-writes-tests", + "documents": [ + { + "_id": 1, + "x": 12 + }, + { + "_id": 2, + "x": 22 + } + ] + } + ] + }, + { + "description": "FindOneAndUpdate is not committed on first attempt", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "onPrimaryTransactionalWrite", + "mode": { + "times": 1 + }, + "data": { + "failBeforeCommitExceptionCode": 1 + } + } + } + }, + { + "name": "findOneAndUpdate", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + }, + "update": { + "$inc": { + "x": 1 + } + }, + "returnDocument": "Before" + }, + "expectResult": { + "_id": 1, + "x": 11 + } + } + ], + "outcome": [ + { + "collectionName": "coll", + "databaseName": "retryable-writes-tests", + "documents": [ + { + "_id": 1, + "x": 12 + }, + { + "_id": 2, + "x": 22 + } + ] + } + ] + }, + { + "description": "FindOneAndUpdate is never committed", + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "onPrimaryTransactionalWrite", + "mode": { + "times": 2 + }, + "data": { + "failBeforeCommitExceptionCode": 1 + } + } + } + }, + { + "name": "findOneAndUpdate", + "object": "collection0", + "arguments": { + "filter": { + "_id": 1 + }, + "update": { + "$inc": { + "x": 1 + } + }, + "returnDocument": "Before" + }, + "expectError": { + "isError": true + } + } + ], + "outcome": [ + { + "collectionName": "coll", + "databaseName": "retryable-writes-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + } + ] + } + ] + }, + { + "description": "InsertMany succeeds after PrimarySteppedDown", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded-replicaset" + ] + } + ], + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "insert" + ], + "errorCode": 189, + "errorLabels": [ + "RetryableWriteError" + ] + } + } + } + }, + { + "name": "insertMany", + "object": "collection0", + "arguments": { + "documents": [ + { + "_id": 3, + "x": 33 + }, + { + "_id": 4, + "x": 44 + } + ], + "ordered": true + }, + "expectResult": { + "$$unsetOrMatches": { + "insertedCount": { + "$$unsetOrMatches": 2 + }, + "insertedIds": { + "$$unsetOrMatches": { + "0": 3, + "1": 4 + } + } + } + } + } + ], + "outcome": [ + { + "collectionName": "coll", + "databaseName": "retryable-writes-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + }, + { + "_id": 4, + "x": 44 + } + ] + } + ] + }, + { + "description": "InsertOne fails after connection failure when retryWrites option is false", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded-replicaset" + ] + } + ], + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client1", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "insert" + ], + "closeConnection": true + } + } + } + }, + { + "name": "insertOne", + "object": "collection1", + "arguments": { + "document": { + "_id": 3, + "x": 33 + } + }, + "expectError": { + "errorLabelsOmit": [ + "RetryableWriteError" + ] + } + } + ], + "outcome": [ + { + "collectionName": "coll", + "databaseName": "retryable-writes-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + } + ] + } + ] + }, + { + "description": "InsertOne fails after multiple retryable writeConcernErrors", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "replicaset" + ] + }, + { + "minServerVersion": "4.1.7", + "topologies": [ + "sharded-replicaset" + ] + } + ], + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 2 + }, + "data": { + "failCommands": [ + "insert" + ], + "writeConcernError": { + "code": 91, + "errmsg": "Replication is being shut down" + } + } + } + } + }, + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "document": { + "_id": 3, + "x": 33 + } + }, + "expectError": { + "errorLabelsContain": [ + "RetryableWriteError" + ] + } + } + ], + "outcome": [ + { + "collectionName": "coll", + "databaseName": "retryable-writes-tests", + "documents": [ + { + "_id": 1, + "x": 11 + }, + { + "_id": 2, + "x": 22 + }, + { + "_id": 3, + "x": 33 + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/valid-pass/poc-retryable-writes.yml b/test/spec/unified-test-format/valid-pass/poc-retryable-writes.yml new file mode 100644 index 0000000000..0a6bfe6c2e --- /dev/null +++ b/test/spec/unified-test-format/valid-pass/poc-retryable-writes.yml @@ -0,0 +1,209 @@ +description: "poc-retryable-writes" + +schemaVersion: "1.0" + +runOnRequirements: + - minServerVersion: "3.6" + topologies: [ replicaset ] + +createEntities: + - client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: [ commandStartedEvent ] + - client: + id: &client1 client1 + uriOptions: { retryWrites: false } + useMultipleMongoses: false + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &databaseName retryable-writes-tests + - database: + id: &database1 database1 + client: *client1 + databaseName: *databaseName + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collectionName coll + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collectionName + +initialData: + - collectionName: *collectionName + databaseName: *databaseName + documents: + - { _id: 1, x: 11 } + - { _id: 2, x: 22 } + +tests: + - description: "FindOneAndUpdate is committed on first attempt" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client0 + failPoint: + configureFailPoint: onPrimaryTransactionalWrite + mode: { times: 1 } + - name: findOneAndUpdate + object: *collection0 + arguments: + filter: { _id: 1 } + update: { $inc: { x : 1 } } + returnDocument: Before + expectResult: { _id: 1, x: 11 } + outcome: + - collectionName: *collectionName + databaseName: *databaseName + documents: + - { _id: 1, x: 12 } + - { _id: 2, x: 22 } + + - description: "FindOneAndUpdate is not committed on first attempt" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client0 + failPoint: + configureFailPoint: onPrimaryTransactionalWrite + mode: { times: 1 } + data: { failBeforeCommitExceptionCode: 1 } + - name: findOneAndUpdate + object: *collection0 + arguments: + filter: { _id: 1 } + update: { $inc: { x : 1 } } + returnDocument: Before + expectResult: { _id: 1, x: 11 } + outcome: + - collectionName: *collectionName + databaseName: *databaseName + documents: + - { _id: 1, x: 12 } + - { _id: 2, x: 22 } + + - description: "FindOneAndUpdate is never committed" + operations: + - name: failPoint + object: testRunner + arguments: + client: *client0 + failPoint: + configureFailPoint: onPrimaryTransactionalWrite + mode: { times: 2 } + data: { failBeforeCommitExceptionCode: 1 } + - name: findOneAndUpdate + object: *collection0 + arguments: + filter: { _id: 1 } + update: { $inc: { x : 1 } } + returnDocument: Before + expectError: { isError: true } + outcome: + - collectionName: *collectionName + databaseName: *databaseName + documents: + - { _id: 1, x: 11 } + - { _id: 2, x: 22 } + + - description: "InsertMany succeeds after PrimarySteppedDown" + runOnRequirements: &failCommand_requirements + - minServerVersion: "4.0" + topologies: [ replicaset ] + - minServerVersion: "4.1.7" + # Original test uses "sharded", but retryable writes requires a sharded + # cluster backed by replica sets + topologies: [ sharded-replicaset ] + operations: + - name: failPoint + object: testRunner + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: { times: 1 } + data: + failCommands: [ insert ] + errorCode: 189 # PrimarySteppedDown + errorLabels: [ RetryableWriteError ] + - name: insertMany + object: *collection0 + arguments: + documents: + # Documents are modified from original test for "initialData" + - { _id: 3, x: 33 } + - { _id: 4, x: 44 } + ordered: true + expectResult: + { $$unsetOrMatches: { insertedCount: { $$unsetOrMatches: 2 } }, insertedIds: { $$unsetOrMatches: { 0: 3, 1: 4 } } } + outcome: + - collectionName: *collectionName + databaseName: *databaseName + documents: + - { _id: 1, x: 11 } + - { _id: 2, x: 22 } + - { _id: 3, x: 33 } + - { _id: 4, x: 44 } + + - description: "InsertOne fails after connection failure when retryWrites option is false" + runOnRequirements: *failCommand_requirements + operations: + - name: failPoint + object: testRunner + arguments: + client: *client1 + failPoint: + configureFailPoint: failCommand + mode: { times: 1 } + data: + failCommands: [ insert ] + closeConnection: true + - name: insertOne + object: *collection1 + arguments: + document: { _id: 3, x: 33 } + expectError: + # If retryWrites is false, the driver should not add the + # RetryableWriteError label to the error. + errorLabelsOmit: [ RetryableWriteError ] + outcome: + - collectionName: *collectionName + databaseName: *databaseName + documents: + - { _id: 1, x: 11 } + - { _id: 2, x: 22 } + + - description: "InsertOne fails after multiple retryable writeConcernErrors" + runOnRequirements: *failCommand_requirements + operations: + - name: failPoint + object: testRunner + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: { times: 2 } + data: + failCommands: [ insert ] + writeConcernError: + code: 91 # ShutdownInProgress + errmsg: "Replication is being shut down" + - name: insertOne + object: *collection0 + arguments: + document: { _id: 3, x: 33 } + expectError: + errorLabelsContain: [ RetryableWriteError ] + outcome: + - collectionName: *collectionName + databaseName: *databaseName + documents: + - { _id: 1, x: 11 } + - { _id: 2, x: 22 } + - { _id: 3, x: 33 } # The write was still applied diff --git a/test/spec/unified-test-format/valid-pass/poc-sessions.json b/test/spec/unified-test-format/valid-pass/poc-sessions.json new file mode 100644 index 0000000000..75f3489428 --- /dev/null +++ b/test/spec/unified-test-format/valid-pass/poc-sessions.json @@ -0,0 +1,466 @@ +{ + "description": "poc-sessions", + "schemaVersion": "1.0", + "runOnRequirements": [ + { + "minServerVersion": "3.6.0" + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": false, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "session-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "test" + } + }, + { + "session": { + "id": "session0", + "client": "client0" + } + } + ], + "initialData": [ + { + "collectionName": "test", + "databaseName": "session-tests", + "documents": [ + { + "_id": 1 + } + ] + } + ], + "tests": [ + { + "description": "Server supports explicit sessions", + "operations": [ + { + "name": "assertSessionNotDirty", + "object": "testRunner", + "arguments": { + "session": "session0" + } + }, + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "session": "session0", + "document": { + "_id": 2 + } + }, + "expectResult": { + "$$unsetOrMatches": { + "insertedId": { + "$$unsetOrMatches": 2 + } + } + } + }, + { + "name": "assertSessionNotDirty", + "object": "testRunner", + "arguments": { + "session": "session0" + } + }, + { + "name": "endSession", + "object": "session0" + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "filter": { + "_id": -1 + } + }, + "expectResult": [] + }, + { + "name": "assertSameLsidOnLastTwoCommands", + "object": "testRunner", + "arguments": { + "client": "client0" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "insert": "test", + "documents": [ + { + "_id": 2 + } + ], + "ordered": true, + "lsid": { + "$$sessionLsid": "session0" + } + }, + "commandName": "insert", + "databaseName": "session-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "test", + "filter": { + "_id": -1 + }, + "lsid": { + "$$sessionLsid": "session0" + } + }, + "commandName": "find", + "databaseName": "session-tests" + } + } + ] + } + ], + "outcome": [ + { + "collectionName": "test", + "databaseName": "session-tests", + "documents": [ + { + "_id": 1 + }, + { + "_id": 2 + } + ] + } + ] + }, + { + "description": "Server supports implicit sessions", + "operations": [ + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "document": { + "_id": 2 + } + }, + "expectResult": { + "$$unsetOrMatches": { + "insertedId": { + "$$unsetOrMatches": 2 + } + } + } + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "filter": { + "_id": -1 + } + }, + "expectResult": [] + }, + { + "name": "assertSameLsidOnLastTwoCommands", + "object": "testRunner", + "arguments": { + "client": "client0" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "insert": "test", + "documents": [ + { + "_id": 2 + } + ], + "ordered": true, + "lsid": { + "$$type": "object" + } + }, + "commandName": "insert", + "databaseName": "session-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "test", + "filter": { + "_id": -1 + }, + "lsid": { + "$$type": "object" + } + }, + "commandName": "find", + "databaseName": "session-tests" + } + } + ] + } + ], + "outcome": [ + { + "collectionName": "test", + "databaseName": "session-tests", + "documents": [ + { + "_id": 1 + }, + { + "_id": 2 + } + ] + } + ] + }, + { + "description": "Dirty explicit session is discarded", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "replicaset" + ] + }, + { + "minServerVersion": "4.1.8", + "topologies": [ + "sharded-replicaset" + ] + } + ], + "operations": [ + { + "name": "failPoint", + "object": "testRunner", + "arguments": { + "client": "client0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "insert" + ], + "closeConnection": true + } + } + } + }, + { + "name": "assertSessionNotDirty", + "object": "testRunner", + "arguments": { + "session": "session0" + } + }, + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "session": "session0", + "document": { + "_id": 2 + } + }, + "expectResult": { + "$$unsetOrMatches": { + "insertedId": { + "$$unsetOrMatches": 2 + } + } + } + }, + { + "name": "assertSessionDirty", + "object": "testRunner", + "arguments": { + "session": "session0" + } + }, + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "session": "session0", + "document": { + "_id": 3 + } + }, + "expectResult": { + "$$unsetOrMatches": { + "insertedId": { + "$$unsetOrMatches": 3 + } + } + } + }, + { + "name": "assertSessionDirty", + "object": "testRunner", + "arguments": { + "session": "session0" + } + }, + { + "name": "endSession", + "object": "session0" + }, + { + "name": "find", + "object": "collection0", + "arguments": { + "filter": { + "_id": -1 + } + }, + "expectResult": [] + }, + { + "name": "assertDifferentLsidOnLastTwoCommands", + "object": "testRunner", + "arguments": { + "client": "client0" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "insert": "test", + "documents": [ + { + "_id": 2 + } + ], + "ordered": true, + "lsid": { + "$$sessionLsid": "session0" + }, + "txnNumber": 1 + }, + "commandName": "insert", + "databaseName": "session-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "insert": "test", + "documents": [ + { + "_id": 2 + } + ], + "ordered": true, + "lsid": { + "$$sessionLsid": "session0" + }, + "txnNumber": 1 + }, + "commandName": "insert", + "databaseName": "session-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "insert": "test", + "documents": [ + { + "_id": 3 + } + ], + "ordered": true, + "lsid": { + "$$sessionLsid": "session0" + }, + "txnNumber": 2 + }, + "commandName": "insert", + "databaseName": "session-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "find": "test", + "filter": { + "_id": -1 + }, + "lsid": { + "$$type": "object" + } + }, + "commandName": "find", + "databaseName": "session-tests" + } + } + ] + } + ], + "outcome": [ + { + "collectionName": "test", + "databaseName": "session-tests", + "documents": [ + { + "_id": 1 + }, + { + "_id": 2 + }, + { + "_id": 3 + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/valid-pass/poc-sessions.yml b/test/spec/unified-test-format/valid-pass/poc-sessions.yml new file mode 100644 index 0000000000..cb16657da3 --- /dev/null +++ b/test/spec/unified-test-format/valid-pass/poc-sessions.yml @@ -0,0 +1,214 @@ +description: "poc-sessions" + +schemaVersion: "1.0" + +runOnRequirements: + - minServerVersion: "3.6.0" + +createEntities: + - client: + id: &client0 client0 + useMultipleMongoses: false + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name session-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name test + - session: + id: &session0 session0 + client: *client0 + +initialData: + - collectionName: *collection0Name + databaseName: *database0Name + documents: + - { _id: 1 } + +tests: + - description: "Server supports explicit sessions" + operations: + - name: assertSessionNotDirty + object: testRunner + arguments: + session: *session0 + - name: insertOne + object: *collection0 + arguments: + session: *session0 + document: { _id: 2 } + expectResult: { $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 2 } } } + - name: assertSessionNotDirty + object: testRunner + arguments: + session: *session0 + - name: endSession + object: *session0 + - &find_with_implicit_session + name: find + object: *collection0 + arguments: + filter: { _id: -1 } + expectResult: [] + - name: assertSameLsidOnLastTwoCommands + object: testRunner + arguments: + client: *client0 + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + insert: *collection0Name + documents: [ { _id: 2 } ] + ordered: true + lsid: { $$sessionLsid: *session0 } + commandName: insert + databaseName: *database0Name + - commandStartedEvent: + command: + find: *collection0Name + filter: { _id: -1 } + lsid: { $$sessionLsid: *session0 } + commandName: find + databaseName: *database0Name + outcome: + - collectionName: *collection0Name + databaseName: *database0Name + documents: + - { _id: 1 } + - { _id: 2 } + + - description: "Server supports implicit sessions" + operations: + - name: insertOne + object: *collection0 + arguments: + document: { _id: 2 } + expectResult: { $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 2 } } } + - *find_with_implicit_session + - name: assertSameLsidOnLastTwoCommands + object: testRunner + arguments: + client: *client0 + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + insert: *collection0Name + documents: + - { _id: 2 } + ordered: true + # Original test did not include any assertion, but we can use + # $$type to expect an arbitrary lsid document + lsid: { $$type: object } + commandName: insert + databaseName: *database0Name + - commandStartedEvent: + command: + find: *collection0Name + filter: { _id: -1 } + lsid: { $$type: object } + commandName: find + databaseName: *database0Name + outcome: + - collectionName: *collection0Name + databaseName: *database0Name + documents: + - { _id: 1 } + - { _id: 2 } + + - description: "Dirty explicit session is discarded" + # Original test specified retryWrites=true, but that is now the default. + # Retryable writes will require a sharded-replicaset, though. + runOnRequirements: + - minServerVersion: "4.0" + topologies: [ replicaset ] + - minServerVersion: "4.1.8" + topologies: [ sharded-replicaset ] + operations: + - name: failPoint + object: testRunner + arguments: + client: *client0 + failPoint: + configureFailPoint: failCommand + mode: { times: 1 } + data: + failCommands: [ insert ] + closeConnection: true + - name: assertSessionNotDirty + object: testRunner + arguments: + session: *session0 + - name: insertOne + object: *collection0 + arguments: + session: *session0 + document: { _id: 2 } + expectResult: { $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 2 } } } + - name: assertSessionDirty + object: testRunner + arguments: + session: *session0 + - name: insertOne + object: *collection0 + arguments: + session: *session0 + document: { _id: 3 } + expectResult: { $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 3 } } } + - name: assertSessionDirty + object: testRunner + arguments: + session: *session0 + - name: endSession + object: *session0 + - *find_with_implicit_session + - name: assertDifferentLsidOnLastTwoCommands + object: testRunner + arguments: + client: *client0 + expectEvents: + - client: *client0 + events: + # ajv's YAML parser is unable to handle anchors on array elements, so + # we define an anchor on the commandStartedEvent object instead + - commandStartedEvent: &insert_attempt + command: + insert: *collection0Name + documents: + - { _id: 2 } + ordered: true + lsid: { $$sessionLsid: *session0 } + txnNumber: 1 + commandName: insert + databaseName: *database0Name + - commandStartedEvent: *insert_attempt + - commandStartedEvent: + command: + insert: *collection0Name + documents: + - { _id: 3 } + ordered: true + lsid: { $$sessionLsid: *session0 } + txnNumber: 2 + commandName: insert + databaseName: *database0Name + - commandStartedEvent: + command: + find: *collection0Name + filter: { _id: -1 } + lsid: { $$type: object } + commandName: find + databaseName: *database0Name + outcome: + - collectionName: *collection0Name + databaseName: *database0Name + documents: + - { _id: 1 } + - { _id: 2 } + - { _id: 3 } diff --git a/test/spec/unified-test-format/valid-pass/poc-transactions-convenient-api.json b/test/spec/unified-test-format/valid-pass/poc-transactions-convenient-api.json new file mode 100644 index 0000000000..820ed65927 --- /dev/null +++ b/test/spec/unified-test-format/valid-pass/poc-transactions-convenient-api.json @@ -0,0 +1,505 @@ +{ + "description": "poc-transactions-convenient-api", + "schemaVersion": "1.0", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "replicaset" + ] + }, + { + "minServerVersion": "4.1.8", + "topologies": [ + "sharded-replicaset" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": true, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "client": { + "id": "client1", + "uriOptions": { + "readConcernLevel": "local", + "w": 1 + }, + "useMultipleMongoses": true, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "transaction-tests" + } + }, + { + "database": { + "id": "database1", + "client": "client1", + "databaseName": "transaction-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "test" + } + }, + { + "collection": { + "id": "collection1", + "database": "database1", + "collectionName": "test" + } + }, + { + "session": { + "id": "session0", + "client": "client0" + } + }, + { + "session": { + "id": "session1", + "client": "client1" + } + }, + { + "session": { + "id": "session2", + "client": "client0", + "sessionOptions": { + "defaultTransactionOptions": { + "readConcern": { + "level": "majority" + }, + "writeConcern": { + "w": 1 + } + } + } + } + } + ], + "initialData": [ + { + "collectionName": "test", + "databaseName": "transaction-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "withTransaction and no transaction options set", + "operations": [ + { + "name": "withTransaction", + "object": "session0", + "arguments": { + "callback": [ + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "session": "session0", + "document": { + "_id": 1 + } + }, + "expectResult": { + "$$unsetOrMatches": { + "insertedId": { + "$$unsetOrMatches": 1 + } + } + } + } + ] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "insert": "test", + "documents": [ + { + "_id": 1 + } + ], + "ordered": true, + "lsid": { + "$$sessionLsid": "session0" + }, + "txnNumber": 1, + "startTransaction": true, + "autocommit": false, + "readConcern": { + "$$exists": false + }, + "writeConcern": { + "$$exists": false + } + }, + "commandName": "insert", + "databaseName": "transaction-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "commitTransaction": 1, + "lsid": { + "$$sessionLsid": "session0" + }, + "txnNumber": 1, + "autocommit": false, + "readConcern": { + "$$exists": false + }, + "startTransaction": { + "$$exists": false + }, + "writeConcern": { + "$$exists": false + } + }, + "commandName": "commitTransaction", + "databaseName": "admin" + } + } + ] + } + ], + "outcome": [ + { + "collectionName": "test", + "databaseName": "transaction-tests", + "documents": [ + { + "_id": 1 + } + ] + } + ] + }, + { + "description": "withTransaction inherits transaction options from client", + "operations": [ + { + "name": "withTransaction", + "object": "session1", + "arguments": { + "callback": [ + { + "name": "insertOne", + "object": "collection1", + "arguments": { + "session": "session1", + "document": { + "_id": 1 + } + }, + "expectResult": { + "$$unsetOrMatches": { + "insertedId": { + "$$unsetOrMatches": 1 + } + } + } + } + ] + } + } + ], + "expectEvents": [ + { + "client": "client1", + "events": [ + { + "commandStartedEvent": { + "command": { + "insert": "test", + "documents": [ + { + "_id": 1 + } + ], + "ordered": true, + "lsid": { + "$$sessionLsid": "session1" + }, + "txnNumber": 1, + "startTransaction": true, + "autocommit": false, + "readConcern": { + "level": "local" + }, + "writeConcern": { + "$$exists": false + } + }, + "commandName": "insert", + "databaseName": "transaction-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "commitTransaction": 1, + "lsid": { + "$$sessionLsid": "session1" + }, + "txnNumber": 1, + "autocommit": false, + "writeConcern": { + "w": 1 + }, + "readConcern": { + "$$exists": false + }, + "startTransaction": { + "$$exists": false + } + }, + "commandName": "commitTransaction", + "databaseName": "admin" + } + } + ] + } + ], + "outcome": [ + { + "collectionName": "test", + "databaseName": "transaction-tests", + "documents": [ + { + "_id": 1 + } + ] + } + ] + }, + { + "description": "withTransaction inherits transaction options from defaultTransactionOptions", + "operations": [ + { + "name": "withTransaction", + "object": "session2", + "arguments": { + "callback": [ + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "session": "session2", + "document": { + "_id": 1 + } + }, + "expectResult": { + "$$unsetOrMatches": { + "insertedId": { + "$$unsetOrMatches": 1 + } + } + } + } + ] + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "insert": "test", + "documents": [ + { + "_id": 1 + } + ], + "ordered": true, + "lsid": { + "$$sessionLsid": "session2" + }, + "txnNumber": 1, + "startTransaction": true, + "autocommit": false, + "readConcern": { + "level": "majority" + }, + "writeConcern": { + "$$exists": false + } + }, + "commandName": "insert", + "databaseName": "transaction-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "commitTransaction": 1, + "lsid": { + "$$sessionLsid": "session2" + }, + "txnNumber": 1, + "autocommit": false, + "writeConcern": { + "w": 1 + }, + "readConcern": { + "$$exists": false + }, + "startTransaction": { + "$$exists": false + } + }, + "commandName": "commitTransaction", + "databaseName": "admin" + } + } + ] + } + ], + "outcome": [ + { + "collectionName": "test", + "databaseName": "transaction-tests", + "documents": [ + { + "_id": 1 + } + ] + } + ] + }, + { + "description": "withTransaction explicit transaction options", + "operations": [ + { + "name": "withTransaction", + "object": "session0", + "arguments": { + "callback": [ + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "session": "session0", + "document": { + "_id": 1 + } + }, + "expectResult": { + "$$unsetOrMatches": { + "insertedId": { + "$$unsetOrMatches": 1 + } + } + } + } + ], + "readConcern": { + "level": "majority" + }, + "writeConcern": { + "w": 1 + } + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "insert": "test", + "documents": [ + { + "_id": 1 + } + ], + "ordered": true, + "lsid": { + "$$sessionLsid": "session0" + }, + "txnNumber": 1, + "startTransaction": true, + "autocommit": false, + "readConcern": { + "level": "majority" + }, + "writeConcern": { + "$$exists": false + } + }, + "commandName": "insert", + "databaseName": "transaction-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "commitTransaction": 1, + "lsid": { + "$$sessionLsid": "session0" + }, + "txnNumber": 1, + "autocommit": false, + "writeConcern": { + "w": 1 + }, + "readConcern": { + "$$exists": false + }, + "startTransaction": { + "$$exists": false + } + }, + "commandName": "commitTransaction", + "databaseName": "admin" + } + } + ] + } + ], + "outcome": [ + { + "collectionName": "test", + "databaseName": "transaction-tests", + "documents": [ + { + "_id": 1 + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/valid-pass/poc-transactions-convenient-api.yml b/test/spec/unified-test-format/valid-pass/poc-transactions-convenient-api.yml new file mode 100644 index 0000000000..4f981d15dd --- /dev/null +++ b/test/spec/unified-test-format/valid-pass/poc-transactions-convenient-api.yml @@ -0,0 +1,235 @@ +description: "poc-transactions-convenient-api" + +schemaVersion: "1.0" + +runOnRequirements: + - minServerVersion: "4.0" + topologies: [ replicaset ] + - minServerVersion: "4.1.8" + topologies: [ sharded-replicaset ] + +createEntities: + - client: + id: &client0 client0 + useMultipleMongoses: true + observeEvents: [ commandStartedEvent ] + - client: + id: &client1 client1 + uriOptions: + readConcernLevel: local + w: 1 + useMultipleMongoses: true + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &databaseName transaction-tests + - database: + id: &database1 database1 + client: *client1 + databaseName: *databaseName + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collectionName test + - collection: + id: &collection1 collection1 + database: *database1 + collectionName: *collectionName + - session: + id: &session0 session0 + client: *client0 + - session: + id: &session1 session1 + client: *client1 + - session: + id: &session2 session2 + client: *client0 + sessionOptions: + defaultTransactionOptions: + readConcern: { level: majority } + writeConcern: { w: 1 } + +initialData: + - collectionName: *collectionName + databaseName: *databaseName + documents: [] + +tests: + - description: "withTransaction and no transaction options set" + operations: + - name: withTransaction + object: *session0 + arguments: + callback: + - name: insertOne + object: *collection0 + arguments: + session: *session0 + document: { _id: 1 } + expectResult: { $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } } + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + insert: *collectionName + documents: [ { _id: 1 } ] + ordered: true + lsid: { $$sessionLsid: *session0 } + txnNumber: 1 + startTransaction: true + autocommit: false + # omitted fields + readConcern: { $$exists: false } + writeConcern: { $$exists: false } + commandName: insert + databaseName: *databaseName + - commandStartedEvent: + command: + commitTransaction: 1 + lsid: { $$sessionLsid: *session0 } + txnNumber: 1 + autocommit: false + # omitted fields + readConcern: { $$exists: false } + startTransaction: { $$exists: false } + writeConcern: { $$exists: false } + commandName: commitTransaction + databaseName: admin + outcome: &outcome + - collectionName: *collectionName + databaseName: *databaseName + documents: + - { _id: 1 } + + - description: "withTransaction inherits transaction options from client" + operations: + - name: withTransaction + object: *session1 + arguments: + callback: + - name: insertOne + object: *collection1 + arguments: + session: *session1 + document: { _id: 1 } + expectResult: { $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } } + expectEvents: + - client: *client1 + events: + - commandStartedEvent: + command: + insert: *collectionName + documents: [ { _id: 1 } ] + ordered: true + lsid: { $$sessionLsid: *session1 } + txnNumber: 1 + startTransaction: true + autocommit: false + readConcern: { level: local } + # omitted fields + writeConcern: { $$exists: false } + commandName: insert + databaseName: *databaseName + - commandStartedEvent: + command: + commitTransaction: 1 + lsid: { $$sessionLsid: *session1 } + txnNumber: 1 + autocommit: false + writeConcern: { w: 1 } + # omitted fields + readConcern: { $$exists: false } + startTransaction: { $$exists: false } + commandName: commitTransaction + databaseName: admin + outcome: *outcome + + - description: "withTransaction inherits transaction options from defaultTransactionOptions" + operations: + - name: withTransaction + object: *session2 + arguments: + callback: + - name: insertOne + object: *collection0 + arguments: + session: *session2 + document: { _id: 1 } + expectResult: { $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } } + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + insert: *collectionName + documents: [ { _id: 1 } ] + ordered: true + lsid: { $$sessionLsid: *session2 } + txnNumber: 1 + startTransaction: true + autocommit: false + readConcern: { level: majority } + # omitted fields + writeConcern: { $$exists: false } + commandName: insert + databaseName: *databaseName + - commandStartedEvent: + command: + commitTransaction: 1 + lsid: { $$sessionLsid: *session2 } + txnNumber: 1 + autocommit: false + writeConcern: { w: 1 } + # omitted fields + readConcern: { $$exists: false } + startTransaction: { $$exists: false } + commandName: commitTransaction + databaseName: admin + outcome: *outcome + + - description: "withTransaction explicit transaction options" + operations: + - name: withTransaction + object: *session0 + arguments: + callback: + - name: insertOne + object: *collection0 + arguments: + session: *session0 + document: { _id: 1 } + expectResult: { $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 1 } } } + readConcern: { level: majority } + writeConcern: { w: 1 } + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + insert: *collectionName + documents: [ { _id: 1 } ] + ordered: true + lsid: { $$sessionLsid: *session0 } + txnNumber: 1 + startTransaction: true + autocommit: false + readConcern: { level: majority } + # omitted fields + writeConcern: { $$exists: false } + commandName: insert + databaseName: *databaseName + - commandStartedEvent: + command: + commitTransaction: 1 + lsid: { $$sessionLsid: *session0 } + txnNumber: 1 + autocommit: false + writeConcern: { w: 1 } + # omitted fields + readConcern: { $$exists: false } + startTransaction: { $$exists: false } + commandName: commitTransaction + databaseName: admin + outcome: *outcome diff --git a/test/spec/unified-test-format/valid-pass/poc-transactions-mongos-pin-auto.json b/test/spec/unified-test-format/valid-pass/poc-transactions-mongos-pin-auto.json new file mode 100644 index 0000000000..a0b297d59a --- /dev/null +++ b/test/spec/unified-test-format/valid-pass/poc-transactions-mongos-pin-auto.json @@ -0,0 +1,409 @@ +{ + "description": "poc-transactions-mongos-pin-auto", + "schemaVersion": "1.0", + "runOnRequirements": [ + { + "minServerVersion": "4.1.8", + "topologies": [ + "sharded-replicaset" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "useMultipleMongoses": true, + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "transaction-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "test" + } + }, + { + "session": { + "id": "session0", + "client": "client0" + } + } + ], + "initialData": [ + { + "collectionName": "test", + "databaseName": "transaction-tests", + "documents": [ + { + "_id": 1 + }, + { + "_id": 2 + } + ] + } + ], + "tests": [ + { + "description": "remain pinned after non-transient Interrupted error on insertOne", + "operations": [ + { + "name": "startTransaction", + "object": "session0" + }, + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "session": "session0", + "document": { + "_id": 3 + } + }, + "expectResult": { + "$$unsetOrMatches": { + "insertedId": { + "$$unsetOrMatches": 3 + } + } + } + }, + { + "name": "targetedFailPoint", + "object": "testRunner", + "arguments": { + "session": "session0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "insert" + ], + "errorCode": 11601 + } + } + } + }, + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "session": "session0", + "document": { + "_id": 4 + } + }, + "expectError": { + "errorLabelsOmit": [ + "TransientTransactionError", + "UnknownTransactionCommitResult" + ], + "errorCodeName": "Interrupted" + } + }, + { + "name": "assertSessionPinned", + "object": "testRunner", + "arguments": { + "session": "session0" + } + }, + { + "name": "commitTransaction", + "object": "session0" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "insert": "test", + "documents": [ + { + "_id": 3 + } + ], + "ordered": true, + "readConcern": { + "$$exists": false + }, + "lsid": { + "$$sessionLsid": "session0" + }, + "txnNumber": 1, + "startTransaction": true, + "autocommit": false, + "writeConcern": { + "$$exists": false + } + }, + "commandName": "insert", + "databaseName": "transaction-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "insert": "test", + "documents": [ + { + "_id": 4 + } + ], + "ordered": true, + "readConcern": { + "$$exists": false + }, + "lsid": { + "$$sessionLsid": "session0" + }, + "txnNumber": 1, + "startTransaction": { + "$$exists": false + }, + "autocommit": false, + "writeConcern": { + "$$exists": false + } + }, + "commandName": "insert", + "databaseName": "transaction-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "commitTransaction": 1, + "lsid": { + "$$sessionLsid": "session0" + }, + "txnNumber": 1, + "startTransaction": { + "$$exists": false + }, + "autocommit": false, + "writeConcern": { + "$$exists": false + }, + "recoveryToken": { + "$$type": "object" + } + }, + "commandName": "commitTransaction", + "databaseName": "admin" + } + } + ] + } + ], + "outcome": [ + { + "collectionName": "test", + "databaseName": "transaction-tests", + "documents": [ + { + "_id": 1 + }, + { + "_id": 2 + }, + { + "_id": 3 + } + ] + } + ] + }, + { + "description": "unpin after transient error within a transaction", + "operations": [ + { + "name": "startTransaction", + "object": "session0" + }, + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "session": "session0", + "document": { + "_id": 3 + } + }, + "expectResult": { + "$$unsetOrMatches": { + "insertedId": { + "$$unsetOrMatches": 3 + } + } + } + }, + { + "name": "targetedFailPoint", + "object": "testRunner", + "arguments": { + "session": "session0", + "failPoint": { + "configureFailPoint": "failCommand", + "mode": { + "times": 1 + }, + "data": { + "failCommands": [ + "insert" + ], + "closeConnection": true + } + } + } + }, + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "session": "session0", + "document": { + "_id": 4 + } + }, + "expectError": { + "errorLabelsContain": [ + "TransientTransactionError" + ], + "errorLabelsOmit": [ + "UnknownTransactionCommitResult" + ] + } + }, + { + "name": "assertSessionUnpinned", + "object": "testRunner", + "arguments": { + "session": "session0" + } + }, + { + "name": "abortTransaction", + "object": "session0" + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "insert": "test", + "documents": [ + { + "_id": 3 + } + ], + "ordered": true, + "readConcern": { + "$$exists": false + }, + "lsid": { + "$$sessionLsid": "session0" + }, + "txnNumber": 1, + "startTransaction": true, + "autocommit": false, + "writeConcern": { + "$$exists": false + } + }, + "commandName": "insert", + "databaseName": "transaction-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "insert": "test", + "documents": [ + { + "_id": 4 + } + ], + "ordered": true, + "readConcern": { + "$$exists": false + }, + "lsid": { + "$$sessionLsid": "session0" + }, + "txnNumber": 1, + "startTransaction": { + "$$exists": false + }, + "autocommit": false, + "writeConcern": { + "$$exists": false + } + }, + "commandName": "insert", + "databaseName": "transaction-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "abortTransaction": 1, + "lsid": { + "$$sessionLsid": "session0" + }, + "txnNumber": 1, + "startTransaction": { + "$$exists": false + }, + "autocommit": false, + "writeConcern": { + "$$exists": false + }, + "recoveryToken": { + "$$type": "object" + } + }, + "commandName": "abortTransaction", + "databaseName": "admin" + } + } + ] + } + ], + "outcome": [ + { + "collectionName": "test", + "databaseName": "transaction-tests", + "documents": [ + { + "_id": 1 + }, + { + "_id": 2 + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/valid-pass/poc-transactions-mongos-pin-auto.yml b/test/spec/unified-test-format/valid-pass/poc-transactions-mongos-pin-auto.yml new file mode 100644 index 0000000000..47db7c3188 --- /dev/null +++ b/test/spec/unified-test-format/valid-pass/poc-transactions-mongos-pin-auto.yml @@ -0,0 +1,169 @@ +description: "poc-transactions-mongos-pin-auto" + +schemaVersion: "1.0" + +runOnRequirements: + - minServerVersion: "4.1.8" + topologies: [ sharded-replicaset ] + +createEntities: + - client: + id: &client0 client0 + useMultipleMongoses: true + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name transaction-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name test + - session: + id: &session0 session0 + client: *client0 + +initialData: + - collectionName: *collection0Name + databaseName: *database0Name + documents: + - { _id: 1 } + - { _id: 2 } + +tests: + - description: "remain pinned after non-transient Interrupted error on insertOne" + operations: + - &startTransaction + name: startTransaction + object: *session0 + - &firstInsert + name: insertOne + object: *collection0 + arguments: + session: *session0 + document: { _id: 3 } + expectResult: { $$unsetOrMatches: { insertedId: { $$unsetOrMatches: 3 } } } + - name: targetedFailPoint + object: testRunner + arguments: + session: *session0 + failPoint: + configureFailPoint: failCommand + mode: { times: 1 } + data: + failCommands: [ insert ] + errorCode: 11601 # Interrupted + - name: insertOne + object: *collection0 + arguments: + session: *session0 + document: { _id: 4 } + expectError: + errorLabelsOmit: [ TransientTransactionError, UnknownTransactionCommitResult ] + errorCodeName: Interrupted + - name: assertSessionPinned + object: testRunner + arguments: + session: *session0 + - name: commitTransaction + object: *session0 + expectEvents: + - client: *client0 + events: + - commandStartedEvent: &firstInsertEvent + command: + insert: *collection0Name + documents: [ { _id: 3 } ] + ordered: true + readConcern: { $$exists: false } + lsid: { $$sessionLsid: *session0 } + txnNumber: 1 + startTransaction: true + autocommit: false + writeConcern: { $$exists: false } + commandName: insert + databaseName: *database0Name + - commandStartedEvent: &secondInsertEvent + command: + insert: *collection0Name + documents: [ { _id: 4 } ] + ordered: true + readConcern: { $$exists: false } + lsid: { $$sessionLsid: *session0 } + txnNumber: 1 + startTransaction: { $$exists: false } + autocommit: false + writeConcern: { $$exists: false } + commandName: insert + databaseName: *database0Name + - commandStartedEvent: + command: + commitTransaction: 1 + lsid: { $$sessionLsid: *session0 } + txnNumber: 1 + startTransaction: { $$exists: false } + autocommit: false + writeConcern: { $$exists: false } + # Original test expected any value, but we can assert an object + recoveryToken: { $$type: object } + commandName: commitTransaction + databaseName: admin + outcome: + - collectionName: *collection0Name + databaseName: *database0Name + documents: + - { _id: 1 } + - { _id: 2 } + - { _id: 3 } + + - description: "unpin after transient error within a transaction" + operations: + - *startTransaction + - *firstInsert + - name: targetedFailPoint + object: testRunner + arguments: + session: *session0 + failPoint: + configureFailPoint: failCommand + mode: { times: 1 } + data: + failCommands: [ insert ] + closeConnection: true + - name: insertOne + object: *collection0 + arguments: + session: *session0 + document: { _id: 4 } + expectError: + errorLabelsContain: [ TransientTransactionError ] + errorLabelsOmit: [ UnknownTransactionCommitResult ] + - name: assertSessionUnpinned + object: testRunner + arguments: + session: *session0 + - name: abortTransaction + object: *session0 + expectEvents: + - client: *client0 + events: + - commandStartedEvent: *firstInsertEvent + - commandStartedEvent: *secondInsertEvent + - commandStartedEvent: + command: + abortTransaction: 1 + lsid: { $$sessionLsid: *session0 } + txnNumber: 1 + startTransaction: { $$exists: false } + autocommit: false + writeConcern: { $$exists: false } + # Original test expected any value, but we can assert an object + recoveryToken: { $$type: object } + commandName: abortTransaction + databaseName: admin + outcome: + - collectionName: *collection0Name + databaseName: *database0Name + documents: + - { _id: 1 } + - { _id: 2 } diff --git a/test/spec/unified-test-format/valid-pass/poc-transactions.json b/test/spec/unified-test-format/valid-pass/poc-transactions.json new file mode 100644 index 0000000000..62528f9ce1 --- /dev/null +++ b/test/spec/unified-test-format/valid-pass/poc-transactions.json @@ -0,0 +1,322 @@ +{ + "description": "poc-transactions", + "schemaVersion": "1.0", + "runOnRequirements": [ + { + "minServerVersion": "4.0", + "topologies": [ + "replicaset" + ] + }, + { + "minServerVersion": "4.1.8", + "topologies": [ + "sharded-replicaset" + ] + } + ], + "createEntities": [ + { + "client": { + "id": "client0", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database0", + "client": "client0", + "databaseName": "transaction-tests" + } + }, + { + "collection": { + "id": "collection0", + "database": "database0", + "collectionName": "test" + } + }, + { + "session": { + "id": "session0", + "client": "client0" + } + } + ], + "initialData": [ + { + "collectionName": "test", + "databaseName": "transaction-tests", + "documents": [] + } + ], + "tests": [ + { + "description": "Client side error in command starting transaction", + "operations": [ + { + "name": "startTransaction", + "object": "session0" + }, + { + "name": "insertOne", + "object": "collection0", + "arguments": { + "session": "session0", + "document": { + "_id": { + ".": "." + } + } + }, + "expectError": { + "isClientError": true + } + }, + { + "name": "assertSessionTransactionState", + "object": "testRunner", + "arguments": { + "session": "session0", + "state": "starting" + } + } + ] + }, + { + "description": "explicitly create collection using create command", + "runOnRequirements": [ + { + "minServerVersion": "4.3.4", + "topologies": [ + "replicaset", + "sharded-replicaset" + ] + } + ], + "operations": [ + { + "name": "dropCollection", + "object": "database0", + "arguments": { + "collection": "test" + } + }, + { + "name": "startTransaction", + "object": "session0" + }, + { + "name": "createCollection", + "object": "database0", + "arguments": { + "session": "session0", + "collection": "test" + } + }, + { + "name": "assertCollectionNotExists", + "object": "testRunner", + "arguments": { + "databaseName": "transaction-tests", + "collectionName": "test" + } + }, + { + "name": "commitTransaction", + "object": "session0" + }, + { + "name": "assertCollectionExists", + "object": "testRunner", + "arguments": { + "databaseName": "transaction-tests", + "collectionName": "test" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "drop": "test", + "writeConcern": { + "$$exists": false + } + }, + "commandName": "drop", + "databaseName": "transaction-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "create": "test", + "lsid": { + "$$sessionLsid": "session0" + }, + "txnNumber": 1, + "startTransaction": true, + "autocommit": false, + "writeConcern": { + "$$exists": false + } + }, + "commandName": "create", + "databaseName": "transaction-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "commitTransaction": 1, + "lsid": { + "$$sessionLsid": "session0" + }, + "txnNumber": 1, + "startTransaction": { + "$$exists": false + }, + "autocommit": false, + "writeConcern": { + "$$exists": false + } + }, + "commandName": "commitTransaction", + "databaseName": "admin" + } + } + ] + } + ] + }, + { + "description": "create index on a non-existing collection", + "runOnRequirements": [ + { + "minServerVersion": "4.3.4", + "topologies": [ + "replicaset", + "sharded-replicaset" + ] + } + ], + "operations": [ + { + "name": "dropCollection", + "object": "database0", + "arguments": { + "collection": "test" + } + }, + { + "name": "startTransaction", + "object": "session0" + }, + { + "name": "createIndex", + "object": "collection0", + "arguments": { + "session": "session0", + "name": "x_1", + "keys": { + "x": 1 + } + } + }, + { + "name": "assertIndexNotExists", + "object": "testRunner", + "arguments": { + "databaseName": "transaction-tests", + "collectionName": "test", + "indexName": "x_1" + } + }, + { + "name": "commitTransaction", + "object": "session0" + }, + { + "name": "assertIndexExists", + "object": "testRunner", + "arguments": { + "databaseName": "transaction-tests", + "collectionName": "test", + "indexName": "x_1" + } + } + ], + "expectEvents": [ + { + "client": "client0", + "events": [ + { + "commandStartedEvent": { + "command": { + "drop": "test", + "writeConcern": { + "$$exists": false + } + }, + "commandName": "drop", + "databaseName": "transaction-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "createIndexes": "test", + "indexes": [ + { + "name": "x_1", + "key": { + "x": 1 + } + } + ], + "lsid": { + "$$sessionLsid": "session0" + }, + "txnNumber": 1, + "startTransaction": true, + "autocommit": false, + "writeConcern": { + "$$exists": false + } + }, + "commandName": "createIndexes", + "databaseName": "transaction-tests" + } + }, + { + "commandStartedEvent": { + "command": { + "commitTransaction": 1, + "lsid": { + "$$sessionLsid": "session0" + }, + "txnNumber": 1, + "startTransaction": { + "$$exists": false + }, + "autocommit": false, + "writeConcern": { + "$$exists": false + } + }, + "commandName": "commitTransaction", + "databaseName": "admin" + } + } + ] + } + ] + } + ] +} diff --git a/test/spec/unified-test-format/valid-pass/poc-transactions.yml b/test/spec/unified-test-format/valid-pass/poc-transactions.yml new file mode 100644 index 0000000000..5f229e464c --- /dev/null +++ b/test/spec/unified-test-format/valid-pass/poc-transactions.yml @@ -0,0 +1,170 @@ +description: "poc-transactions" + +schemaVersion: "1.0" + +runOnRequirements: + - minServerVersion: "4.0" + topologies: [ replicaset ] + - minServerVersion: "4.1.8" + topologies: [ sharded-replicaset ] + +createEntities: + - client: + id: &client0 client0 + observeEvents: [ commandStartedEvent ] + - database: + id: &database0 database0 + client: *client0 + databaseName: &database0Name transaction-tests + - collection: + id: &collection0 collection0 + database: *database0 + collectionName: &collection0Name test + - session: + id: &session0 session0 + client: *client0 + +initialData: + - collectionName: *collection0Name + databaseName: *database0Name + documents: [] + +tests: + - description: "Client side error in command starting transaction" + operations: + - name: startTransaction + object: *session0 + - name: insertOne + object: *collection0 + arguments: + session: *session0 + document: { _id: { .: . } } + # Original test only asserted a generic error + expectError: { isClientError: true } + - name: assertSessionTransactionState + object: testRunner + arguments: + session: *session0 + state: starting + + - description: "explicitly create collection using create command" + runOnRequirements: + - minServerVersion: "4.3.4" + topologies: [ replicaset, sharded-replicaset ] + operations: + - name: dropCollection + object: *database0 + arguments: + collection: *collection0Name + - name: startTransaction + object: *session0 + - name: createCollection + object: *database0 + arguments: + session: *session0 + collection: *collection0Name + - name: assertCollectionNotExists + object: testRunner + arguments: + databaseName: *database0Name + collectionName: *collection0Name + - name: commitTransaction + object: *session0 + - name: assertCollectionExists + object: testRunner + arguments: + databaseName: *database0Name + collectionName: *collection0Name + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + drop: *collection0Name + writeConcern: { $$exists: false } + commandName: drop + databaseName: *database0Name + - commandStartedEvent: + command: + create: *collection0Name + lsid: { $$sessionLsid: *session0 } + txnNumber: 1 + startTransaction: true + autocommit: false + writeConcern: { $$exists: false } + commandName: create + databaseName: *database0Name + - commandStartedEvent: + command: + commitTransaction: 1 + lsid: { $$sessionLsid: *session0 } + txnNumber: 1 + startTransaction: { $$exists: false } + autocommit: false + writeConcern: { $$exists: false } + commandName: commitTransaction + databaseName: admin + + - description: "create index on a non-existing collection" + runOnRequirements: + - minServerVersion: "4.3.4" + topologies: [ replicaset, sharded-replicaset ] + operations: + - name: dropCollection + object: *database0 + arguments: + collection: *collection0Name + - name: startTransaction + object: *session0 + - name: createIndex + object: *collection0 + arguments: + session: *session0 + name: &indexName "x_1" + keys: { x: 1 } + - name: assertIndexNotExists + object: testRunner + arguments: + databaseName: *database0Name + collectionName: *collection0Name + indexName: *indexName + - name: commitTransaction + object: *session0 + - name: assertIndexExists + object: testRunner + arguments: + databaseName: *database0Name + collectionName: *collection0Name + indexName: *indexName + expectEvents: + - client: *client0 + events: + - commandStartedEvent: + command: + drop: *collection0Name + writeConcern: { $$exists: false } + commandName: drop + databaseName: *database0Name + - commandStartedEvent: + command: + createIndexes: *collection0Name + indexes: + - name: *indexName + key: { x: 1 } + lsid: { $$sessionLsid: *session0 } + txnNumber: 1 + startTransaction: true + autocommit: false + writeConcern: { $$exists: false } + commandName: createIndexes + databaseName: *database0Name + - commandStartedEvent: + command: + commitTransaction: 1 + lsid: { $$sessionLsid: *session0 } + txnNumber: 1 + startTransaction: { $$exists: false } + autocommit: false + writeConcern: { $$exists: false } + commandName: commitTransaction + databaseName: admin diff --git a/test/tools/runner/config.js b/test/tools/runner/config.js index ddd757a8bc..fc24c0091d 100644 --- a/test/tools/runner/config.js +++ b/test/tools/runner/config.js @@ -2,6 +2,7 @@ const url = require('url'); const qs = require('querystring'); const util = require('util'); +const expect = require('chai').expect; const MongoClient = require('../../../lib/mongo_client'); const TopologyType = require('../../../lib/core/sdam/common').TopologyType; @@ -21,6 +22,7 @@ class NativeConfiguration { this.topologyType = context.topologyType; this.version = context.version; this.clientSideEncryption = context.clientSideEncryption; + this.parameters = undefined; this.options = Object.assign( { auth: parsedURI.auth, @@ -228,6 +230,55 @@ class NativeConfiguration { return url.format(urlObject); } + unifiedUrlBuilder(options) { + options = Object.assign({ db: this.options.db, replicaSet: this.options.replicaSet }, options); + + const FILLER_HOST = 'fillerHost'; + + const uri = url.parse(`mongodb://${FILLER_HOST}`); + uri.query = {}; + + if (options.replicaSet) { + uri.query['replicaSet'] = options.replicaSet; + } + + uri.pathname = `/${options.db}`; + + if (options.username) uri.auth = options.username; + if (options.password) uri.auth += `:${options.password}`; + + if (options.username || options.password) { + if (options.authMechanism) { + uri.query['authMechanism'] = options.authMechanism; + } + + if (options.authMechanismProperties) { + uri.query['authMechanismProperties'] = convertToConnStringMap( + options.authMechanismProperties + ); + } + + if (options.authSource) { + uri.query['authSource'] = options.authSource; + } + } + + let actualHostsString; + if (options.useMultipleMongoses) { + expect(this.options.hosts).to.have.length.greaterThan(1); + actualHostsString = this.options.hosts.map(h => `${h.host}:${h.port}`).join(','); + } else { + const host = this.options.hosts[0]; + actualHostsString = `${host.host}:${host.port}`; + } + + const connectionString = url + .format(uri) + .replace(new RegExp(FILLER_HOST, 'ig'), actualHostsString); + + return connectionString; + } + writeConcernMax() { if (this.topologyType !== TopologyType.Single) { return { writeConcern: { w: 'majority', wtimeout: 30000 } }; diff --git a/test/tools/runner/index.js b/test/tools/runner/index.js index 636a3bc783..8db9143a1c 100644 --- a/test/tools/runner/index.js +++ b/test/tools/runner/index.js @@ -1,5 +1,9 @@ 'use strict'; +// shims +require('array-includes/auto'); +require('object.entries/auto'); + const path = require('path'); const fs = require('fs'); const MongoClient = require('../../..').MongoClient; diff --git a/test/tools/utils.js b/test/tools/utils.js index ddb9b276d5..48276fbb5e 100644 --- a/test/tools/utils.js +++ b/test/tools/utils.js @@ -179,7 +179,77 @@ function visualizeMonitoringEvents(client) { }); } +class EventCollector { + constructor(obj, events, options) { + this._events = Object.create(null); + this._timeout = options ? options.timeout : 5000; + + events.forEach(eventName => { + this._events[eventName] = []; + obj.on(eventName, event => this._events[eventName].push(event)); + }); + } + + waitForEvent(eventName, count, callback) { + if (typeof count === 'function') { + callback = count; + count = 1; + } + + this.waitForEventImpl(this, Date.now(), eventName, count, callback); + } + + /** + * Will only return one event at a time from the front of the list + * Useful for iterating over the events in the order they occurred + * + * @param {string} eventName + * @returns {Promise>} + */ + waitAndShiftEvent(eventName) { + return new Promise((resolve, reject) => { + if (this._events[eventName].length > 0) { + return resolve(this._events[eventName].shift()); + } + this.waitForEventImpl(this, Date.now(), eventName, 1, error => { + if (error) return reject(error); + resolve(this._events[eventName].shift()); + }); + }); + } + + reset(eventName) { + if (eventName == null) { + Object.keys(this._events).forEach(eventName => { + this._events[eventName] = []; + }); + + return; + } + + if (this._events[eventName] == null) { + throw new TypeError(`invalid event name "${eventName}" specified for reset`); + } + + this._events[eventName] = []; + } + + waitForEventImpl(collector, start, eventName, count, callback) { + const events = collector._events[eventName]; + if (events.length >= count) { + return callback(undefined, events); + } + + if (Date.now() - start >= collector._timeout) { + return callback(new Error(`timed out waiting for event "${eventName}"`)); + } + + setTimeout(() => this.waitForEventImpl(collector, start, eventName, count, callback), 10); + } +} + module.exports = { + EventCollector, makeTestFunction, ensureCalledWith, ClassWithLogger,