From 046e8fc0d4d66287403250990a6ef6ea6e625787 Mon Sep 17 00:00:00 2001 From: Daria Pardue <81593090+dariakp@users.noreply.github.com> Date: Thu, 10 Jun 2021 14:33:38 -0400 Subject: [PATCH 1/4] refactor: rename apm spec directory to command-monitoring --- test/functional/apm.test.js | 4 ++-- test/spec/{apm => command-monitoring}/README.rst | 0 test/spec/{apm => command-monitoring}/bulkWrite.json | 0 test/spec/{apm => command-monitoring}/bulkWrite.yml | 0 test/spec/{apm => command-monitoring}/command.json | 0 test/spec/{apm => command-monitoring}/command.yml | 0 test/spec/{apm => command-monitoring}/deleteMany.json | 0 test/spec/{apm => command-monitoring}/deleteMany.yml | 0 test/spec/{apm => command-monitoring}/deleteOne.json | 0 test/spec/{apm => command-monitoring}/deleteOne.yml | 0 test/spec/{apm => command-monitoring}/find.json | 0 test/spec/{apm => command-monitoring}/find.yml | 0 test/spec/{apm => command-monitoring}/insertMany.json | 0 test/spec/{apm => command-monitoring}/insertMany.yml | 0 test/spec/{apm => command-monitoring}/insertOne.json | 0 test/spec/{apm => command-monitoring}/insertOne.yml | 0 .../{apm => command-monitoring}/unacknowledgedBulkWrite.json | 0 .../{apm => command-monitoring}/unacknowledgedBulkWrite.yml | 0 test/spec/{apm => command-monitoring}/updateMany.json | 0 test/spec/{apm => command-monitoring}/updateMany.yml | 0 test/spec/{apm => command-monitoring}/updateOne.json | 0 test/spec/{apm => command-monitoring}/updateOne.yml | 0 22 files changed, 2 insertions(+), 2 deletions(-) rename test/spec/{apm => command-monitoring}/README.rst (100%) rename test/spec/{apm => command-monitoring}/bulkWrite.json (100%) rename test/spec/{apm => command-monitoring}/bulkWrite.yml (100%) rename test/spec/{apm => command-monitoring}/command.json (100%) rename test/spec/{apm => command-monitoring}/command.yml (100%) rename test/spec/{apm => command-monitoring}/deleteMany.json (100%) rename test/spec/{apm => command-monitoring}/deleteMany.yml (100%) rename test/spec/{apm => command-monitoring}/deleteOne.json (100%) rename test/spec/{apm => command-monitoring}/deleteOne.yml (100%) rename test/spec/{apm => command-monitoring}/find.json (100%) rename test/spec/{apm => command-monitoring}/find.yml (100%) rename test/spec/{apm => command-monitoring}/insertMany.json (100%) rename test/spec/{apm => command-monitoring}/insertMany.yml (100%) rename test/spec/{apm => command-monitoring}/insertOne.json (100%) rename test/spec/{apm => command-monitoring}/insertOne.yml (100%) rename test/spec/{apm => command-monitoring}/unacknowledgedBulkWrite.json (100%) rename test/spec/{apm => command-monitoring}/unacknowledgedBulkWrite.yml (100%) rename test/spec/{apm => command-monitoring}/updateMany.json (100%) rename test/spec/{apm => command-monitoring}/updateMany.yml (100%) rename test/spec/{apm => command-monitoring}/updateOne.json (100%) rename test/spec/{apm => command-monitoring}/updateOne.yml (100%) diff --git a/test/functional/apm.test.js b/test/functional/apm.test.js index 957ba615f3f..3e6aa3869b2 100644 --- a/test/functional/apm.test.js +++ b/test/functional/apm.test.js @@ -695,7 +695,7 @@ describe('APM', function () { }); }); - describe('spec tests', function () { + describe('command monitoring spec tests', function () { before(function () { return setupDatabase(this.configuration); }); @@ -926,7 +926,7 @@ describe('APM', function () { }); } - loadSpecTests('apm').forEach(scenario => { + loadSpecTests('command-monitoring').forEach(scenario => { if (scenario.name === 'command') return; // FIXME(NODE-3074): remove when `count` spec tests have been fixed describe(scenario.name, function () { scenario.tests.forEach(test => { diff --git a/test/spec/apm/README.rst b/test/spec/command-monitoring/README.rst similarity index 100% rename from test/spec/apm/README.rst rename to test/spec/command-monitoring/README.rst diff --git a/test/spec/apm/bulkWrite.json b/test/spec/command-monitoring/bulkWrite.json similarity index 100% rename from test/spec/apm/bulkWrite.json rename to test/spec/command-monitoring/bulkWrite.json diff --git a/test/spec/apm/bulkWrite.yml b/test/spec/command-monitoring/bulkWrite.yml similarity index 100% rename from test/spec/apm/bulkWrite.yml rename to test/spec/command-monitoring/bulkWrite.yml diff --git a/test/spec/apm/command.json b/test/spec/command-monitoring/command.json similarity index 100% rename from test/spec/apm/command.json rename to test/spec/command-monitoring/command.json diff --git a/test/spec/apm/command.yml b/test/spec/command-monitoring/command.yml similarity index 100% rename from test/spec/apm/command.yml rename to test/spec/command-monitoring/command.yml diff --git a/test/spec/apm/deleteMany.json b/test/spec/command-monitoring/deleteMany.json similarity index 100% rename from test/spec/apm/deleteMany.json rename to test/spec/command-monitoring/deleteMany.json diff --git a/test/spec/apm/deleteMany.yml b/test/spec/command-monitoring/deleteMany.yml similarity index 100% rename from test/spec/apm/deleteMany.yml rename to test/spec/command-monitoring/deleteMany.yml diff --git a/test/spec/apm/deleteOne.json b/test/spec/command-monitoring/deleteOne.json similarity index 100% rename from test/spec/apm/deleteOne.json rename to test/spec/command-monitoring/deleteOne.json diff --git a/test/spec/apm/deleteOne.yml b/test/spec/command-monitoring/deleteOne.yml similarity index 100% rename from test/spec/apm/deleteOne.yml rename to test/spec/command-monitoring/deleteOne.yml diff --git a/test/spec/apm/find.json b/test/spec/command-monitoring/find.json similarity index 100% rename from test/spec/apm/find.json rename to test/spec/command-monitoring/find.json diff --git a/test/spec/apm/find.yml b/test/spec/command-monitoring/find.yml similarity index 100% rename from test/spec/apm/find.yml rename to test/spec/command-monitoring/find.yml diff --git a/test/spec/apm/insertMany.json b/test/spec/command-monitoring/insertMany.json similarity index 100% rename from test/spec/apm/insertMany.json rename to test/spec/command-monitoring/insertMany.json diff --git a/test/spec/apm/insertMany.yml b/test/spec/command-monitoring/insertMany.yml similarity index 100% rename from test/spec/apm/insertMany.yml rename to test/spec/command-monitoring/insertMany.yml diff --git a/test/spec/apm/insertOne.json b/test/spec/command-monitoring/insertOne.json similarity index 100% rename from test/spec/apm/insertOne.json rename to test/spec/command-monitoring/insertOne.json diff --git a/test/spec/apm/insertOne.yml b/test/spec/command-monitoring/insertOne.yml similarity index 100% rename from test/spec/apm/insertOne.yml rename to test/spec/command-monitoring/insertOne.yml diff --git a/test/spec/apm/unacknowledgedBulkWrite.json b/test/spec/command-monitoring/unacknowledgedBulkWrite.json similarity index 100% rename from test/spec/apm/unacknowledgedBulkWrite.json rename to test/spec/command-monitoring/unacknowledgedBulkWrite.json diff --git a/test/spec/apm/unacknowledgedBulkWrite.yml b/test/spec/command-monitoring/unacknowledgedBulkWrite.yml similarity index 100% rename from test/spec/apm/unacknowledgedBulkWrite.yml rename to test/spec/command-monitoring/unacknowledgedBulkWrite.yml diff --git a/test/spec/apm/updateMany.json b/test/spec/command-monitoring/updateMany.json similarity index 100% rename from test/spec/apm/updateMany.json rename to test/spec/command-monitoring/updateMany.json diff --git a/test/spec/apm/updateMany.yml b/test/spec/command-monitoring/updateMany.yml similarity index 100% rename from test/spec/apm/updateMany.yml rename to test/spec/command-monitoring/updateMany.yml diff --git a/test/spec/apm/updateOne.json b/test/spec/command-monitoring/updateOne.json similarity index 100% rename from test/spec/apm/updateOne.json rename to test/spec/command-monitoring/updateOne.json diff --git a/test/spec/apm/updateOne.yml b/test/spec/command-monitoring/updateOne.yml similarity index 100% rename from test/spec/apm/updateOne.yml rename to test/spec/command-monitoring/updateOne.yml From 744a90f791d40495ff08955ccb9588abd460ae36 Mon Sep 17 00:00:00 2001 From: Daria Pardue <81593090+dariakp@users.noreply.github.com> Date: Thu, 10 Jun 2021 15:14:38 -0400 Subject: [PATCH 2/4] Sync redacted commands spec tests --- test/functional/apm.test.js | 17 + test/spec/command-monitoring/README.rst | 3 + .../unified/redacted-commands.json | 490 ++++++++++++++++++ .../unified/redacted-commands.yml | 250 +++++++++ 4 files changed, 760 insertions(+) create mode 100644 test/spec/command-monitoring/unified/redacted-commands.json create mode 100644 test/spec/command-monitoring/unified/redacted-commands.yml diff --git a/test/functional/apm.test.js b/test/functional/apm.test.js index 3e6aa3869b2..1af40888918 100644 --- a/test/functional/apm.test.js +++ b/test/functional/apm.test.js @@ -9,6 +9,7 @@ const { const { loadSpecTests } = require('../spec'); const { expect } = require('chai'); const { ReadPreference } = require('../../src/read_preference'); +const { runUnifiedTest } = require('./unified-spec-runner/runner'); describe('APM', function () { before(function () { @@ -964,4 +965,20 @@ describe('APM', function () { }); }); }); + + describe('command monitoring unified spec tests', () => { + for (const loadedSpec of loadSpecTests('command-monitoring/unified')) { + expect(loadedSpec).to.include.all.keys(['description', 'tests']); + context(String(loadedSpec.description), function () { + for (const test of loadedSpec.tests) { + it(String(test.description), { + metadata: { sessions: { skipLeakTests: true } }, // TODO: what is this for? + test: async function () { + await runUnifiedTest(this, loadedSpec, test); + } + }); + } + }); + } + }); }); diff --git a/test/spec/command-monitoring/README.rst b/test/spec/command-monitoring/README.rst index 9f0562364ad..f323f443e1b 100644 --- a/test/spec/command-monitoring/README.rst +++ b/test/spec/command-monitoring/README.rst @@ -12,6 +12,9 @@ Command Monitoring Testing ======= +Tests in ``unified`` are implemented in the `Unified Test Format <../../unified-test-format/unified-test-format.rst>`__ and require +schema version 1.0. Other tests should be run as described below. + Tests are provided in YML and JSON format to assert proper upconversion of commands. Database and Collection Names diff --git a/test/spec/command-monitoring/unified/redacted-commands.json b/test/spec/command-monitoring/unified/redacted-commands.json new file mode 100644 index 00000000000..3a1d1895d9d --- /dev/null +++ b/test/spec/command-monitoring/unified/redacted-commands.json @@ -0,0 +1,490 @@ +{ + "description": "redacted-commands", + "schemaVersion": "1.0", + "runOnRequirements": [ + { + "minServerVersion": "5.0" + } + ], + "createEntities": [ + { + "client": { + "id": "client", + "observeEvents": [ + "commandStartedEvent" + ] + } + }, + { + "database": { + "id": "database", + "client": "client", + "databaseName": "command-monitoring-tests" + } + } + ], + "tests": [ + { + "description": "authenticate", + "operations": [ + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "authenticate", + "command": { + "authenticate": "private" + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "commandName": "authenticate", + "command": { + "authenticate": { + "$$exists": false + } + } + } + } + ] + } + ] + }, + { + "description": "saslStart", + "operations": [ + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "saslStart", + "command": { + "saslStart": "private" + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "commandName": "saslStart", + "command": { + "saslStart": { + "$$exists": false + } + } + } + } + ] + } + ] + }, + { + "description": "saslContinue", + "operations": [ + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "saslContinue", + "command": { + "saslContinue": "private" + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "commandName": "saslContinue", + "command": { + "saslContinue": { + "$$exists": false + } + } + } + } + ] + } + ] + }, + { + "description": "getnonce", + "operations": [ + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "getnonce", + "command": { + "getnonce": "private" + } + } + } + ], + "expectEvents": [ + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "commandName": "getnonce", + "command": { + "getnonce": { + "$$exists": false + } + } + } + } + ] + } + ] + }, + { + "description": "createUser", + "operations": [ + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "createUser", + "command": { + "createUser": "private" + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "commandName": "createUser", + "command": { + "createUser": { + "$$exists": false + } + } + } + } + ] + } + ] + }, + { + "description": "updateUser", + "operations": [ + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "updateUser", + "command": { + "updateUser": "private" + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "commandName": "updateUser", + "command": { + "updateUser": { + "$$exists": false + } + } + } + } + ] + } + ] + }, + { + "description": "copydbgetnonce", + "operations": [ + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "copydbgetnonce", + "command": { + "copydbgetnonce": "private" + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "commandName": "copydbgetnonce", + "command": { + "copydbgetnonce": { + "$$exists": false + } + } + } + } + ] + } + ] + }, + { + "description": "copydbsaslstart", + "operations": [ + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "copydbsaslstart", + "command": { + "copydbsaslstart": "private" + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "commandName": "copydbsaslstart", + "command": { + "copydbsaslstart": { + "$$exists": false + } + } + } + } + ] + } + ] + }, + { + "description": "copydb", + "operations": [ + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "copydb", + "command": { + "copydb": "private" + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "commandName": "copydb", + "command": { + "copydb": { + "$$exists": false + } + } + } + } + ] + } + ] + }, + { + "description": "hello with speculative authenticate", + "operations": [ + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "hello", + "command": { + "hello": "private", + "speculativeAuthenticate": "foo" + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ismaster", + "command": { + "ismaster": "private", + "speculativeAuthenticate": "foo" + } + }, + "expectError": { + "isError": true + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "isMaster", + "command": { + "isMaster": "private", + "speculativeAuthenticate": "foo" + } + }, + "expectError": { + "isError": true + } + } + ], + "expectEvents": [ + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "commandName": "hello", + "command": { + "hello": { + "$$exists": false + } + } + } + }, + { + "commandStartedEvent": { + "commandName": "ismaster", + "command": { + "ismaster": { + "$$exists": false + } + } + } + }, + { + "commandStartedEvent": { + "commandName": "isMaster", + "command": { + "isMaster": { + "$$exists": false + } + } + } + } + ] + } + ] + }, + { + "description": "hello without speculative authenticate is not redacted", + "operations": [ + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "hello", + "command": { + "hello": "public" + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "ismaster", + "command": { + "ismaster": "public" + } + } + }, + { + "name": "runCommand", + "object": "database", + "arguments": { + "commandName": "isMaster", + "command": { + "isMaster": "public" + } + } + } + ], + "expectEvents": [ + { + "client": "client", + "events": [ + { + "commandStartedEvent": { + "commandName": "hello", + "command": { + "hello": "public" + } + } + }, + { + "commandStartedEvent": { + "commandName": "ismaster", + "command": { + "ismaster": "public" + } + } + }, + { + "commandStartedEvent": { + "commandName": "isMaster", + "command": { + "isMaster": "public" + } + } + } + ] + } + ] + } + ] +} diff --git a/test/spec/command-monitoring/unified/redacted-commands.yml b/test/spec/command-monitoring/unified/redacted-commands.yml new file mode 100644 index 00000000000..ef2d4cf41ad --- /dev/null +++ b/test/spec/command-monitoring/unified/redacted-commands.yml @@ -0,0 +1,250 @@ +description: "redacted-commands" + +schemaVersion: "1.0" + +runOnRequirements: + - minServerVersion: "5.0" + +createEntities: + - client: + id: &client client + observeEvents: + - commandStartedEvent + - database: + id: &database database + client: *client + databaseName: &databaseName command-monitoring-tests + +tests: + - description: "authenticate" + operations: + - name: runCommand + object: *database + arguments: + commandName: authenticate + command: + authenticate: "private" + # Malformed authentication commands will fail against the server, but we + # just want to assert that security-related commands are redacted + # in command monitoring. + expectError: + isError: true + expectEvents: + - client: *client + events: + - commandStartedEvent: + commandName: authenticate + # This only asserts that the command name has been redacted from the published command; + # however, it's unlikely that a driver would redact this but leave other, sensitive fields. + # We cannot simply assert that command is an empty document because it's at root-level, so + # additional fields in the actual document will be permitted. + command: { authenticate: { $$exists: false } } + + - description: "saslStart" + operations: + - name: runCommand + object: *database + arguments: + commandName: saslStart + command: + saslStart: "private" + expectError: + isError: true + expectEvents: + - client: *client + events: + - commandStartedEvent: + commandName: saslStart + command: { saslStart: { $$exists: false } } + + - description: "saslContinue" + operations: + - name: runCommand + object: *database + arguments: + commandName: saslContinue + command: + saslContinue: "private" + expectError: + isError: true + expectEvents: + - client: *client + events: + - commandStartedEvent: + commandName: saslContinue + command: { saslContinue: { $$exists: false } } + + - description: "getnonce" + operations: + - name: runCommand + object: *database + arguments: + commandName: getnonce + command: + getnonce: "private" + expectEvents: + - client: *client + events: + - commandStartedEvent: + commandName: getnonce + command: { getnonce: { $$exists: false } } + + - description: "createUser" + operations: + - name: runCommand + object: *database + arguments: + commandName: createUser + command: + createUser: "private" + expectError: + isError: true + expectEvents: + - client: *client + events: + - commandStartedEvent: + commandName: createUser + command: { createUser: { $$exists: false } } + + - description: "updateUser" + operations: + - name: runCommand + object: *database + arguments: + commandName: updateUser + command: + updateUser: "private" + expectError: + isError: true + expectEvents: + - client: *client + events: + - commandStartedEvent: + commandName: updateUser + command: { updateUser: { $$exists: false } } + + - description: "copydbgetnonce" + operations: + - name: runCommand + object: *database + arguments: + commandName: copydbgetnonce + command: + copydbgetnonce: "private" + expectError: + isError: true + expectEvents: + - client: *client + events: + - commandStartedEvent: + commandName: copydbgetnonce + command: { copydbgetnonce: { $$exists: false } } + + - description: "copydbsaslstart" + operations: + - name: runCommand + object: *database + arguments: + commandName: copydbsaslstart + command: + copydbsaslstart: "private" + expectError: + isError: true + expectEvents: + - client: *client + events: + - commandStartedEvent: + commandName: copydbsaslstart + command: { copydbsaslstart: { $$exists: false } } + + - description: "copydb" + operations: + - name: runCommand + object: *database + arguments: + commandName: copydb + command: + copydb: "private" + expectError: + isError: true + expectEvents: + - client: *client + events: + - commandStartedEvent: + commandName: copydb + command: { copydb: { $$exists: false } } + + - description: "hello with speculative authenticate" + operations: + - name: runCommand + object: *database + arguments: + commandName: hello + command: + hello: "private" + speculativeAuthenticate: "foo" + expectError: + isError: true + - name: runCommand + object: *database + arguments: + commandName: ismaster + command: + ismaster: "private" + speculativeAuthenticate: "foo" + expectError: + isError: true + - name: runCommand + object: *database + arguments: + commandName: isMaster + command: + isMaster: "private" + speculativeAuthenticate: "foo" + expectError: + isError: true + expectEvents: + - client: *client + events: + - commandStartedEvent: + commandName: hello + command: { hello: { $$exists: false } } + - commandStartedEvent: + commandName: ismaster + command: { ismaster: { $$exists: false } } + - commandStartedEvent: + commandName: isMaster + command: { isMaster: { $$exists: false } } + + - description: "hello without speculative authenticate is not redacted" + operations: + - name: runCommand + object: *database + arguments: + commandName: hello + command: + hello: "public" + - name: runCommand + object: *database + arguments: + commandName: ismaster + command: + ismaster: "public" + - name: runCommand + object: *database + arguments: + commandName: isMaster + command: + isMaster: "public" + expectEvents: + - client: *client + events: + - commandStartedEvent: + commandName: hello + command: { hello: "public" } + - commandStartedEvent: + commandName: ismaster + command: { ismaster: "public" } + - commandStartedEvent: + commandName: isMaster + command: { isMaster: "public" } From 48650a95d1a5fd9d9dab2131eb770bd909fdc2f4 Mon Sep 17 00:00:00 2001 From: Daria Pardue <81593090+dariakp@users.noreply.github.com> Date: Fri, 11 Jun 2021 14:43:57 -0400 Subject: [PATCH 3/4] Skip failing spec tests --- test/functional/apm.test.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/functional/apm.test.js b/test/functional/apm.test.js index 1af40888918..fe30d3daf2d 100644 --- a/test/functional/apm.test.js +++ b/test/functional/apm.test.js @@ -969,12 +969,22 @@ describe('APM', function () { describe('command monitoring unified spec tests', () => { for (const loadedSpec of loadSpecTests('command-monitoring/unified')) { expect(loadedSpec).to.include.all.keys(['description', 'tests']); + // TODO: NODE-3356 unskip redaction tests + const testsToSkip = + loadedSpec.description === 'redacted-commands' + ? loadedSpec.tests + .map(test => test.description) + .filter( + description => + description !== 'hello without speculative authenticate is not redacted' + ) + : []; context(String(loadedSpec.description), function () { for (const test of loadedSpec.tests) { it(String(test.description), { - metadata: { sessions: { skipLeakTests: true } }, // TODO: what is this for? + metadata: { sessions: { skipLeakTests: true } }, test: async function () { - await runUnifiedTest(this, loadedSpec, test); + await runUnifiedTest(this, loadedSpec, test, testsToSkip); } }); } From cbe0f892e6ff8a29c71d0fa25b61754ea95c9aa5 Mon Sep 17 00:00:00 2001 From: Daria Pardue <81593090+dariakp@users.noreply.github.com> Date: Fri, 11 Jun 2021 15:16:48 -0400 Subject: [PATCH 4/4] Move legacy command-monitoring spec tests into their own folder --- test/functional/apm.test.js | 2 +- test/spec/command-monitoring/README.rst | 2 +- test/spec/command-monitoring/{ => legacy}/bulkWrite.json | 0 test/spec/command-monitoring/{ => legacy}/bulkWrite.yml | 0 test/spec/command-monitoring/{ => legacy}/command.json | 0 test/spec/command-monitoring/{ => legacy}/command.yml | 0 test/spec/command-monitoring/{ => legacy}/deleteMany.json | 0 test/spec/command-monitoring/{ => legacy}/deleteMany.yml | 0 test/spec/command-monitoring/{ => legacy}/deleteOne.json | 0 test/spec/command-monitoring/{ => legacy}/deleteOne.yml | 0 test/spec/command-monitoring/{ => legacy}/find.json | 0 test/spec/command-monitoring/{ => legacy}/find.yml | 0 test/spec/command-monitoring/{ => legacy}/insertMany.json | 0 test/spec/command-monitoring/{ => legacy}/insertMany.yml | 0 test/spec/command-monitoring/{ => legacy}/insertOne.json | 0 test/spec/command-monitoring/{ => legacy}/insertOne.yml | 0 .../{ => legacy}/unacknowledgedBulkWrite.json | 0 .../command-monitoring/{ => legacy}/unacknowledgedBulkWrite.yml | 0 test/spec/command-monitoring/{ => legacy}/updateMany.json | 0 test/spec/command-monitoring/{ => legacy}/updateMany.yml | 0 test/spec/command-monitoring/{ => legacy}/updateOne.json | 0 test/spec/command-monitoring/{ => legacy}/updateOne.yml | 0 22 files changed, 2 insertions(+), 2 deletions(-) rename test/spec/command-monitoring/{ => legacy}/bulkWrite.json (100%) rename test/spec/command-monitoring/{ => legacy}/bulkWrite.yml (100%) rename test/spec/command-monitoring/{ => legacy}/command.json (100%) rename test/spec/command-monitoring/{ => legacy}/command.yml (100%) rename test/spec/command-monitoring/{ => legacy}/deleteMany.json (100%) rename test/spec/command-monitoring/{ => legacy}/deleteMany.yml (100%) rename test/spec/command-monitoring/{ => legacy}/deleteOne.json (100%) rename test/spec/command-monitoring/{ => legacy}/deleteOne.yml (100%) rename test/spec/command-monitoring/{ => legacy}/find.json (100%) rename test/spec/command-monitoring/{ => legacy}/find.yml (100%) rename test/spec/command-monitoring/{ => legacy}/insertMany.json (100%) rename test/spec/command-monitoring/{ => legacy}/insertMany.yml (100%) rename test/spec/command-monitoring/{ => legacy}/insertOne.json (100%) rename test/spec/command-monitoring/{ => legacy}/insertOne.yml (100%) rename test/spec/command-monitoring/{ => legacy}/unacknowledgedBulkWrite.json (100%) rename test/spec/command-monitoring/{ => legacy}/unacknowledgedBulkWrite.yml (100%) rename test/spec/command-monitoring/{ => legacy}/updateMany.json (100%) rename test/spec/command-monitoring/{ => legacy}/updateMany.yml (100%) rename test/spec/command-monitoring/{ => legacy}/updateOne.json (100%) rename test/spec/command-monitoring/{ => legacy}/updateOne.yml (100%) diff --git a/test/functional/apm.test.js b/test/functional/apm.test.js index fe30d3daf2d..6902f94c9b1 100644 --- a/test/functional/apm.test.js +++ b/test/functional/apm.test.js @@ -927,7 +927,7 @@ describe('APM', function () { }); } - loadSpecTests('command-monitoring').forEach(scenario => { + loadSpecTests('command-monitoring/legacy').forEach(scenario => { if (scenario.name === 'command') return; // FIXME(NODE-3074): remove when `count` spec tests have been fixed describe(scenario.name, function () { scenario.tests.forEach(test => { diff --git a/test/spec/command-monitoring/README.rst b/test/spec/command-monitoring/README.rst index f323f443e1b..5700409cf32 100644 --- a/test/spec/command-monitoring/README.rst +++ b/test/spec/command-monitoring/README.rst @@ -13,7 +13,7 @@ Testing ======= Tests in ``unified`` are implemented in the `Unified Test Format <../../unified-test-format/unified-test-format.rst>`__ and require -schema version 1.0. Other tests should be run as described below. +schema version 1.0. Tests in ``legacy`` should be run as described below. Tests are provided in YML and JSON format to assert proper upconversion of commands. diff --git a/test/spec/command-monitoring/bulkWrite.json b/test/spec/command-monitoring/legacy/bulkWrite.json similarity index 100% rename from test/spec/command-monitoring/bulkWrite.json rename to test/spec/command-monitoring/legacy/bulkWrite.json diff --git a/test/spec/command-monitoring/bulkWrite.yml b/test/spec/command-monitoring/legacy/bulkWrite.yml similarity index 100% rename from test/spec/command-monitoring/bulkWrite.yml rename to test/spec/command-monitoring/legacy/bulkWrite.yml diff --git a/test/spec/command-monitoring/command.json b/test/spec/command-monitoring/legacy/command.json similarity index 100% rename from test/spec/command-monitoring/command.json rename to test/spec/command-monitoring/legacy/command.json diff --git a/test/spec/command-monitoring/command.yml b/test/spec/command-monitoring/legacy/command.yml similarity index 100% rename from test/spec/command-monitoring/command.yml rename to test/spec/command-monitoring/legacy/command.yml diff --git a/test/spec/command-monitoring/deleteMany.json b/test/spec/command-monitoring/legacy/deleteMany.json similarity index 100% rename from test/spec/command-monitoring/deleteMany.json rename to test/spec/command-monitoring/legacy/deleteMany.json diff --git a/test/spec/command-monitoring/deleteMany.yml b/test/spec/command-monitoring/legacy/deleteMany.yml similarity index 100% rename from test/spec/command-monitoring/deleteMany.yml rename to test/spec/command-monitoring/legacy/deleteMany.yml diff --git a/test/spec/command-monitoring/deleteOne.json b/test/spec/command-monitoring/legacy/deleteOne.json similarity index 100% rename from test/spec/command-monitoring/deleteOne.json rename to test/spec/command-monitoring/legacy/deleteOne.json diff --git a/test/spec/command-monitoring/deleteOne.yml b/test/spec/command-monitoring/legacy/deleteOne.yml similarity index 100% rename from test/spec/command-monitoring/deleteOne.yml rename to test/spec/command-monitoring/legacy/deleteOne.yml diff --git a/test/spec/command-monitoring/find.json b/test/spec/command-monitoring/legacy/find.json similarity index 100% rename from test/spec/command-monitoring/find.json rename to test/spec/command-monitoring/legacy/find.json diff --git a/test/spec/command-monitoring/find.yml b/test/spec/command-monitoring/legacy/find.yml similarity index 100% rename from test/spec/command-monitoring/find.yml rename to test/spec/command-monitoring/legacy/find.yml diff --git a/test/spec/command-monitoring/insertMany.json b/test/spec/command-monitoring/legacy/insertMany.json similarity index 100% rename from test/spec/command-monitoring/insertMany.json rename to test/spec/command-monitoring/legacy/insertMany.json diff --git a/test/spec/command-monitoring/insertMany.yml b/test/spec/command-monitoring/legacy/insertMany.yml similarity index 100% rename from test/spec/command-monitoring/insertMany.yml rename to test/spec/command-monitoring/legacy/insertMany.yml diff --git a/test/spec/command-monitoring/insertOne.json b/test/spec/command-monitoring/legacy/insertOne.json similarity index 100% rename from test/spec/command-monitoring/insertOne.json rename to test/spec/command-monitoring/legacy/insertOne.json diff --git a/test/spec/command-monitoring/insertOne.yml b/test/spec/command-monitoring/legacy/insertOne.yml similarity index 100% rename from test/spec/command-monitoring/insertOne.yml rename to test/spec/command-monitoring/legacy/insertOne.yml diff --git a/test/spec/command-monitoring/unacknowledgedBulkWrite.json b/test/spec/command-monitoring/legacy/unacknowledgedBulkWrite.json similarity index 100% rename from test/spec/command-monitoring/unacknowledgedBulkWrite.json rename to test/spec/command-monitoring/legacy/unacknowledgedBulkWrite.json diff --git a/test/spec/command-monitoring/unacknowledgedBulkWrite.yml b/test/spec/command-monitoring/legacy/unacknowledgedBulkWrite.yml similarity index 100% rename from test/spec/command-monitoring/unacknowledgedBulkWrite.yml rename to test/spec/command-monitoring/legacy/unacknowledgedBulkWrite.yml diff --git a/test/spec/command-monitoring/updateMany.json b/test/spec/command-monitoring/legacy/updateMany.json similarity index 100% rename from test/spec/command-monitoring/updateMany.json rename to test/spec/command-monitoring/legacy/updateMany.json diff --git a/test/spec/command-monitoring/updateMany.yml b/test/spec/command-monitoring/legacy/updateMany.yml similarity index 100% rename from test/spec/command-monitoring/updateMany.yml rename to test/spec/command-monitoring/legacy/updateMany.yml diff --git a/test/spec/command-monitoring/updateOne.json b/test/spec/command-monitoring/legacy/updateOne.json similarity index 100% rename from test/spec/command-monitoring/updateOne.json rename to test/spec/command-monitoring/legacy/updateOne.json diff --git a/test/spec/command-monitoring/updateOne.yml b/test/spec/command-monitoring/legacy/updateOne.yml similarity index 100% rename from test/spec/command-monitoring/updateOne.yml rename to test/spec/command-monitoring/legacy/updateOne.yml