Coder Social home page Coder Social logo

runner's Introduction

mongodb-runner

Easily install and run MongoDB to test your code against it.

Table of Contents

Introduction

This is a tool I wrote for a node app using MongoDB that I was working on. I wanted other contributors to have the database, MongoDB, just work without any extra steps once they cloned the repo and installed app dependencies.

Then I wanted to be able to test using different versions and configurations of mongo. This tool allowed me to test new releases and configurations of mongo before changing anything in our app servers on AWS.

⚠️ For experiments only: Please do not use this tool in production or for anything that considers data storage to be 100% emphemeral.

How to play with MongoDB

npm install -g mongodb-runner;
mongodb-runner start; # downloads mongodb and starts locally
mongo; # Shell opens connected to mongodb://localhost:27017

Debugging

mongodb-runner uses the debug module so if something isn't working correctly, set the DEBUG environment variable to DEBUG=mongodb-* for lots of helpful messages.

Configuration

version

The latest stable version of MongoDB will automatically be downloaded and installed by default when start is run.

[Default: stable]

port

The port MongoDB will be accessible locally on.

[Default: 27017]

dbpath

The base path for data storage. [Default: ~/.mongodb/data/standalone]

logpath

The base directory for data to be stored. [Default: ~/.mongodb/logs/standalone.log]

topology

One of standalone, replicaset, or cluster [Default: standalone].

replicaset options

only applicable when topology is replicaset

arbiters

The number of arbiter processes to start [Default: 0].

passives

The number of passive processes to start [Default: 1].

secondaries

How many secondary instances to start [Default: 2].

cluster options

only applicable when topology is cluster

shards

Number of shards in the cluster [Default: 2].

routers

Number of router processes to start [Default: 2].

configs

Number of config server processes to start [Default: 1].

routerPort

Port number to start incrementing from when starting routers [Default 50000].

shardPort

Port number to start incrementing from when starting shard members [Default 31000].

configPort

Port number to start incrementing from when starting config servers [Default 35000].

Using Environment Variables

Option Environment Variable
version MONGODB_VERSION
port MONGODB_PORT
topology MONGODB_TOPOLOGY
arbiters MONGODB_ARBITERS
secondaries MONGODB_SECONDARIES
passives MONGODB_PASSIVES
shards MONGODB_SHARDS
routers MONGODB_ROUTERS
configs MONGODB_CONFIGS
shards_port MONGODB_SHARDS_PORT
configs_port MONGODB_CONFIGS_PORT
arbiters MONGODB_ARBITERS
secondaries MONGODB_SECONDARIES
passives MONGODB_PASSIVES

CLI

Usage: mongodb-runner <start|stop> [options]

Start/stop mongodb for testing.

Options:
  --topology=<topology>         One of standalone, replicaset, or cluster [Default: `standalone`].
  --pidpath=<pidpath>           Where to put pid files [Default: `~/.mongodb/pids`].
  --bin=<path>                  Path to mongod|mongos binary [Default: `which mongod|mongos`].

Options depending on `--topology`:
  --topology=standalone
    --name=<name>                 The replSet name [Default: `my-standalone`].
    --port=<port>                 Port to start mongod on [Default: `27017`].
    --dbpath=<dbpath>             Where to put the data [Default: `~/.mongodb/data/[standalone]`]
    --logpath=<logpath>           [Default: `~/.mongodb/#{name}.log`]

  --topology=replicaset
    --name=<name>                 The replSet name [Default: `my-replicaset`].
    --port=<port>                 The starting port to use for mongod instances [Default: `31000`].
    --dbpath=<dbpath>             [Default: `~/.mongodb/data/#{name}-#{instance_id}`]
    --logpath=<logpath>           [Default: `~/.mongodb/#{name}.log/#{instance_id}.log`]
    --arbiters=<n>                How many arbiters to start [Default: `0`].
    --passives=<n>                How many passive instances to start [Default: `1`].
    --secondaries=<n>             How many secondary instances to start [Default: `2`]. Maps to `secondaries` option.

  --topology=cluster
    --shards=<n>                  Number of shards in the cluster [Default: `2`].
    --routers=<n>                 Number of router instances [Default: `2`].
    --configs=<n>                 Number of config servers [Default: `1`].
    --routerPort=<port>           Port number to start incrementing from when starting routers [Default `50000`].
    --port=<port>                 Port number to start incrementing from when starting shard members [Default `31000`].
    --configPort=<port>           Port number to start incrementing from when starting shard members [Default `35000`].

Environment Variables:
  MONGODB_VERSION      What version of MongoDB should be installed and available [Default: `stable`]
  MONGODB_TOPOLOGY     See `--topology`
  MONGODB_PORT         See `--port`
  MONGODB_TOPOLOGY     See `topology`
  MONGODB_ARBITERS     See `arbiters`
  MONGODB_SECONDARIES  See `secondaries`
  MONGODB_PASSIVES     See `passives`
  MONGODB_SHARDS       See `--shards`
  MONGODB_ROUTERS      See `--routers`
  MONGODB_CONFIGS      See `--configs`
  MONGODB_SHARDS_PORT  See `--shardPort`
  MONGODB_CONFIGS_PORT See `--configPort`
  MONGODB_ARBITERS     See `--arbiters`
  MONGODB_SECONDARIES  See `--secondaries`
  MONGODB_PASSIVES     See `--passives`

TravisCI

Modify your package.json to start and stop MongoDB before and after your tests automatically when you run npm test:

{
  "scripts": {
    "pretest": "mongodb-runner start",
    "test": "mocha",
    "posttest": "mongodb-runner stop"
  }
}

Update your .travis.yml to run your tests against the full version + topology matrix:

language: node_js
cache:
  directories:
    - node_modules
env:
  - MONGODB_VERSION=^3.6.0 MONGODB_TOPOLOGY=standalone
  - MONGODB_VERSION=stable MONGODB_TOPOLOGY=standalone
  - MONGODB_VERSION=unstable MONGODB_TOPOLOGY=standalone
  - MONGODB_VERSION=^3.6.0 MONGODB_TOPOLOGY=replicaset
  - MONGODB_VERSION=stable MONGODB_TOPOLOGY=replicaset
  - MONGODB_VERSION=unstable MONGODB_TOPOLOGY=replicaset
  - MONGODB_VERSION=^3.6.0 MONGODB_TOPOLOGY=cluster
  - MONGODB_VERSION=stable MONGODB_TOPOLOGY=cluster
  - MONGODB_VERSION=unstable MONGODB_TOPOLOGY=cluster

And πŸŽ‰ Now you're fully covered for all of those all of those edge cases the full version + topology matrix can present!

Mocha

Mocha before/after hooks make writing tests for code that depends on MongoDB insanely simple:

describe('my app', function() {
  before(require('mongodb-runner/mocha/before'));
  after(require('mongodb-runner/mocha/after'));
  it('should connect', function(done) {
    require('mongodb').connect('mongodb://localhost:27017/', done);
  });
});

Global hooks are also supported. Add the following to a new file called test/mongodb.js:

before(require('mongodb-runner/mocha/before'));
after(require('mongodb-runner/mocha/after'));

And then just require it:

mocha --require test/mongodb.js test/*.test.js

License

Apache 2.0

runner's People

Contributors

addaleax avatar addisonelliott avatar dependabot-preview[bot] avatar durran avatar greenkeeper[bot] avatar greenkeeperio-bot avatar gribnoysup avatar imlucas avatar judahschvimer avatar kangas avatar rose-m avatar rueckstiess avatar tylerbrock avatar vkarpov15 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

runner's Issues

run multiple versions at same time

It appears if you try to start multiple versions with different MONGODB_VERSION vars, it will kill the first instance.

Reproduce:

$ MONGODB_VERSION=2.4 MONGODB_PORT=27018 mongodb-runner start
$ MONGODB_VERSION=3.2 MONGODB_PORT=27017 mongodb-runner start

It'd be nice to be able to run multiple versions at the same time for development environments that require multiple versions of mongo.

Replicaset fails to start for no known reason

Zero info in the logs...

Updated Figured out what's going on:

--nojournal causes replicasets to fail to start in a way that can only be diagnosed by inspecting the logs after failure:

 [initandlisten] Detected configuration for non-active storage engine mmapv1 when current storage engine is wiredTiger
[initandlisten] Running wiredTiger without journaling in a replica set is not supported. Make sure you are not using --nojournal and that storage.journal.enabled is not set to 'false'.
[initandlisten] shutdown: going to close listening sockets...

Error in 3.1.16

hey guys, seems that the 3.1.16 release has a slightly embarrassing problem that was not here in 3.1.15

/home/travis/build/ParsePlatform/parse-server/node_modules/mongodb-runner/node_modules/mongodb-tools/node_modules/mongodb-core/lib/topologies/server.js:781
      catch(err) { process.nextTick(function() { throw err}); }
                                                 ^
Error: channel closed
    at process.target.send (internal/child_process.js:510:16)
    at /home/travis/build/ParsePlatform/parse-server/node_modules/mongodb-runner/lib/worker.js:250:15
    at null.<anonymous> (/home/travis/build/ParsePlatform/parse-server/node_modules/mongodb-runner/node_modules/mongodb-tools/lib/tools/server_manager.js:230:11)
    at emitOne (events.js:77:13)
    at emit (events.js:169:7)
    at /home/travis/build/ParsePlatform/parse-server/node_modules/mongodb-runner/node_modules/mongodb-tools/node_modules/mongodb-core/lib/topologies/server.js:408:23
    at /home/travis/build/ParsePlatform/parse-server/node_modules/mongodb-runner/node_modules/mongodb-tools/node_modules/mongodb-core/lib/topologies/server.js:780:13
    at Callbacks.emit (/home/travis/build/ParsePlatform/parse-server/node_modules/mongodb-runner/node_modules/mongodb-tools/node_modules/mongodb-core/lib/topologies/server.js:95:3)
    at null.messageHandler (/home/travis/build/ParsePlatform/parse-server/node_modules/mongodb-runner/node_modules/mongodb-tools/node_modules/mongodb-core/lib/topologies/server.js:249:23)
    at Socket.<anonymous> (/home/travis/build/ParsePlatform/parse-server/node_modules/mongodb-runner/node_modules/mongodb-tools/node_modules/mongodb-core/lib/connection/connection.js:265:22)

Make default dbpath more sane + clean error that your dbpath is the real problem

Even travisci has the /data does not exist problem :/ Thinking the default should be the first of the below that is writable:

var os = require('os'),
  path = require('path'),
  fs = require('fs-extra'),
  async = require('async');

function dbpath(recipe, fn){
var search = [];
if(os.platform() === 'win32'){
  search.push(path.resolve((process.env.LOCALAPPDATA || process.env.APPDATA), 
    '/mongodb/data/' + recipe.name));
}
else {
   search.push(untildify('~/.mongodb/data/' + recipe.name);
}
search.push(path.resovle(process.cwd(), '/mongodb/data/' + recipe.name));
}
  0 passing (4m)
  5 failing
  1) runner should start a standalone:
     Error: EACCES, permission denied '/data'
      at Object.fs.mkdirSync (fs.js:647:18)
      at sync (/home/travis/build/imlucas/mongodb-runner/node_modules/mkdirp/index.js:70:13)
      at sync (/home/travis/build/imlucas/mongodb-runner/node_modules/mkdirp/index.js:76:24)
      at Object.sync (/home/travis/build/imlucas/mongodb-runner/node_modules/mkdirp/index.js:76:24)
      at Function.module.exports [as mongod] (/home/travis/build/imlucas/mongodb-runner/lib/bin/mongod.js:161:6)
      at Object.module.exports [as standalone] (/home/travis/build/imlucas/mongodb-runner/recipes/standalone.js:4:14)
      at module.exports (/home/travis/build/imlucas/mongodb-runner/index.js:13:16)
      at Context.<anonymous> (/home/travis/build/imlucas/mongodb-runner/test/index.test.js:6:5)
      at Test.Runnable.run (/home/travis/build/imlucas/mongodb-runner/node_modules/mocha/lib/runnable.js:216:15)
      at Runner.runTest (/home/travis/build/imlucas/mongodb-runner/node_modules/mocha/lib/runner.js:373:10)
      at /home/travis/build/imlucas/mongodb-runner/node_modules/mocha/lib/runner.js:451:12
      at next (/home/travis/build/imlucas/mongodb-runner/node_modules/mocha/lib/runner.js:298:14)
      at /home/travis/build/imlucas/mongodb-runner/node_modules/mocha/lib/runner.js:308:7
      at next (/home/travis/build/imlucas/mongodb-runner/node_modules/mocha/lib/runner.js:246:23)
      at Object._onImmediate (/home/travis/build/imlucas/mongodb-runner/node_modules/mocha/lib/runner.js:275:5)
      at processImmediate [as _immediateCallback] (timers.js:345:15)

cc @TylerBrock

An in-range update of debug is breaking the build 🚨

Version 2.3.3 of debug just got published.

Branch Build failing 🚨
Dependency debug
Current Version 2.3.2
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As debug is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 7 commits .

  • 3ad8df7 Release 2.3.3
  • 8e09edf browser: whitespace
  • 3491ad6 Merge pull request #195 from jalleyne/master
  • 2caf4ef Merge pull request #331 from levithomason/patch-1
  • 20c37fd fix(browser): do not override ls debug if found
  • a746d52 don't create an empty object when no process
  • 6830d9f Catch JSON stringily errors.

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

pre and post actions for a travis.yml

Travis docs have this sleep 15 solution http://docs.travis-ci.com/user/database-setup/#MongoDB

We already have to solve this problem for lots of our own stuff. Use @imlucas/squirrel-server + mongodb-runner to provide a one-liner for a before_script

before_script:
  - curl -fsSL http://mongodb.land/runner/install | bash && mongodb-runner
  - mongo mydb_test --eval 'db.addUser("travis", "test");'
after_script:
   - mongodb-runner stop

Could also be a good spot to get people to use @imlucas/mongodb-datasets for test fixtures.

Mongod not stopped after "mongodb-runner stop"

mongod is not killed by mongodb-runner stop

$ ps -aux | grep mongod | grep -v grep
jdoe  15936 10.2  1.0 1049468 81816 pts/0   Sl   10:32   0:00 /home/jdoe/.nvm/versions/node/v6.6.0/bin/node /home/jdoe/src/WeezHome/api/node_modules/mongodb-runner/bin/mongodb-runner-worker.js --name=standalone --dbpath=/home/jdoe/.mongodb/data/standalone --logpath=/home/jdoe/.mongodb/standalone.log --port=27017 --topology=standalone --mongodBin=mongod --mongosBin=mongos --purge=true --auth_mechanism=none
jdoe  15944  0.0  0.0   4496   776 pts/0    S    10:32   0:00 /bin/sh -c mongod --smallfiles --noprealloc --setParameter enableTestCommands=1 --port 27017 --dbpath /home/jdoe/.mongodb/data/standalone --logpath /home/jdoe/.mongodb/standalone.log --rest --nojournal
jdoe  15945  2.5  0.7 213280 59720 pts/0    Sl   10:32   0:00 mongod --smallfiles --noprealloc --setParameter enableTestCommands=1 --port 27017 --dbpath /home/jdoe/.mongodb/data/standalone --logpath /home/jdoe/.mongodb/standalone.log --rest --nojournal

$ mongodb-runner stop

$ ps -aux | grep mongod | grep -v grep
jdoe  15936  5.4  1.0 1049468 81816 pts/0   Sl   10:32   0:00 /home/jdoe/.nvm/versions/node/v6.6.0/bin/node /home/jdoe/src/WeezHome/api/node_modules/mongodb-runner/bin/mongodb-runner-worker.js --name=standalone --dbpath=/home/jdoe/.mongodb/data/standalone --logpath=/home/jdoe/.mongodb/standalone.log --port=27017 --topology=standalone --mongodBin=mongod --mongosBin=mongos --purge=true --auth_mechanism=none
jdoe  15945  1.6  0.7 214304 59972 pts/0    Sl   10:32   0:00 mongod --smallfiles --noprealloc --setParameter enableTestCommands=1 --port 27017 --dbpath /home/jdoe/.mongodb/data/standalone --logpath /home/jdoe/.mongodb/standalone.log --rest --nojournal

BTW I noticed that the pid file created by mongodb-runner start indeed disappears after the stop. But mongod is still there.
If I kill it manually, it works:

$ killall mongod

$ ps -aux | grep mongod | grep -v grep

Unable to download new 3.6.0 version (stable)

When I try to run mongodb-runner with no options it tries to download mongo db 3.6.0 but I get the following error:

Downloading mongodb-osx-x86_64-3.6.0.tgz
Error: GET http://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.6.0.tgz returned 403

When checking for the urls here https://www.mongodb.org/dl/osx it looks like the 3.6.0 file is osx/mongodb-osx-ssl-x86_64-3.6.0.tgz so the -ssl is missing from the path (or the file without -ssl) is missing.

For now I could solve it using MONGODB_VERSION=3.4.1

This could be an issue with mongodb-version-manager but maybe limiting to the last functioning version here might help until the issue is resolve upstream.

FailedToParse: mirrored config server connections are not supported; for config server replica sets be sure to use the replica set connection string

Error: Command failed: mongos --port 27019 --pidfilepath /Users/lucas/.mongodb/data/cluster/mongos-27019.pid --logpath /Users/lucas/.mongodb/runner/cluster.log/mongos-27019.log --configdb localhost:35000,localhost:35001,localhost:35002
FailedToParse: mirrored config server connections are not supported; for config server replica sets be sure to use the replica set connection string

If the command is instead the below, this should work.

mongos --port 27019 --pidfilepath /Users/lucas/.mongodb/data/cluster/mongos-27019.pid --logpath /Users/lucas/.mongodb/runner/cluster.log/mongos-27019.log --configdb "cluster_configs/localhost:35000,localhost:35001,localhost:35002"

MongoDB Runner Install Fail on OSX El Capitan 10.11.4

$ npm install mongodb-runner
npm WARN deprecated [email protected]: Breaking changes were inadvertantly introduced in [email protected]. Please pin your dependency at 4.8.2 or update to ^5.0.0.  See the note in the readme for state.set for more info
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
...
npm WARN enoent ENOENT: no such file or directory, open '/Users/napster/Downloads/package.json'
npm WARN [email protected] requires a peer of kerberos@~0.0 but none was installed.
npm WARN Downloads No description
npm WARN Downloads No repository field.
npm WARN Downloads No README data
npm WARN Downloads No license field.
$

race condition in auth-basic recipe

We're currently treating .stop() as immediate, but the mongod could still be flushing. Need to make it async and hit the done callback only after we've seen the "really exiting now" log message.

https://mci.10gen.com/ui/task_log_raw/mongoscope_ubuntu_1204_mongodb_2.6.3_daab3b515f146105eeea994e892bf7bba400dbd0_14_07_17_17_32_07_ci_ubuntu_1204_mongodb_2.6.3/0?type=ALL

mongodb-runner:recipe:auth-basic start one time to clear old data
mongod:setup|auth-basic:27001 clearing previous data /data/db/auth-basic
mongod:setup|auth-basic:27001 create data directory /data/db/auth-basic
mongod:setup|auth-basic:27001 starting mongod /data/mci/shell/src/.cache/mongodb/2.6.3/bin/mongod --port 27001 --dbpath /data/db/auth-basic
mongod:setup|auth-basic:27001 2014-07-17T18:04:00.848+0000 [initandlisten] MongoDB starting : pid=6367 port=27001 dbpath=/data/db/auth-basic 64-bit host=ip-10-51-151-11
mongod:setup|auth-basic:27001 2014-07-17T18:04:00.848+0000 [initandlisten] db version v2.6.3
mongod:setup|auth-basic:27001 255f67a66f9603c59380b2a389e386910bbb52cb
mongod:setup|auth-basic:27001 Linux build12.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
mongod:setup|auth-basic:27001 tcmalloc
mongod:setup|auth-basic:27001 { net: { port: 27001 }, storage: { dbPath: "/data/db/auth-basic" } }
mongod:setup|auth-basic:27001 2014-07-17T18:04:00.890+0000 [initandlisten] journal dir=/data/db/auth-basic/journal
mongod:setup|auth-basic:27001 2014-07-17T18:04:00.890+0000 [initandlisten] recover : no journal files present, no recovery needed
mongod:setup|auth-basic:27001 2014-07-17T18:04:01.672+0000 [FileAllocator] allocating new datafile /data/db/auth-basic/local.ns, filling with zeroes...
mongod:setup|auth-basic:27001 2014-07-17T18:04:01.672+0000 [FileAllocator] creating directory /data/db/auth-basic/_tmp
mongod:setup|auth-basic:27001 16MB,  took 0.003 secs
mongod:setup|auth-basic:27001 2014-07-17T18:04:01.679+0000 [FileAllocator] allocating new datafile /data/db/auth-basic/local.0, filling with zeroes...
mongod:setup|auth-basic:27001 64MB,  took 0.002 secs
mongod:setup|auth-basic:27001 local.startup_log properties: { v: 1, key: { _id: 1 }, name: "_id_", ns: "local.startup_log" }
mongod:setup|auth-basic:27001 2014-07-17T18:04:01.685+0000 [initandlisten]    added index to empty collection
mongod:setup|auth-basic:27001 2014-07-17T18:04:01.685+0000 [initandlisten] waiting for connections on port 27001
mongod:setup|auth-basic:27001 ready { port: 2014 }
mongodb-runner:recipe:auth-basic create the initial root user
mongod:setup|auth-basic:27001 2014-07-17T18:04:01.751+0000 [initandlisten] connection accepted from 127.0.0.1:47657 #1 (1 connection now open)
mongodb-runner:shell shell is ready
mongodb-runner:shell running script db.getMongo().getDB('admin').createUser({user: 'root', pwd: 'password', roles: ['root']});
mongodb-runner:shell print('complete:0.7339034164324403')
mongod:setup|auth-basic:27001 2014-07-17T18:04:01.755+0000 [FileAllocator] allocating new datafile /data/db/auth-basic/admin.ns, filling with zeroes...
mongod:setup|auth-basic:27001 16MB,  took 0.001 secs
mongod:setup|auth-basic:27001 2014-07-17T18:04:01.759+0000 [FileAllocator] allocating new datafile /data/db/auth-basic/admin.0, filling with zeroes...
mongod:setup|auth-basic:27001 64MB,  took 0.002 secs
mongod:setup|auth-basic:27001 admin.system.version properties: { v: 1, key: { _id: 1 }, name: "_id_", ns: "admin.system.version" }
mongod:setup|auth-basic:27001 2014-07-17T18:04:01.764+0000 [conn1]    added index to empty collection
mongod:setup|auth-basic:27001 admin.system.users properties: { v: 1, key: { _id: 1 }, name: "_id_", ns: "admin.system.users" }
mongod:setup|auth-basic:27001 2014-07-17T18:04:01.765+0000 [conn1]    added index to empty collection
mongod:setup|auth-basic:27001 admin.system.users properties: { v: 1, unique: true, key: { user: 1, db: 1 }, name: "user_1_db_1", ns: "admin.system.users" }
mongod:setup|auth-basic:27001 2014-07-17T18:04:01.767+0000 [conn1]    added index to empty collection
mongodb-runner:shell { "user" : "root", "roles" : [ "root" ] }
mongodb-runner:recipe:auth-basic restarting to enable auth
mongod:auth-basic:27001 create data directory /data/db/auth-basic
mongod:auth-basic:27001 starting mongod /data/mci/shell/src/.cache/mongodb/2.6.3/bin/mongod --port 27001 --dbpath /data/db/auth-basic --keyFile /data/mci/shell/src/mongoscope-server/node_modules/mongodb-runner/keys/mongodb-keyfile
mongod:setup|auth-basic:27001 2014-07-17T18:04:01.770+0000 [signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends
mongod:setup|auth-basic:27001 2014-07-17T18:04:01.770+0000 [signalProcessingThread] now exiting
mongod:setup|auth-basic:27001
mongod:setup|auth-basic:27001 going to close listening sockets...
mongod:setup|auth-basic:27001 7
mongod:setup|auth-basic:27001 8
mongod:setup|auth-basic:27001 /tmp/mongodb-27001.sock
mongod:setup|auth-basic:27001 going to flush diaglog...
mongod:setup|auth-basic:27001 going to close sockets...
mongod:setup|auth-basic:27001 waiting for fs preallocator...
mongod:setup|auth-basic:27001 lock for final commit...
mongod:setup|auth-basic:27001 final commit...
mongod:setup|auth-basic:27001 2014-07-17T18:04:01.772+0000 [conn1] end connection 127.0.0.1:47657 (0 connections now open)
mongod:auth-basic:27001 2014-07-17T18:04:01.829+0000 [initandlisten] MongoDB starting : pid=6384 port=27001 dbpath=/data/db/auth-basic 64-bit host=ip-10-51-151-11
mongod:auth-basic:27001 2014-07-17T18:04:01.830+0000 [initandlisten] db version v2.6.3
mongod:auth-basic:27001 255f67a66f9603c59380b2a389e386910bbb52cb
mongod:auth-basic:27001 Linux build12.nj1.10gen.cc 2.6.32-431.3.1.el6.x86_64 #1 SMP Fri Jan 3 21:39:27 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49
mongod:auth-basic:27001 tcmalloc
mongod:auth-basic:27001 { net: { port: 27001 }, security: { keyFile: "/data/mci/shell/src/mongoscope-server/node_modules/mongodb-runner/keys/mongodb-keyfile" }, storage: { dbPath: "/data/db/auth-basic" } }
mongod:auth-basic:27001 10310 Unable to lock file: /data/db/auth-basic/mongod.lock. Is a mongod instance already running?, terminating
mongod:auth-basic:27001
mongod:auth-basic:27001 going to close listening sockets...
mongod:auth-basic:27001 going to flush diaglog...
mongod:auth-basic:27001 going to close sockets...
mongod:auth-basic:27001 waiting for fs preallocator...
mongod:auth-basic:27001 lock for final commit...
mongod:auth-basic:27001 final commit...
mongod:auth-basic:27001 closing all files...
mongod:auth-basic:27001 2014-07-17T18:04:01.830+0000 [initandlisten] closeAllFiles() finished
mongod:auth-basic:27001 really exiting now
mongod:setup|auth-basic:27001 closing all files...
mongod:setup|auth-basic:27001 2014-07-17T18:04:01.839+0000 [signalProcessingThread] closeAllFiles() finished
mongod:setup|auth-basic:27001 2014-07-17T18:04:01.839+0000 [signalProcessingThread] journalCleanup...
mongod:setup|auth-basic:27001 2014-07-17T18:04:01.839+0000 [signalProcessingThread] removeJournalFiles
mongod:setup|auth-basic:27001 removing fs lock...
mongod:setup|auth-basic:27001 really exiting now

An in-range update of mocha is breaking the build 🚨

Version 3.2.0 of mocha just got published.

Branch Build failing 🚨
Dependency mocha
Current Version 3.1.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As mocha is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Release Notes testing-coma

3.2.0 / 2016-11-24

πŸ“° News

Mocha is now a JS Foundation Project!

Mocha is proud to have joined the JS Foundation. For more information, read the announcement.

Contributor License Agreement

Under the foundation, all contributors to Mocha must sign the JS Foundation CLA before their code can be merged. When sending a PR--if you have not already signed the CLA--a friendly bot will ask you to do so.

Mocha remains licensed under the MIT license.

πŸ› Bug Fix

  • #2535: Fix crash when --watch encounters broken symlinks (@villesau)
  • #2593: Fix (old) regression; incorrect symbol shown in list reporter (@Aldaviva)
  • #2584: Fix potential error when running XUnit reporter (@vobujs)

πŸŽ‰ Enhancement

πŸ”© Other

Thanks to all our contributors, sponsors and backers! Keep on the lookout for a public roadmap and new contribution guide coming soon.

Commits

The new version differs by 21 commits .

  • b51e360 Release v3.2.0
  • 5badf0b rebuild mocha.js for release v3.2.0 [ci skip]
  • b1d6b49 update CHANGELOG.md for v3.2.0 [ci skip]
  • 7a05a6c use spec reporter in tests by default; closes #2594
  • 004389f tweak timeout messaging; see #2294
  • 12afaf7 cleanup .gitignore [ci skip]
  • edde033 fix XUnit reporter output. Closes #2584
  • f5bef7c Revert test pass symbol in List reporter
  • 4a2e85a ignore files files which are not found by files() (#2538)
  • 79d7414 Add Browser Support Matrix to README.md (#2590) [ci skip]
  • 1d52fd3 use karma-mocha; closes #2570
  • 8941442 adds info about --inspect flag to options in --help
  • 71e7a1e rename some fixture files that had the wrong extension
  • 1a45929 typo in comment
  • b5a424a Link license from current branch

There are 21 commits in total. See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

where is my `mongod` binary file ?

My OS is macOS serria 10.13.3.

I run npm install -g mongodb-runner and mongodb-runner start. Then I can connect to mongodb now.
I knowmongodb-runner is a starter of mongodb, but where is the origin mongod binary file ?

When I run ps -ax | grep mongo, it shows

 8455 ttys002    0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn mongo
75158 ttys002    0:00.92 /usr/local/bin/node /usr/local/lib/node_modules/mongodb-runner/bin/mongodb-runner-worker.js --name=standalone --dbpath=/Users/zjh/.mongodb/data/standalone --logpath=/Users/zjh/.mongodb/runner/standalone.log --port=27017 --topology=standalone --mongodBin=mongod --mongosBin=mongos --purge=true --auth_mechanism=none
75161 ttys002    4:07.65 mongod --smallfiles --noprealloc --setParameter enableTestCommands=1 --port 27017 --dbpath /Users/zjh/.mongodb/data/standalone --logpath /Users/zjh/.mongodb/runner/standalone.log --nojournal

I saw the mongod command above.
But when I run mongod in my shell, it said command not found: mongod.

So, does mongodb-runner install mongo for me? Where is the mongod file ?

For all I know, it is not in /user/bin, /user/local/bin or /user/local/Cellar/

Bug after installing new version: "figures is not defined"

$ m use 3.1.8
  Downloading MongoDB v3.1.8 [========================================] 100% 0.0sec
/usr/local/lib/node_modules/mongodb-version-manager/lib/download.js:52
        console.log(chalk.bold.green(figures.tick),
                                     ^
ReferenceError: figures is not defined
    at WriteStream.onFinish (/usr/local/lib/node_modules/mongodb-version-manager/lib/download.js:52:38)
    at WriteStream.g (events.js:199:16)
    at WriteStream.emit (events.js:129:20)
    at finishMaybe (_stream_writable.js:484:14)
    at afterWrite (_stream_writable.js:362:3)
    at onwrite (_stream_writable.js:352:7)
    at WritableState.onwrite (_stream_writable.js:105:5)
    at fs.js:1799:5
    at FSReqWrap.strWrapper (fs.js:568:5)

--bin not working

I have installed mongodb manually in a custom directory.
I tried to set --bin to my binary path but it didn't work and started to download again.

An in-range update of which is breaking the build 🚨

Version 1.2.12 of which just got published.

Branch Build failing 🚨
Dependency which
Current Version 1.2.11
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As which is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build is in progress Details

  • ❌ continuous-integration/appveyor/branch AppVeyor build failed Details

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

3.2.1 onwards not working on Windows

Example line from package.json:

"scripts": {
    "pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=3.0.8} ./node_modules/.bin/mongodb-runner start"

This works fine up to and including version 3.2.0 but not from 3.2.1 onwards, which gives the error:

[Error: Could not find a MongoDB version matching {"version":"${MONGODB_VERSION:=3.0.8}","arch":"x86_64","platform":"win32","branch":"master","bits":"64","debug":false,"ext":".zip","distro":"2008plus-ssl"}]

Changing package.json gets a little further, in that the version is downloaded correctly. So perhaps a compatibility error with cross-env?

"scripts": {
    "pretest": "cross-env MONGODB_VERSION=3.0.8 ./node_modules/.bin/mongodb-runner start"

A symlink is then attempted but this step does not work unless the test is run in a DOS windows with admin access.

{ [Error: EPERM: operation not permitted, symlink 'C:\Users\Steven Shipton.mongodb\versions\mongodb-3.0.8-windows-64' -> 'C:\Users\Steven Shipton.mongodb\versions\mongodb-current']
errno: -4048,
code: 'EPERM',
syscall: 'symlink',
path: 'C:\Users\Steven Shipton.mongodb\versions\mongodb-3.0.8-windows-64',
dest: 'C:\Users\Steven Shipton.mongodb\versions\mongodb-current' }

An in-range update of which is breaking the build 🚨

Version 1.2.13 of which just got published.

Branch Build failing 🚨
Dependency which
Current Version 1.2.12
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As which is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of lodash.defaults is breaking the build 🚨

Version 4.2.0 of lodash.defaults just got published.

Branch Build failing 🚨
Dependency lodash.defaults
Current Version 4.1.0
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As lodash.defaults is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of untildify is breaking the build 🚨

Version 3.0.2 of untildify just got published.

Branch Build failing 🚨
Dependency untildify
Current Version 3.0.1
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As untildify is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 2 commits .

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of debug is breaking the build 🚨

Version 2.4.4 of debug just got published.

Branch Build failing 🚨
Dependency debug
Current Version 2.4.3
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As debug is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 2 commits .

  • f1ca2ab release 2.4.4
  • 69480c3 Work around debug being loaded in preload scripts (#368)

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

No compatible version found: mongodb-tools@'mongodb-js/mongodb-tools'

I try to install. but I've got this message.
How can I fix this? Please help me!

[root@web-3 node]# npm install -g mongodb-runner
npm http GET https://registry.npmjs.org/mongodb-runner
npm http 304 https://registry.npmjs.org/mongodb-runner
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/clui
npm http GET https://registry.npmjs.org/is-mongodb-running/0.0.1
npm http GET https://registry.npmjs.org/lodash.defaults
npm http GET https://registry.npmjs.org/minimist
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/mongodb
npm http GET https://registry.npmjs.org/mongodb-dbpath
npm http GET https://registry.npmjs.org/mongodb-version-manager
npm http GET https://registry.npmjs.org/untildify
npm http 304 https://registry.npmjs.org/clui
npm http 304 https://registry.npmjs.org/is-mongodb-running/0.0.1
npm http 304 https://registry.npmjs.org/minimist
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/mongodb
npm http 304 https://registry.npmjs.org/mongodb-dbpath
npm http 304 https://registry.npmjs.org/mongodb-version-manager
npm http 304 https://registry.npmjs.org/untildify
npm http 304 https://registry.npmjs.org/lodash.defaults
npm http GET https://registry.npmjs.org/mongodb-tools
npm http 304 https://registry.npmjs.org/mongodb-tools
npm ERR! Error: No compatible version found: mongodb-tools@'mongodb-js/mongodb-tools'
npm ERR! Valid install targets:
npm ERR! ["1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","1.0.5","1.0.6"]
npm ERR! at installTargetsError (/usr/lib/node_modules/npm/lib/cache.js:719:10)
npm ERR! at /usr/lib/node_modules/npm/lib/cache.js:638:10
npm ERR! at saved (/usr/lib/node_modules/npm-registry-client/lib/get.js:148:7)
npm ERR! at /usr/lib/node_modules/graceful-fs/polyfills.js:133:7
npm ERR! at Object.oncomplete (fs.js:108:15)
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]

npm ERR! System Linux 3.10.0-327.el7.x86_64
npm ERR! command "node" "/usr/bin/npm" "install" "-g" "mongodb-runner"
npm ERR! cwd /home/node
npm ERR! node -v v0.10.42
npm ERR! npm -v 1.3.6
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/node/npm-debug.log
npm ERR! not ok code 0
[root@web-3 node]#

Raspberry Pi?

I wanted to run an parse server (which uses this node module) on an raspberry pi2. it did download mongodb (it says βœ” Downloaded MongoDB 3.2.7 ) but it was unable to connect to it. error is

parse-server running on http://localhost:1337/parse
error: Uncaught internal server error. { [MongoError: connect ECONNREFUSED 127.0.0.1:27017]
name: 'MongoError',
message: 'connect ECONNREFUSED 127.0.0.1:27017' } Error: connect ECONNREFUSED 127.0.0.1:27017
at Object.exports._errnoException (util.js:856:11)
at exports._exceptionWithHostPort (util.js:879:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1057:14)

Is there a way to fix this or have I to do something?

Mocha helpers

Are you sure this code should work?
https://github.com/mongodb-js/runner/blob/master/mocha/before.js#L23

  • before get function with .length === 1 and evaluate it with callback as argument
  • your code decide to return result of same function but with {} as argument
  • mocha gets another function as a result of before action and waits for previously passed callback
  • nothing happens

Looks like true way is

before(function(done) {
  require('mongodb-runner/mocha/before')({}).apply(this, arguments)
});

An in-range update of async is breaking the build 🚨

Version 2.1.4 of async just got published.

Branch Build failing 🚨
Dependency async
Current Version 2.1.2
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As async is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of pre-commit is breaking the build 🚨

Version 1.2.0 of pre-commit just got published.

Branch Build failing 🚨
Dependency pre-commit
Current Version 1.1.3
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As pre-commit is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 8 commits .

  • 1689e3e [dist] 1.2.0 - Better windows support
  • a9c9732 solves the windows issue (with symlinks) (#84)
  • 4167676 chore(package): update mocha to version 3.2.0 (#86)
  • 3cf4cf7 chore(package): update dependencies (#85)
  • 7154dee Update dep to remove warn about cross-spaw (#76)
  • ead9484 cross-spawn@4 (#77)
  • fec48cb [ci] Remove NPM hack and old npm
  • 18da668 [deps] Fix npmgate

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

TypeError: Path must be a string. Received undefined

Can't start cluster. As with #134, this will need to be fixed in mongodb-tools fork.

  mongodb-runner waiting for error or message from forked worker... +1ms
  mongodb-runner:worker worker opts: {"_":[],"name":"cluster","dbpath":"/home/travis/.mongodb/data/cluster","logpath":"/home/travis/.mongodb/runner/cluster.log","port":27018,"topology":"cluster","mongodBin":"mongod","mongosBin":"mongos","purge":"true","auth_mechanism":"none","shards":1,"mongoses":"undefined","configs":1,"shardPort":31000,"configPort":35000,"arbiters":0,"passives":0,"secondaries":2} +0ms
path.js:28
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^
TypeError: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at Object.dirname (path.js:1364:5)
    at startCluster (/home/travis/build/mongodb-js/data-service/node_modules/mongodb-runner/lib/worker.js:173:20)
    at Function.module.exports [as worker] (/home/travis/build/mongodb-js/data-service/node_modules/mongodb-runner/lib/worker.js:221:14)
    at Object.<anonymous> (/home/travis/build/mongodb-js/data-service/node_modules/mongodb-runner/bin/mongodb-runner-worker.js:5:5)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)

An in-range update of mongodb is breaking the build 🚨

Version 2.2.12 of mongodb just got published.

Branch Build failing 🚨
Dependency mongodb
Current Version 2.2.11
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As mongodb is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 32 commits .

  • 4a77151 updated history
  • f98951d NODE-864 close event not emits during network issues using single server topology
  • 9f5fd14 fixed const issues
  • c31092e fixed sni test
  • 5d2b36c Merge branch '2.2' of github.com:mongodb/node-mongodb-native into 2.2
  • 05b8770 Introduced maxStalenessSeconds
  • a26e04f Merge pull request #1443 from perrin4869/2.2
  • b501b69 Fix createIndex name option type
  • 5b84ba5 Merge pull request #1429 from LPGhatguy/patch-1
  • 0a67df4 Merge pull request #1432 from CaselIT/patch-1
  • c5e8f20 fixed sni tests to work correctly
  • 9d1bb79 Added SNI test and updated runner and gitignore
  • 7aa7160 NODE-843 Executing bulk operations overwrites write concern parameter
  • 9bb3ddc NODE-846 Create notice for all third party libraries
  • c5bb3fb NODE-840 Added CRUD specification test cases and fix minor issues with upserts reporting matchedCount > 0

There are 32 commits in total. See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

killall support

need something better than killall -9 mongod mongos as the proc's started by kernel scripts dont always exit like they're supposed to :/

TypeError: invalid pid on Ubuntu 14.04.5 LTS

Leaving this here as I found a workaround and in case time permits to revisit it.

Original output and stack trace

mongo@mongo-ubuntu-14-04:~/Projects/compass$ npm test

> [email protected] pretest /home/mongo/Projects/compass
> mongodb-runner install && mongodb-runner start --port 27018

  β—œ Starting a MongoDB deployment to test against...TypeError: invalid pid
    at process.kill (internal/process.js:156:13)
    at kill (/home/mongo/Projects/compass/node_modules/mongodb-runner/lib/index.js:60:13)
    at nextTask (/home/mongo/Projects/compass/node_modules/mongodb-runner/node_modules/async/dist/async.js:5297:14)
    at next (/home/mongo/Projects/compass/node_modules/mongodb-runner/node_modules/async/dist/async.js:5304:9)
    at /home/mongo/Projects/compass/node_modules/mongodb-runner/node_modules/async/dist/async.js:906:16
    at /home/mongo/Projects/compass/node_modules/mongodb-runner/lib/index.js:42:9
    at /home/mongo/Projects/compass/node_modules/graceful-fs/graceful-fs.js:78:16
    at tryToString (fs.js:426:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:413:12)
npm ERR! Test failed.  See above for more details.

With DEBUG=*

$ DEBUG=* npm test

> [email protected] pretest /home/mongo/Projects/compass
> mongodb-runner install && mongodb-runner start --port 27018

  mongodb-version-manager:activate added `/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/mongodb-current/bin` to $PATH and its now `/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/mongodb-current/bin:/home/mongo/.nvm/versions/node/v7.4.0/lib/node_modules/npm/bin/node-gyp-bin:/home/mongo/Projects/compass/node_modules/.bin:/home/mongo/.nvm/versions/node/v7.4.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games` +0ms
  mongodb-runner:bin running action `install` +0ms
  mongodb-download-url Building URL for options `{"version":"stable","arch":"x86_64","platform":"linux","branch":"master","bits":"64","debug":false,"ext":".tgz","distro":"linux_64"}` +0ms
  mongodb-version-list getting versions list +1ms
  mongodb-version-list versions cache /tmp/dl.mongodb.org/dl/src +1ms
  mongodb-version-list cache last modified 1507090526406 +1ms
  mongodb-version-list using cached versions html +1ms
  mongodb-version-list extracting from 2592 links in table +117ms
  mongodb-version-list filtering out pre 2.2 versions +115ms
  mongodb-version-list 273 versions of mongodb are available +33ms
  mongodb-download-url fully resolved +8ms {
  "version": "3.4.9",
  "arch": "x86_64",
  "platform": "linux",
  "branch": "master",
  "bits": "64",
  "debug": false,
  "ext": ".tgz",
  "distro": "linux_64",
  "name": "mongodb",
  "artifact": "mongodb-linux-x86_64-3.4.9.tgz",
  "url": "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.9.tgz"
}
  mongodb-version-manager:resolve resolved { name: 'mongodb',
  platform: 'linux',
  version: '3.4.9',
  filename: 'mongodb-linux-x86_64-3.4.9.tgz',
  url: 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.9.tgz',
  debug: false,
  enterprise: false,
  distro: 'linux_64',
  bits: '64',
  directory: '/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb',
  download_directory: '/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/downloads',
  download_path: '/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/downloads/mongodb-linux-x86_64-3.4.9.tgz',
  root_directory: '/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/mongodb-3.4.9-linux-64',
  bin_directory: '/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/mongodb-3.4.9-linux-64/bin' } +0ms
  mongodb-version-manager:download downloading { name: 'mongodb',
  platform: 'linux',
  version: '3.4.9',
  filename: 'mongodb-linux-x86_64-3.4.9.tgz',
  url: 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.9.tgz',
  debug: false,
  enterprise: false,
  distro: 'linux_64',
  bits: '64',
  directory: '/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb',
  download_directory: '/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/downloads',
  download_path: '/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/downloads/mongodb-linux-x86_64-3.4.9.tgz',
  root_directory: '/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/mongodb-3.4.9-linux-64',
  bin_directory: '/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/mongodb-3.4.9-linux-64/bin' } +0ms
  mongodb-version-manager:download already have artifact at `/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/mongodb-3.4.9-linux-64/bin` +1ms
  mongodb-version-manager:activate removing old symlink if it exists... +454ms
  mongodb-version-manager:activate symlinking `/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/mongodb-3.4.9-linux-64` -> `/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/mongodb-current`... +7ms
  mongodb-runner configuring... +0ms
  mongodb-runner configured opts { debug: false,
  action: 'install',
  version: undefined,
  topology: 'standalone',
  name: 'standalone',
  logpath: '/home/mongo/.mongodb/runner/standalone.log',
  pidpath: '/home/mongo/.mongodb/runner/pid',
  port: 27017,
  mongodBin: 'mongod',
  mongosBin: 'mongos',
  storageEngine: undefined,
  auth_mechanism: 'none',
  purge: true } +4ms
  mongodb-dbpath searching for writeable dbpath in +38ms [ '/home/mongo/.mongodb/data/standalone',
  '/mongodb/data/standalone' ]
  mongodb-dbpath dbpath is +2ms /home/mongo/.mongodb/data/standalone
  mongodb-runner:bin ran action `install` successfully +320ms
  mongodb-version-manager:activate added `/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/mongodb-current/bin` to $PATH and its now `/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/mongodb-current/bin:/home/mongo/.nvm/versions/node/v7.4.0/lib/node_modules/npm/bin/node-gyp-bin:/home/mongo/Projects/compass/node_modules/.bin:/home/mongo/.nvm/versions/node/v7.4.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games` +0ms
  mongodb-runner:bin running action `start` +0ms
  mongodb-download-url Building URL for options `{"version":"stable","arch":"x86_64","platform":"linux","branch":"master","bits":"64","debug":false,"ext":".tgz","distro":"linux_64"}` +0ms
  mongodb-version-list getting versions list +1ms
  mongodb-version-list versions cache /tmp/dl.mongodb.org/dl/src +1ms
  mongodb-version-list cache last modified 1507090526406 +2ms
  mongodb-version-list using cached versions html +3ms
  mongodb-version-list extracting from 2592 links in table +130ms
  mongodb-version-list filtering out pre 2.2 versions +105ms
  mongodb-version-list 273 versions of mongodb are available +22ms
  mongodb-download-url fully resolved +3ms {
  "version": "3.4.9",
  "arch": "x86_64",
  "platform": "linux",
  "branch": "master",
  "bits": "64",
  "debug": false,
  "ext": ".tgz",
  "distro": "linux_64",
  "name": "mongodb",
  "artifact": "mongodb-linux-x86_64-3.4.9.tgz",
  "url": "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.9.tgz"
}
  mongodb-version-manager:resolve resolved { name: 'mongodb',
  platform: 'linux',
  version: '3.4.9',
  filename: 'mongodb-linux-x86_64-3.4.9.tgz',
  url: 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.9.tgz',
  debug: false,
  enterprise: false,
  distro: 'linux_64',
  bits: '64',
  directory: '/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb',
  download_directory: '/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/downloads',
  download_path: '/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/downloads/mongodb-linux-x86_64-3.4.9.tgz',
  root_directory: '/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/mongodb-3.4.9-linux-64',
  bin_directory: '/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/mongodb-3.4.9-linux-64/bin' } +0ms
  mongodb-version-manager:download downloading { name: 'mongodb',
  platform: 'linux',
  version: '3.4.9',
  filename: 'mongodb-linux-x86_64-3.4.9.tgz',
  url: 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.9.tgz',
  debug: false,
  enterprise: false,
  distro: 'linux_64',
  bits: '64',
  directory: '/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb',
  download_directory: '/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/downloads',
  download_path: '/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/downloads/mongodb-linux-x86_64-3.4.9.tgz',
  root_directory: '/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/mongodb-3.4.9-linux-64',
  bin_directory: '/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/mongodb-3.4.9-linux-64/bin' } +0ms
  β—œ Starting a MongoDB deployment to test against...  mongodb-version-manager:download already have artifact at `/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/mongodb-3.4.9-linux-64/bin` +2ms
  mongodb-version-manager:activate removing old symlink if it exists... +488ms
  mongodb-version-manager:activate symlinking `/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/mongodb-3.4.9-linux-64` -> `/home/mongo/Projects/compass/node_modules/mongodb-version-manager/.mongodb/mongodb-current`... +2ms
  mongodb-runner configuring... +0ms
  mongodb-runner configured opts { debug: false,
  port: 27018,
  action: 'start',
  version: undefined,
  topology: 'standalone',
  name: 'standalone',
  logpath: '/home/mongo/.mongodb/runner/standalone.log',
  pidpath: '/home/mongo/.mongodb/runner/pid',
  mongodBin: 'mongod',
  mongosBin: 'mongos',
  storageEngine: undefined,
  auth_mechanism: 'none',
  purge: true } +3ms
  mongodb-dbpath searching for writeable dbpath in +36ms [ '/home/mongo/.mongodb/data/standalone',
  '/mongodb/data/standalone' ]
  mongodb-dbpath dbpath is +12ms /home/mongo/.mongodb/data/standalone
  mongodb-runner starting! +16ms
  mongodb-runner killing existing pid NaN +1ms
TypeError: invalid pid
    at process.kill (internal/process.js:156:13)
    at kill (/home/mongo/Projects/compass/node_modules/mongodb-runner/lib/index.js:60:13)
    at nextTask (/home/mongo/Projects/compass/node_modules/mongodb-runner/node_modules/async/dist/async.js:5297:14)
    at next (/home/mongo/Projects/compass/node_modules/mongodb-runner/node_modules/async/dist/async.js:5304:9)
    at /home/mongo/Projects/compass/node_modules/mongodb-runner/node_modules/async/dist/async.js:906:16
    at /home/mongo/Projects/compass/node_modules/mongodb-runner/lib/index.js:42:9
    at /home/mongo/Projects/compass/node_modules/graceful-fs/graceful-fs.js:78:16
    at tryToString (fs.js:426:3)
    at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:413:12)
npm ERR! Test failed.  See above for more details.

So that's a NaN pid.

Digging a little

$ ls -l /home/mongo/.mongodb/runner/pid/standalone.pid
-rw-rw-r-- 1 mongo mongo 0 Sep 29 16:19 /home/mongo/.mongodb/runner/pid/standalone.pid

Workaround

mv ${HOME}/.mongodb/runner/pid/standalone.pid ${HOME}/.mongodb/runner/pid/standalone2.pid

I have no idea why the standalone.pid was written as what appears to be a 0 byte length (empty) file, though I think it would be nice if MongoDB runner were able to handle this case more gracefully.

An in-range update of async is breaking the build 🚨

Version 2.1.5 of async just got published.

Branch Build failing 🚨
Dependency async
Current Version 2.1.4
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As async is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Failed to open configsrv log files

  mongodb-tools:server_manager exec completed: {"error":{"killed":false,"code":1,"signal":null,"cmd":"mongod --setParameter enableTestCommands=1 --configsvr --dbpath /Users/lucas/.mongodb/data/cluster/configs/data-35002 --logpath /Users/lucas/.mongodb/runner/cluster.log/configs/data-35002.log --replSet cluster_configs --port 35002"}}. Captured stdout and stderr: +15ms
  mongodb-tools:server_manager mongod:stdout >  2018-09-26T17:25:58.003-0400 I CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none' +0ms
  mongodb-tools:server_manager mongod:stdout >  2018-09-26T17:25:58.008-0400 F CONTROL  [main] Failed global initialization: FileNotOpen: Failed to open "/Users/lucas/.mongodb/runner/cluster.log/configs/data-35002.log" +0ms

An in-range update of mongodb-version-manager is breaking the build 🚨

Version 1.0.7 of mongodb-version-manager just got published.

Branch Build failing 🚨
Dependency mongodb-version-manager
Current Version 1.0.6
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As mongodb-version-manager is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 13 commits .

  • 611e3e7 1.0.7
  • d59e27b Update dependencies to enable Greenkeeper 🌴 (#130)
  • 35234ea Helpful examples (#114)
  • 73e17dd Update contributing docs (#112)
  • 4264579 Document how to install via npm and usage (#110)
  • 26a72c6 m with no args usage (#113)
  • 4756284 :arrow_up: [email protected]
  • 9c8bf39 :memo: :lipstick:
  • 346e61c :zap: :checkered_flag: Update appveyor tpl
  • 2a5f7d6 :zap: Update travis tpl
  • 52e8d6e chore(package): update mocha to version 3.0.2 (#102)
  • 1188f81 chore(package): update async to version 2.0.1 (#98)
  • 5fde51f chore(package): update semver to version 5.3.0 (#97)

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Add option to specify storage engine from environment variable

Hey @imlucas, I'm providing MONGODB_VERSION=3.2.6 BUT I want to start them with mmapv1 instead of the new hotness for a test I'm running. From what I can tell there is nothing like MONGODB_STORAGE_ENGINE getting plucked out of the env during the opts construction, am I missing something?

3.2.2 fails due to graceful-fs module needing an update

Hi,

I get this:

β†’ mongodb-runner start
(node:78820) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
β—Ÿ Starting a MongoDB deployment to test against...(node:78821) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
β—Ÿ Starting a MongoDB deployment to test against...%

works fine locally, but failing on travis?

I've been trying to get mongodb-runner working with travis and I'm failing.

I've created a bare bones repo that manifests the problem.

https://github.com/acinader/mongodb-runner-test

mongodb-runner is the only package
npm test just runs mongodb-runner start

on my local machine, it does just what you'd expect - it starts mongo

on travis, it fails. I've tried with a number of different versions of node and mongodb and have not been able to get it to work well.

https://travis-ci.org/acinader/mongodb-runner-test/builds

one interesting thing to note. On the private repo that I am trying to get this to work with, I can ssh to the travis docker. If i run npm test twice, the second time it works just fine. I did try adding a sleep, but that didn't help.

Server 4.x can't start

--smallfiles has been removed. Change needed in mongodb-tools fork

mongodb-tools:server_manager Starting with cmd `mongod --smallfiles --noprealloc --setParameter enableTestCommands=1 --port 27018 --dbpath /home/travis/.mongodb/data/standalone --logpath /home/travis/.mongodb/runner/standalone.log --nojournal` +23ms
  mongodb-tools:server_manager exec completed: {"error":{"killed":false,"code":2,"signal":null,"cmd":"mongod --smallfiles --noprealloc --setParameter enableTestCommands=1 --port 27018 --dbpath /home/travis/.mongodb/data/standalone --logpath /home/travis/.mongodb/runner/standalone.log --nojournal"}}. Captured stdout and stderr: +21ms
  mongodb-tools:server_manager mongod:stdout >   +1ms
  mongodb-tools:server_manager mongod:stderr >  Error parsing command line: unrecognised option '--smallfiles' +0ms

An in-range update of pre-commit is breaking the build 🚨

Version 1.1.3 of pre-commit just got published.

Branch Build failing 🚨
Dependency pre-commit
Current Version 1.1.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As pre-commit is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 11 commits .

  • 0f0833a [dist] 1.1.3
  • fa6119d Merge pull request #57 from blacksonic/master
  • 2abd42b Merge pull request #64 from kevinoid/relative-link
  • 1a04430 Make pre-commit hook symlink relative
  • 2ca2fb9 Merge pull request #60 from saiichihashimoto/patch-1
  • b6e63d7 Update README.md
  • 4510f45 [fix] add .bashrc to supported home files
  • 3f83f72 Merge pull request #54 from fhemberger/fix/dependencies
  • 683221f Merge pull request #53 from fhemberger/fix/travis
  • 53ec6e9 Update dependencies
  • eb7ac24 [travis] Add [email protected], use new container infrastructure

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

command not found: mongodb-runner start

So after npm install -g parse-server mongodb-runner, i tried to run mongodb-runner start.

An error popped up that said 'command not found: mongodb-runner start'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.