mongodb-runner 4.10.0 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -230
- package/bin/runner.js +3 -0
- package/dist/.esm-wrapper.mjs +5 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +180 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/mongocluster.d.ts +30 -0
- package/dist/mongocluster.d.ts.map +1 -0
- package/dist/mongocluster.js +179 -0
- package/dist/mongocluster.js.map +1 -0
- package/dist/mongologreader.d.ts +18 -0
- package/dist/mongologreader.d.ts.map +1 -0
- package/dist/mongologreader.js +89 -0
- package/dist/mongologreader.js.map +1 -0
- package/dist/mongoserver.d.ts +31 -0
- package/dist/mongoserver.d.ts.map +1 -0
- package/dist/mongoserver.js +235 -0
- package/dist/mongoserver.js.map +1 -0
- package/dist/util.d.ts +6 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +16 -0
- package/dist/util.js.map +1 -0
- package/package.json +66 -53
- package/appveyor.yml +0 -39
- package/bin/mongodb-runner-worker.js +0 -46
- package/bin/mongodb-runner.js +0 -56
- package/index.js +0 -1
- package/lib/index.js +0 -495
- package/lib/worker.js +0 -336
- package/mocha/after.js +0 -45
- package/mocha/before.js +0 -75
- package/usage.txt +0 -50
package/lib/worker.js
DELETED
|
@@ -1,336 +0,0 @@
|
|
|
1
|
-
var Standalone = require('mongodb-tools').ServerManager;
|
|
2
|
-
var Cluster = require('mongodb-tools').ShardingManager;
|
|
3
|
-
var Replicaset = require('mongodb-tools').ReplSetManager;
|
|
4
|
-
var path = require('path');
|
|
5
|
-
var debug = require('debug')('mongodb-runner:worker');
|
|
6
|
-
/**
|
|
7
|
-
* @todo (imlucas): Switch to using `mongodb-connection-model`
|
|
8
|
-
* instead of driver directly.
|
|
9
|
-
*/
|
|
10
|
-
var mongodb = require('mongodb');
|
|
11
|
-
var format = require('util').format;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* This file actually spawns the mongod and mongos processes by leveraging MongoDB-Tools
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* ## Auth Providers
|
|
18
|
-
*/
|
|
19
|
-
/**
|
|
20
|
-
* ### none
|
|
21
|
-
* null => no auth, yo.
|
|
22
|
-
*/
|
|
23
|
-
/**
|
|
24
|
-
* ### scram-sha-1
|
|
25
|
-
*
|
|
26
|
-
* @see https://github.com/mongodb/node-mongodb-native/blob/2.0/test/functional/scram_tests.js
|
|
27
|
-
*
|
|
28
|
-
* Only available if require('get-mongodb-version').is(opts.bin, '>=2.7.5')
|
|
29
|
-
* pass to Standalone|Cluster|Replicaset constructor as well:
|
|
30
|
-
* {
|
|
31
|
-
* setParameter: 'authenticationMechanisms=SCRAM-SHA-1'
|
|
32
|
-
* }
|
|
33
|
-
* And call `server.setCredentials('scram-sha-1', username, password, db, done)`
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* // User and password
|
|
37
|
-
* var user = 'test';
|
|
38
|
-
* var password = 'test';
|
|
39
|
-
* MongoClient.connect('mongodb://localhost:27017/test', function(err, db) {
|
|
40
|
-
* // Create an admin user
|
|
41
|
-
* db.admin().addUser(user, password, function(err, result) {
|
|
42
|
-
* // Attempt to reconnect authenticating against the admin database
|
|
43
|
-
* MongoClient.connect('mongodb://test:test@localhost:27017/test?'
|
|
44
|
-
* + 'authMechanism=SCRAM-SHA-1&authSource=admin&maxPoolSize=5',
|
|
45
|
-
*/
|
|
46
|
-
/**
|
|
47
|
-
* ### mongocr (mongodb-cr)
|
|
48
|
-
*
|
|
49
|
-
* http://docs.mongodb.org/manual/core/authentication/#mongodb-cr-authentication
|
|
50
|
-
*
|
|
51
|
-
*/
|
|
52
|
-
/**
|
|
53
|
-
* ### x509 (ssl)
|
|
54
|
-
* @see http://docs.mongodb.org/manual/core/authentication/#x-509-certificate-authentication
|
|
55
|
-
*/
|
|
56
|
-
/**
|
|
57
|
-
* ## Enterprise-Only Auth Providers
|
|
58
|
-
*/
|
|
59
|
-
/**
|
|
60
|
-
* ### plain
|
|
61
|
-
* a.k.a ldap
|
|
62
|
-
*
|
|
63
|
-
* MongoDB Enterprise Edition versions `2.5.0` and newer support the SASL PLAIN
|
|
64
|
-
* authentication mechanism, initially intended for delegating authentication
|
|
65
|
-
* to an LDAP server. Using the SASL PLAIN mechanism is very similar to MONGODB-CR.
|
|
66
|
-
* These examples use the $external virtual database for LDAP support:
|
|
67
|
-
* SASL PLAIN is a clear-text authentication mechanism. We strongly recommend
|
|
68
|
-
* that you connect to MongoDB using SSL with certificate validation when using
|
|
69
|
-
* the PLAIN mechanism:
|
|
70
|
-
*
|
|
71
|
-
* ```c
|
|
72
|
-
* mongoc_client_t *client;
|
|
73
|
-
* client = mongoc_client_new ('mongodb://user:password@example.com/'
|
|
74
|
-
* + '?authMechanism=PLAIN&authSource=$external');
|
|
75
|
-
* ```
|
|
76
|
-
*/
|
|
77
|
-
/**
|
|
78
|
-
* ### gssapi (kerberos)
|
|
79
|
-
* @see http://docs.mongodb.org/manual/core/authentication/#kerberos-authentication
|
|
80
|
-
*/
|
|
81
|
-
/**
|
|
82
|
-
* ### sspi (kerberos on windows)
|
|
83
|
-
*/
|
|
84
|
-
|
|
85
|
-
var newUserPassOpts = function(opts) {
|
|
86
|
-
var newOpts = {};
|
|
87
|
-
if (opts.topology === 'standalone') {
|
|
88
|
-
newOpts.auth = null;
|
|
89
|
-
if (Number(opts.version) > 2.6) {
|
|
90
|
-
newOpts.setParameter = 'authenticationMechanisms=' + opts.auth_mechanism;
|
|
91
|
-
}
|
|
92
|
-
return newOpts;
|
|
93
|
-
}
|
|
94
|
-
if (opts.topology === 'replicaset') {
|
|
95
|
-
newOpts.auth = null;
|
|
96
|
-
newOpts.keyFile = opts.keyFile;
|
|
97
|
-
if (Number(opts.version) > 2.6) {
|
|
98
|
-
newOpts.setParameter = 'authenticationMechanisms=' + opts.auth_mechanism;
|
|
99
|
-
}
|
|
100
|
-
return newOpts;
|
|
101
|
-
}
|
|
102
|
-
if (opts.topology === 'cluster') {
|
|
103
|
-
newOpts.replicasetOptions = {};
|
|
104
|
-
newOpts.replicasetOptions.auth = null;
|
|
105
|
-
newOpts.replicasetOptions.keyFile = opts.keyFile;
|
|
106
|
-
if (Number(opts.version) > 2.6) {
|
|
107
|
-
newOpts.replicasetOptions.setParameter =
|
|
108
|
-
'authenticationMechanisms=' + opts.auth_mechanism;
|
|
109
|
-
}
|
|
110
|
-
newOpts.configsOptions = {};
|
|
111
|
-
newOpts.configsOptions.auth = null;
|
|
112
|
-
newOpts.configsOptions.keyFile = opts.keyFile;
|
|
113
|
-
newOpts.mongosOptions = {};
|
|
114
|
-
newOpts.mongosOptions.keyFile = opts.keyFile;
|
|
115
|
-
return newOpts;
|
|
116
|
-
}
|
|
117
|
-
return opts;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
var createUser = function(db, username, password, roles, callback) {
|
|
121
|
-
debug('Adding User');
|
|
122
|
-
db.admin().addUser(username, password, roles, function(err, result) {
|
|
123
|
-
debug('Create user result: ' + JSON.stringify(result));
|
|
124
|
-
callback(err, db);
|
|
125
|
-
});
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
var createAdmin = function(db, username, password, callback) {
|
|
129
|
-
debug('Adding admin User');
|
|
130
|
-
var roles = {
|
|
131
|
-
roles: [
|
|
132
|
-
{
|
|
133
|
-
role: 'root',
|
|
134
|
-
db: 'admin'
|
|
135
|
-
}
|
|
136
|
-
]
|
|
137
|
-
};
|
|
138
|
-
createUser(db, username, password, roles, callback);
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
var startStandalone = function(opts) {
|
|
142
|
-
var options = {
|
|
143
|
-
host: 'localhost',
|
|
144
|
-
port: opts.port,
|
|
145
|
-
storageEngine: opts.storage_engine,
|
|
146
|
-
dbpath: opts.dbpath,
|
|
147
|
-
logpath: opts.logpath,
|
|
148
|
-
rest: false,
|
|
149
|
-
purge: opts.purge,
|
|
150
|
-
bin: opts.mongodBin
|
|
151
|
-
};
|
|
152
|
-
return new Standalone(options);
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
var startReplicaset = function(opts) {
|
|
156
|
-
var options = {
|
|
157
|
-
replSet: opts.name,
|
|
158
|
-
startPort: opts.port,
|
|
159
|
-
storageEngine: opts.storage_engine,
|
|
160
|
-
dbpath: opts.dbpath,
|
|
161
|
-
logpath: opts.logpath,
|
|
162
|
-
arbiters: opts.arbiters,
|
|
163
|
-
passives: opts.passives,
|
|
164
|
-
secondaries: opts.secondaries,
|
|
165
|
-
purge: opts.purge,
|
|
166
|
-
rest: false,
|
|
167
|
-
bin: opts.mongodBin
|
|
168
|
-
};
|
|
169
|
-
return new Replicaset(options);
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
var startCluster = function(opts) {
|
|
173
|
-
if (opts.bin && opts.bin !== 'mongod') {
|
|
174
|
-
var dir = path.dirname(opts.bin);
|
|
175
|
-
opts.mongosBin = path.join(dir, 'mongos');
|
|
176
|
-
opts.mongodBin = path.join(dir, 'mongod');
|
|
177
|
-
}
|
|
178
|
-
delete opts.bin;
|
|
179
|
-
var options = {
|
|
180
|
-
replSet: opts.name,
|
|
181
|
-
storageEngine: opts.storage_engine,
|
|
182
|
-
dbpath: opts.dbpath,
|
|
183
|
-
logpath: opts.logpath,
|
|
184
|
-
replsets: opts.shards,
|
|
185
|
-
mongoses: opts.mongoses,
|
|
186
|
-
configs: opts.configs,
|
|
187
|
-
mongosStartPort: opts.port,
|
|
188
|
-
replsetStartPort: opts.shardPort,
|
|
189
|
-
configStartPort: opts.configPort,
|
|
190
|
-
mongosBin: opts.mongosBin,
|
|
191
|
-
mongodBin: opts.mongodBin,
|
|
192
|
-
purge: opts.purge,
|
|
193
|
-
replicasetOptions: {
|
|
194
|
-
secondaries: opts.secondaries,
|
|
195
|
-
arbiters: opts.arbiters,
|
|
196
|
-
passives: opts.passives
|
|
197
|
-
},
|
|
198
|
-
configsOptions: {},
|
|
199
|
-
mongosOptions: {},
|
|
200
|
-
rest: false
|
|
201
|
-
};
|
|
202
|
-
return new Cluster(options);
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* This file is a worker process that actually starts the mongodb deployments.
|
|
207
|
-
* @param {object} opts
|
|
208
|
-
* @param {Function} done stops the worker
|
|
209
|
-
*/
|
|
210
|
-
module.exports = function(opts, done) {
|
|
211
|
-
var server;
|
|
212
|
-
var delay = 0;
|
|
213
|
-
debug(
|
|
214
|
-
'Initializing mongodb-tools topology with opts:' + JSON.stringify(opts)
|
|
215
|
-
);
|
|
216
|
-
opts.purge = opts.purge === 'true';
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Get opts form the commandline and create an options object.
|
|
220
|
-
* This options object is passed to `mongodb-tools` which actually
|
|
221
|
-
* starts the mongodb processes
|
|
222
|
-
*/
|
|
223
|
-
if (opts.topology === 'cluster') {
|
|
224
|
-
server = startCluster(opts);
|
|
225
|
-
delay = 10000;
|
|
226
|
-
} else if (opts.topology === 'replicaset') {
|
|
227
|
-
server = startReplicaset(opts);
|
|
228
|
-
delay = 5000;
|
|
229
|
-
} else {
|
|
230
|
-
server = startStandalone(opts);
|
|
231
|
-
delay = 0;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
// HACCK DON"T LOOK AT ME>>>>>
|
|
236
|
-
opts.server = server;
|
|
237
|
-
|
|
238
|
-
debug('Starting topology...');
|
|
239
|
-
/**
|
|
240
|
-
* @todo (imlucas): Handle mongodb already running (started outside of mongodb-runner)
|
|
241
|
-
* gracefully so you can start mongod in weird ways and not have to change your
|
|
242
|
-
* module's package.json.
|
|
243
|
-
*/
|
|
244
|
-
|
|
245
|
-
server.start(
|
|
246
|
-
{
|
|
247
|
-
kill: false,
|
|
248
|
-
purge: opts.purge
|
|
249
|
-
},
|
|
250
|
-
function(err) {
|
|
251
|
-
if (err) {
|
|
252
|
-
return done(err);
|
|
253
|
-
}
|
|
254
|
-
/* eslint no-shadow:0 */
|
|
255
|
-
debug('Server started without auth');
|
|
256
|
-
if (process.send) {
|
|
257
|
-
var msg = {
|
|
258
|
-
event: 'started',
|
|
259
|
-
opts: opts
|
|
260
|
-
};
|
|
261
|
-
debug('Notifying parent process', msg);
|
|
262
|
-
process.send(msg);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
if (
|
|
266
|
-
opts.auth_mechanism !== 'MONGODB-CR' &&
|
|
267
|
-
opts.auth_mechanism !== 'SCRAM-SHA-1'
|
|
268
|
-
) {
|
|
269
|
-
debug('server ready');
|
|
270
|
-
done(null, opts);
|
|
271
|
-
return;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
if (
|
|
275
|
-
opts.auth_mechanism === 'MONGODB-CR' ||
|
|
276
|
-
opts.auth_mechanism === 'SCRAM-SHA-1'
|
|
277
|
-
) {
|
|
278
|
-
debug('Waiting for start...');
|
|
279
|
-
setTimeout(function() {
|
|
280
|
-
var url = format('mongodb://localhost:%s/test', opts.port);
|
|
281
|
-
debug('User/Pass auth enabled... connecting to MongoDB');
|
|
282
|
-
var client = new mongodb.MongoClient(url);
|
|
283
|
-
client.connect(function(err, client) {
|
|
284
|
-
if (err) {
|
|
285
|
-
return done(err);
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
debug('Creating admin user');
|
|
289
|
-
var db = client.db('admin');
|
|
290
|
-
createAdmin(db, opts.username, opts.password, function(err) {
|
|
291
|
-
if (err) {
|
|
292
|
-
return done(err);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
debug('Closing connection');
|
|
296
|
-
client.close(function(err) {
|
|
297
|
-
if (err) {
|
|
298
|
-
return done(err);
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
debug('Restarting server');
|
|
302
|
-
var newOpts = newUserPassOpts(opts);
|
|
303
|
-
newOpts.purge = opts.purge = false;
|
|
304
|
-
opts.shouldStop = true;
|
|
305
|
-
server.updateServerOptions(newOpts);
|
|
306
|
-
if (opts.auth_mechanism === 'SCRAM-SHA-1') {
|
|
307
|
-
server.setCredentials(
|
|
308
|
-
'scram-sha-1',
|
|
309
|
-
'admin',
|
|
310
|
-
opts.username,
|
|
311
|
-
opts.password
|
|
312
|
-
);
|
|
313
|
-
} else {
|
|
314
|
-
server.setCredentials(
|
|
315
|
-
'mongodb-cr',
|
|
316
|
-
'admin',
|
|
317
|
-
opts.username,
|
|
318
|
-
opts.password
|
|
319
|
-
);
|
|
320
|
-
}
|
|
321
|
-
server.restart(opts, function(err) {
|
|
322
|
-
if (err) {
|
|
323
|
-
return done(err);
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
debug('Waiting for restart...');
|
|
327
|
-
setTimeout(done, delay);
|
|
328
|
-
});
|
|
329
|
-
});
|
|
330
|
-
});
|
|
331
|
-
});
|
|
332
|
-
}, delay);
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
);
|
|
336
|
-
};
|
package/mocha/after.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/* eslint camelcase:0 */
|
|
2
|
-
var runner = require('../');
|
|
3
|
-
var defaults = require('lodash.defaults');
|
|
4
|
-
var debug = require('debug')('mongodb-runner:mocha:after');
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Stop MongoDB on demand after running your tests.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* describe('my app', function(){
|
|
11
|
-
* before(require('mongodb-runner/mocha/before'));
|
|
12
|
-
* after(require('mongodb-runner/mocha/after'));
|
|
13
|
-
* it('should connect', function(done){
|
|
14
|
-
* require('mongodb').connect('mongodb://localhost:27017/', done);
|
|
15
|
-
* });
|
|
16
|
-
* });
|
|
17
|
-
* @param {Object|Function} [opts] - options or the `done` callback.
|
|
18
|
-
* @return {Function} - Callback for mocha bdd `after` hook.
|
|
19
|
-
*/
|
|
20
|
-
function mongodb_runner_mocha_after(opts) {
|
|
21
|
-
if (typeof opts === 'function') {
|
|
22
|
-
// So you can just do `after(require('mongodb-runner/mocha/after'));`
|
|
23
|
-
return mongodb_runner_mocha_after({}).apply(this, arguments);
|
|
24
|
-
}
|
|
25
|
-
opts = opts || {};
|
|
26
|
-
defaults(opts, {
|
|
27
|
-
port: 27017
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
return function(done) {
|
|
31
|
-
if (process.env.MONGODB_RUNNER_MOCHA_SKIP_STOP) {
|
|
32
|
-
debug('not stopping mongodb as it was not started by mocha/before');
|
|
33
|
-
delete process.env.MONGODB_RUNNER_MOCHA_SKIP_STOP;
|
|
34
|
-
done();
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
debug('stopping mongodb...');
|
|
38
|
-
runner({
|
|
39
|
-
port: opts.port,
|
|
40
|
-
action: 'stop'
|
|
41
|
-
}, done);
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
module.exports = mongodb_runner_mocha_after;
|
package/mocha/before.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/* eslint camelcase:0 */
|
|
2
|
-
var runner = require('../');
|
|
3
|
-
var defaults = require('lodash.defaults');
|
|
4
|
-
var running = require('is-mongodb-running');
|
|
5
|
-
var debug = require('debug')('mongodb-runner:mocha:before');
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Start MongoDB on demand before running your tests.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* describe('my app', function(){
|
|
12
|
-
* before(require('mongodb-runner/mocha/before');
|
|
13
|
-
* it('should connect', function(done){
|
|
14
|
-
* require('mongodb').connect('mongodb://localhost:27017/', done);
|
|
15
|
-
* });
|
|
16
|
-
* });
|
|
17
|
-
* @param {Object|Function} [opts] - options or the `done` callback.
|
|
18
|
-
* @return {Function} - Callback for mocha bdd `before` hook.
|
|
19
|
-
*/
|
|
20
|
-
function mongodb_runner_mocha_before(opts) {
|
|
21
|
-
if (typeof opts === 'function') {
|
|
22
|
-
// So you can just do `before(require('mongodb-runner/mocha/before'));`
|
|
23
|
-
return mongodb_runner_mocha_before({}).apply(this, arguments);
|
|
24
|
-
}
|
|
25
|
-
opts = opts || {};
|
|
26
|
-
defaults(opts, {
|
|
27
|
-
port: 27017,
|
|
28
|
-
timeout: 10000,
|
|
29
|
-
slow: 10000
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
return function(done) {
|
|
33
|
-
this.timeout(opts.timeout);
|
|
34
|
-
this.slow(opts.slow);
|
|
35
|
-
|
|
36
|
-
debug('checking if mongodb is running...');
|
|
37
|
-
running(function(err, res) {
|
|
38
|
-
if (err) {
|
|
39
|
-
debug('mongodb detection failed so going to try and start one');
|
|
40
|
-
runner({
|
|
41
|
-
port: opts.port,
|
|
42
|
-
action: 'start'
|
|
43
|
-
}, done);
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
if (res && res.length > 0) {
|
|
47
|
-
if (res[0].port === opts.port) {
|
|
48
|
-
process.env.MONGODB_RUNNER_MOCHA_SKIP_STOP = '1';
|
|
49
|
-
|
|
50
|
-
debug('mongodb already running on `localhost:%s` '
|
|
51
|
-
+ 'so we won\'t start a new one', opts.port);
|
|
52
|
-
done();
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
debug('mongodb already running, but its on '
|
|
57
|
-
+ '`localhost:%d` and we need `localhost:%s` for '
|
|
58
|
-
+ 'the tests so starting up a new one.', res[0].port, opts.port);
|
|
59
|
-
runner({
|
|
60
|
-
action: 'start',
|
|
61
|
-
port: opts.port
|
|
62
|
-
}, done);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
debug('no mongodb running so starting one up');
|
|
66
|
-
runner({
|
|
67
|
-
action: 'start',
|
|
68
|
-
port: opts.port
|
|
69
|
-
}, done);
|
|
70
|
-
return;
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
module.exports = mongodb_runner_mocha_before;
|
package/usage.txt
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
Usage: mongodb-runner <start|stop|install> [options]
|
|
3
|
-
|
|
4
|
-
Start/stop/install MongoDB for testing.
|
|
5
|
-
|
|
6
|
-
Options:
|
|
7
|
-
--topology=<topology> One of standalone, replicaset, or cluster [Default: `standalone`].
|
|
8
|
-
--pidpath=<pidpath> Where to put pid files [Default: `~/mongodb/pids`].
|
|
9
|
-
--bin=<path> Path to mongod|mongos binary [Default: `which mongod|mongos`].
|
|
10
|
-
|
|
11
|
-
Options depending on `--topology`:
|
|
12
|
-
--topology=standalone
|
|
13
|
-
--name=<name> The replSet name [Default: `my-standalone`].
|
|
14
|
-
--port=<port> Port to start mongod on [Default: `27017`].
|
|
15
|
-
--dbpath=<dbpath> Where to put the data [Default: `~/.mongodb/data/#{name}`]
|
|
16
|
-
--logpath=<logpath> [Default: `~/.mongodb/#{name}.log`]
|
|
17
|
-
|
|
18
|
-
--topology=replicaset
|
|
19
|
-
--name=<name> The replSet name [Default: `my-replicaset`].
|
|
20
|
-
--port=<port> The starting port to use for mongod instances [Default: `27017`].
|
|
21
|
-
--dbpath=<dbpath> [Default: `~/.mongodb/data/#{name}-#{instance_id}`]
|
|
22
|
-
--logpath=<logpath> [Default: `~/.mongodb/#{name}.log/#{instance_id}.log`]
|
|
23
|
-
--arbiters=<n> How many arbiters to start [Default: `0`].
|
|
24
|
-
--passives=<n> How many passive instances to start [Default: `1`].
|
|
25
|
-
--secondaries=<n> How many secondary instances to start [Default: `2`]. Maps to `secondaries` option.
|
|
26
|
-
|
|
27
|
-
--topology=cluster
|
|
28
|
-
--shards=<n> Number of shards in the cluster [Default: `2`].
|
|
29
|
-
--routers=<n> Number of router instances [Default: `2`].
|
|
30
|
-
--configs=<n> Number of config servers [Default: `1`].
|
|
31
|
-
--port=<port> Port number to start incrementing from when starting routers [Default `27017`].
|
|
32
|
-
--shardPort=<port> Port number to start incrementing from when starting shard members [Default `31000`].
|
|
33
|
-
--configPort=<port> Port number to start incrementing from when starting shard members [Default `35000`].
|
|
34
|
-
|
|
35
|
-
Environment Variables:
|
|
36
|
-
MONGODB_VERSION What version of MongoDB should be installed and available [Default: `stable`]
|
|
37
|
-
MONGODB_TOPOLOGY See `--topology`
|
|
38
|
-
MONGODB_PORT See `--port`
|
|
39
|
-
MONGODB_TOPOLOGY See `topology`
|
|
40
|
-
MONGODB_ARBITERS See `arbiters`
|
|
41
|
-
MONGODB_SECONDARIES See `secondaries`
|
|
42
|
-
MONGODB_PASSIVES See `passives`
|
|
43
|
-
MONGODB_SHARDS See `--shards`
|
|
44
|
-
MONGODB_ROUTERS See `--routers`
|
|
45
|
-
MONGODB_CONFIGS See `--configs`
|
|
46
|
-
MONGODB_SHARDS_PORT See `--shardPort`
|
|
47
|
-
MONGODB_CONFIGS_PORT See `--configPort`
|
|
48
|
-
MONGODB_ARBITERS See `--arbiters`
|
|
49
|
-
MONGODB_SECONDARIES See `--secondaries`
|
|
50
|
-
MONGODB_PASSIVES See `--passives`
|