implement 'test-packages --disable-oplog'

This commit is contained in:
David Glasser
2013-12-04 12:54:27 -08:00
parent 880cf37a3f
commit 593d980ba6
2 changed files with 13 additions and 4 deletions

View File

@@ -1120,6 +1120,10 @@ Fiber(function () {
.boolean('production')
.describe('production', 'Run in production mode. Minify and bundle CSS and JS files.')
.boolean('once') // See #Once
// To ensure that QA covers both PollingObserveDriver and
// OplogObserveDriver, this option disables oplog for tests.
// (It still creates a replset, it just doesn't do oplog tailing.)
.boolean('disable-oplog')
.describe('settings', 'Set optional data for Meteor.settings on the server')
.usage(
"Usage: meteor test-packages [--release <release>] [options] [package...]\n" +
@@ -1201,6 +1205,7 @@ Fiber(function () {
port: argv.port,
minify: argv.production,
once: argv.once,
disableOplog: argv['disable-oplog'],
testPackages: testPackages,
settingsFile: argv.settings,
banner: "Tests"

View File

@@ -243,7 +243,8 @@ var startServer = function (options) {
env.PORT = options.innerPort;
env.MONGO_URL = options.mongoUrl;
env.MONGO_OPLOG_URL = options.oplogUrl;
if (options.oplogUrl)
env.MONGO_OPLOG_URL = options.oplogUrl;
env.ROOT_URL = options.rootUrl;
if (options.settings)
env.METEOR_SETTINGS = options.settings;
@@ -417,9 +418,12 @@ exports.run = function (context, options) {
// Allow people to specify an MONGO_OPLOG_URL override. If someone specifies a
// MONGO_URL but not an MONGO_OPLOG_URL, disable the oplog. If neither is
// specified, use the default internal mongo oplog.
var oplogUrl = process.env.MONGO_OPLOG_URL ||
(process.env.MONGO_URL ? undefined
: "mongodb://127.0.0.1:" + mongoPort + "/local");
var oplogUrl = undefined;
if (!options.disableOplog) {
oplogUrl = process.env.MONGO_OPLOG_URL ||
(process.env.MONGO_URL ? undefined
: "mongodb://127.0.0.1:" + mongoPort + "/local");
}
var firstRun = true;
var serverHandle;