Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
Updated tests to run on MongoDB 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollina committed Jun 22, 2015
1 parent 1a3df81 commit 5b4aacf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
17 changes: 16 additions & 1 deletion .travis.yml
@@ -1,4 +1,20 @@
env:
- MONGODB_VERSION="2.6*"
- MONGODB_VERSION="2.8*"
- MONGODB_VERSION="3.0*"

before_install:
# MongoDB
- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
- if [ "$MONGODB_VERSION" = "2.4*" ]; then echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" | sudo tee /etc/apt/sources.list.d/mongodb.list; fi
- if [ "$MONGODB_VERSION" = "2.6*" ]; then echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" | sudo tee /etc/apt/sources.list.d/mongodb.list; fi
- if [ "$MONGODB_VERSION" = "2.8*" ]; then echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/testing multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-2.8.list; fi
- if [ "$MONGODB_VERSION" = "3.0*" ]; then echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/testing multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-2.8.list; fi
- sudo apt-get update
- if [ "$MONGODB_VERSION" = "2.4*" ]; then sudo apt-get install -y mongodb-10gen=`echo $MONGODB_VERSION`; fi
- if [ "$MONGODB_VERSION" != "2.4*" ]; then sudo apt-get install -y mongodb-org-server=`echo $MONGODB_VERSION`; fi
- mongod --version
- if [ "$MONGODB_VERSION" = "2.4*" ]; then sudo service mongodb start; fi
- sudo apt-get install libzmq3-dev
before_script:
- (cd node_modules/mosca/node_modules && rm -rf ascoltatori && mkdir ascoltatori && tar -c --exclude node_modules ../../.. | tar -x -C ascoltatori)
Expand All @@ -15,4 +31,3 @@ node_js:
services:
- rabbitmq
- redis-server
- mongodb
13 changes: 4 additions & 9 deletions test/mongo_ascoltatore_spec.js
Expand Up @@ -78,16 +78,12 @@ describeAscoltatore("mongo", function() {
});
});

it("should not suffer from mongo interruptions", function (done) {
it.only("should not suffer from mongo interruptions", function (done) {
this.instance.close(function () {
MongoClient.connect('mongodb://127.0.0.1/ascoltatoriTest4', {}, function (err, db) {
db.on('error', function (dontCare) {
// I don't care
});
db.on('error', done);
this.instance = new ascoltatori.MongoAscoltatore({ db: db });
this.instance.on('error', function (dontCare) {
// I don't care
});
this.instance.on('error', done);
this.instance.on('ready', function () {
_test(this);
}.bind(this));
Expand All @@ -101,8 +97,7 @@ describeAscoltatore("mongo", function() {
}
}, function () {
that.instance.publish("hello/123", "21");
var admin = that.instance.db.admin();
admin.command({closeAllDatabases: 1}, {}, function (err, res) {
that.instance.db.logout({}, function (err, res) {
if (err) {
throw(err);
}
Expand Down

0 comments on commit 5b4aacf

Please sign in to comment.