Skip to content

Commit

Permalink
Use mongodb-version-manager for matrix tests
Browse files Browse the repository at this point in the history
Want to test against 2.6.6? `MONGODB_VERSION=2.6.6 npm test;`

Want to test against latest 2.8 rc? `MONGODB_VERSION=2.8.x npm test;`

2.2.x functional tests are currently broken through:

```
> MONGODB_VERSION=2.2.x npm test;
# …lots of logging output
error command line: unknown option setParameter
use --help for help
```

Perhaps we should collab more on things like
https://github.com/imlucas/mongodb-runner and
https://github.com/imlucas/mongodb-bridge :)
  • Loading branch information
imlucas committed Dec 18, 2014
1 parent d771db7 commit 97b3c20
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@ language: node_js
node_js:
- 0.10
- 0.11
sudo: false
sudo: false
env:
- MONGODB_VERSION=2.2.x
- MONGODB_VERSION=2.4.x
- MONGODB_VERSION=2.6.x
- MONGODB_VERSION=2.8.x
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"version": "2.0.9",
"description": "MongoDB legacy driver emulation layer on top of mongodb-core",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git://github.com/christkv/mongodb-legacy.git"
Expand All @@ -27,6 +24,7 @@
, "semver": "4.1.0"
, "rimraf": "2.2.6"
, "gleak": "0.5.0"
, "mongodb-version-manager": "^0.5.0"
},
"author": "Christian Kvalheim",
"license": "Apache 2.0",
Expand Down
16 changes: 14 additions & 2 deletions test/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ var Runner = require('integra').Runner
, path = require('path')
, rimraf = require('rimraf')
, fs = require('fs')
, m = require('mongodb-version-manager')
, f = require('util').format;

var detector = require('gleak')();
Expand Down Expand Up @@ -478,8 +479,19 @@ if(argv.t == 'functional') {
} catch(err) {
}

// Run the configuration
runner.run(config);
// Kill any running MongoDB processes and
// `install $MONGODB_VERSION` || `use existing installation` || `install stable`
m(function(err){
if(err) return console.error(err) && process.exit(1);

m.current(function(err, version){
if(err) return console.error(err) && process.exit(1);

console.log('Running tests against MongoDB version `%s`', version);
// Run the configuration
runner.run(config);
});
});
}


Expand Down

0 comments on commit 97b3c20

Please sign in to comment.