diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 218b0ef23ad..7b5be37305f 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -198,13 +198,20 @@ functions: NODE_LTS_NAME=${NODE_LTS_NAME} DRIVERS_TOOLS="${DRIVERS_TOOLS}" \ SSL_CA_FILE="${SSL_CA_FILE}" SSL_KEY_FILE="${SSL_KEY_FILE}" \ MONGODB_URI="${MONGODB_URI}" bash ${PROJECT_DIRECTORY}/.evergreen/run-tls-tests.sh + upload test results: + - command: attach.xunit_results + params: + file: src/xunit.xml pre: - func: fetch source - func: prepare resources - func: fix absolute paths - func: make files executable post: + - func: upload test results - func: cleanup +ignore: + - '*.md' tasks: - name: test-latest-server tags: diff --git a/.evergreen/config.yml.in b/.evergreen/config.yml.in index 55c0ff5168e..b85188c01a5 100644 --- a/.evergreen/config.yml.in +++ b/.evergreen/config.yml.in @@ -240,6 +240,11 @@ functions: SSL_CA_FILE="${SSL_CA_FILE}" SSL_KEY_FILE="${SSL_KEY_FILE}" \ MONGODB_URI="${MONGODB_URI}" bash ${PROJECT_DIRECTORY}/.evergreen/run-tls-tests.sh + "upload test results": + - command: attach.xunit_results + params: + file: src/xunit.xml + pre: - func: "fetch source" - func: "prepare resources" @@ -248,4 +253,8 @@ pre: - func: "make files executable" post: + - func: "upload test results" - func: "cleanup" + +ignore: + - '*.md' diff --git a/.gitignore b/.gitignore index 836bde681d4..171be28330f 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,9 @@ manual_tests/ docs/build docs/Makefile +# xunit test output for CI +xunit.xml + # Directory for dbs db diff --git a/README.md b/README.md index 00d31d8e642..855a2dc8321 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ The official [MongoDB](https://www.mongodb.com/) driver for Node.js. Provides a | what | where | |---------------|------------------------------------------------| | documentation | http://mongodb.github.io/node-mongodb-native | -| api-doc | http://mongodb.github.io/node-mongodb-native/3.1/api | +| api-doc | http://mongodb.github.io/node-mongodb-native/3.5/api | | source | https://github.com/mongodb/node-mongodb-native | | mongodb | http://www.mongodb.org | diff --git a/lib/operations/list_collections.js b/lib/operations/list_collections.js index ee01d31e85c..43a8bc17f8c 100644 --- a/lib/operations/list_collections.js +++ b/lib/operations/list_collections.js @@ -93,6 +93,10 @@ class ListCollectionsOperation extends CommandOperationV2 { nameOnly: this.nameOnly }; + if (this.options.collation) { + delete this.options.collation; + } + return super.executeCommand(server, command, callback); } } diff --git a/package-lock.json b/package-lock.json index ea245898e45..27589a8bf5e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3643,6 +3643,12 @@ "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", "dev": true }, + "spec-xunit-file": { + "version": "0.0.1-3", + "resolved": "https://registry.npmjs.org/spec-xunit-file/-/spec-xunit-file-0.0.1-3.tgz", + "integrity": "sha1-hVpmq4w4LrMWXfkoqB0HSQKdI4Y=", + "dev": true + }, "split": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", diff --git a/package.json b/package.json index 7708d3edc87..8d7e20d1bb2 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "sinon": "^4.3.0", "sinon-chai": "^3.2.0", "snappy": "^6.3.4", + "spec-xunit-file": "0.0.1-3", "standard-version": "^4.4.0", "util.promisify": "^1.0.1", "worker-farm": "^1.5.0", diff --git a/test/functional/operation_example.test.js b/test/functional/operation_example.test.js index 86d85fa4f75..e874267a847 100644 --- a/test/functional/operation_example.test.js +++ b/test/functional/operation_example.test.js @@ -1754,7 +1754,7 @@ describe('Operation Examples', function() { * @ignore */ it('shouldCorrectlyPerformSimpleGeoHaystackSearchCommand', { - metadata: { requires: { topology: ['single', 'replicaset'] } }, + metadata: { requires: { mongodb: '<=4.4', topology: ['single', 'replicaset'] } }, // The actual test we wish to run test: function(done) { diff --git a/test/functional/operation_generators_example.test.js b/test/functional/operation_generators_example.test.js index 2b4fbf8aae5..3b3fbad5014 100644 --- a/test/functional/operation_generators_example.test.js +++ b/test/functional/operation_generators_example.test.js @@ -1093,7 +1093,7 @@ describe('Operation (Generators)', function() { * @ignore */ it('shouldCorrectlyPerformSimpleGeoHaystackSearchCommandWithGenerators', { - metadata: { requires: { generators: true, topology: ['single'] } }, + metadata: { requires: { mongodb: '<=4.4', generators: true, topology: ['single'] } }, // The actual test we wish to run test: function() { diff --git a/test/functional/operation_promises_example.test.js b/test/functional/operation_promises_example.test.js index 3b8b747d95a..25ecd8b7c0e 100644 --- a/test/functional/operation_promises_example.test.js +++ b/test/functional/operation_promises_example.test.js @@ -1120,7 +1120,7 @@ describe('Operation (Promises)', function() { * @ignore */ it('shouldCorrectlyPerformSimpleGeoHaystackSearchCommandWithPromises', { - metadata: { requires: { topology: ['single', 'replicaset'] } }, + metadata: { requires: { mongodb: '<=4.4', topology: ['single', 'replicaset'] } }, // The actual test we wish to run test: function() { diff --git a/test/functional/readconcern.test.js b/test/functional/readconcern.test.js index 75e38898447..de745d57394 100644 --- a/test/functional/readconcern.test.js +++ b/test/functional/readconcern.test.js @@ -44,7 +44,8 @@ describe('ReadConcern', function() { { description: 'Should set majority readConcern geoSearch command', commandName: 'geoSearch', - readConcern: { level: 'majority' } + readConcern: { level: 'majority' }, + serverVersion: '>=3.2 <=4.4' }, { description: 'Should set local readConcern at collection level', @@ -59,9 +60,11 @@ describe('ReadConcern', function() { ]; tests.forEach(test => { + const metadata = { + requires: { topology: 'replicaset', mongodb: test.serverVersion || '>= 3.2' } + }; it(test.description, { - metadata: { requires: { topology: 'replicaset', mongodb: '>= 3.2' } }, - + metadata, test: function(done) { const started = []; const succeeded = []; diff --git a/test/mocha.opts b/test/mocha.opts index 6f8c2b39090..7f44530476a 100644 --- a/test/mocha.opts +++ b/test/mocha.opts @@ -2,4 +2,5 @@ --timeout 60000 --file test/tools/runner --ui test/tools/runner/metadata_ui.js - + --reporter spec-xunit-file + --color