diff --git a/test/functional/client_side_encryption/corpus.test.js b/test/functional/client_side_encryption/corpus.test.js index eca6596559f..a6dde2f452a 100644 --- a/test/functional/client_side_encryption/corpus.test.js +++ b/test/functional/client_side_encryption/corpus.test.js @@ -6,11 +6,7 @@ const fs = require('fs'); const path = require('path'); const BSON = require('bson'); const { EJSON } = require('bson'); -const chai = require('chai'); -const expect = chai.expect; -chai.config.includeStack = true; -chai.config.showDiff = true; -chai.config.truncateThreshold = 0; +const { expect } = require('chai'); describe('Client Side Encryption Corpus', function () { const metadata = { diff --git a/test/functional/client_side_encryption/driver.test.js b/test/functional/client_side_encryption/driver.test.js index d0fffddf019..424c9061ff3 100644 --- a/test/functional/client_side_encryption/driver.test.js +++ b/test/functional/client_side_encryption/driver.test.js @@ -4,9 +4,6 @@ const crypto = require('crypto'); const BSON = require('bson'); const chai = require('chai'); const expect = chai.expect; -chai.config.includeStack = true; -chai.config.showDiff = true; -chai.config.truncateThreshold = 0; chai.use(require('chai-subset')); describe('Client Side Encryption Functional', function () { diff --git a/test/functional/spec-runner/index.js b/test/functional/spec-runner/index.js index 4a601598e6e..1e6bc40ea96 100644 --- a/test/functional/spec-runner/index.js +++ b/test/functional/spec-runner/index.js @@ -21,9 +21,6 @@ function promiseTry(callback) { chai.use(require('chai-subset')); chai.use(require('./matcher').default); -chai.config.includeStack = true; -chai.config.showDiff = true; -chai.config.truncateThreshold = 0; function escape(string) { return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); diff --git a/test/functional/spec-runner/matcher.js b/test/functional/spec-runner/matcher.js index 3167ec05b99..757b049d4a0 100644 --- a/test/functional/spec-runner/matcher.js +++ b/test/functional/spec-runner/matcher.js @@ -187,7 +187,7 @@ function matchMongoSpec(chai, utils) { 'expected #{act} to not match spec #{exp}', result.expected, result.actual, - chai.config.showDiff + chai.config.showDiff || true ); }); diff --git a/test/tools/cluster_setup.sh b/test/tools/cluster_setup.sh index 2f12d17f941..86fa8df1ceb 100755 --- a/test/tools/cluster_setup.sh +++ b/test/tools/cluster_setup.sh @@ -2,17 +2,26 @@ if [ "$#" -ne 1 ]; then echo "usage: cluster_setup " + echo "override env variables to change dbPath" exit fi +DATA_DIR=${DATA_DIR:-data} +SINGLE_DIR=${SINGLE_DIR:-$DATA_DIR/server} +REPLICASET_DIR=${REPLICASET_DIR:-$DATA_DIR/replica_set} +SHARDED_DIR=${SHARDED_DIR:-$DATA_DIR/sharded_cluster} + if [[ $1 == "replica_set" ]]; then - mlaunch init --replicaset --nodes 3 --arbiter --name rs --port 31000 --enableMajorityReadConcern --setParameter enableTestCommands=1 - echo "mongodb://localhost:31000/?replicaSet=rs" + mkdir -p $REPLICASET_DIR + mlaunch init --dir $REPLICASET_DIR --replicaset --nodes 3 --arbiter --name rs --port 31000 --enableMajorityReadConcern --setParameter enableTestCommands=1 + echo "mongodb://localhost:31000,localhost:31001,localhost:31002/?replicaSet=rs" elif [[ $1 == "sharded_cluster" ]]; then - mlaunch init --replicaset --nodes 3 --arbiter --name rs --port 51000 --enableMajorityReadConcern --setParameter enableTestCommands=1 --sharded 1 --mongos 2 - echo "mongodb://localhost:51000,localhost:51001/" + mkdir -p $SHARDED_DIR + mlaunch init --dir $SHARDED_DIR --replicaset --nodes 3 --arbiter --name rs --port 51000 --enableMajorityReadConcern --setParameter enableTestCommands=1 --sharded 1 --mongos 2 + echo "mongodb://localhost:51000,localhost:51001" elif [[ $1 == "server" ]]; then - mlaunch init --single --setParameter enableTestCommands=1 + mkdir -p $SINGLE_DIR + mlaunch init --dir $SINGLE_DIR --single --setParameter enableTestCommands=1 echo "mongodb://localhost:27017" else echo "unsupported topology: $1" diff --git a/test/tools/reporter/mongodb_reporter.js b/test/tools/reporter/mongodb_reporter.js index 2ffdc8493ad..d7d2f68c5ce 100644 --- a/test/tools/reporter/mongodb_reporter.js +++ b/test/tools/reporter/mongodb_reporter.js @@ -249,7 +249,11 @@ function replaceIllegalXMLCharacters(string) { const ANSI_ESCAPE_REGEX = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; function outputToXML(output) { function cdata(str) { - return `').join('\\]\\]\\>')}]]>`; + return `') + .join('\\]\\]\\>')}]]>`; } function makeTag(name, attributes, selfClose, content) { diff --git a/test/tools/runner/index.js b/test/tools/runner/index.js index a1c2929ff12..02f125a2607 100644 --- a/test/tools/runner/index.js +++ b/test/tools/runner/index.js @@ -97,8 +97,6 @@ const chai = require('chai'); chai.use(require('sinon-chai')); chai.use(require('chai-subset')); chai.use(require('../../functional/spec-runner/matcher').default); -chai.config.includeStack = true; -chai.config.showDiff = true; chai.config.truncateThreshold = 0; // install signal handlers for printing open/active handles