Skip to content

Commit

Permalink
chore(ci): xunit integration (#2641)
Browse files Browse the repository at this point in the history
  • Loading branch information
emadum committed Nov 30, 2020
1 parent a27604e commit 06485ea
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 8 deletions.
7 changes: 7 additions & 0 deletions .evergreen/config.yml
Expand Up @@ -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:
Expand Down
9 changes: 9 additions & 0 deletions .evergreen/config.yml.in
Expand Up @@ -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"
Expand All @@ -248,4 +253,8 @@ pre:
- func: "make files executable"

post:
- func: "upload test results"
- func: "cleanup"

ignore:
- '*.md'
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -29,6 +29,9 @@ manual_tests/
docs/build
docs/Makefile

# xunit test output for CI
xunit.xml

# Directory for dbs
db

Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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 |

Expand Down
4 changes: 4 additions & 0 deletions lib/operations/list_collections.js
Expand Up @@ -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);
}
}
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion test/functional/operation_example.test.js
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion test/functional/operation_generators_example.test.js
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion test/functional/operation_promises_example.test.js
Expand Up @@ -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() {
Expand Down
9 changes: 6 additions & 3 deletions test/functional/readconcern.test.js
Expand Up @@ -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',
Expand All @@ -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 = [];
Expand Down
3 changes: 2 additions & 1 deletion test/mocha.opts
Expand Up @@ -2,4 +2,5 @@
--timeout 60000
--file test/tools/runner
--ui test/tools/runner/metadata_ui.js

--reporter spec-xunit-file
--color

0 comments on commit 06485ea

Please sign in to comment.