mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
maybe get self-test working on releases
This commit is contained in:
@@ -115,6 +115,9 @@ release.usingRightReleaseForApp = function (appDir) {
|
||||
release.latestDownloaded = function () {
|
||||
if (! files.usesWarehouse())
|
||||
throw new Error("called from checkout?");
|
||||
// For self-test only.
|
||||
if (process.env.METEOR_TEST_LATEST_RELEASE)
|
||||
return process.env.METEOR_TEST_LATEST_RELEASE;
|
||||
var ret = warehouse.latestRelease();
|
||||
if (! ret)
|
||||
throw new Error("no releases available?");
|
||||
|
||||
@@ -386,6 +386,11 @@ _.extend(Sandbox.prototype, {
|
||||
env.METEOR_SESSION_FILE = path.join(self.root, '.meteorsession');
|
||||
if (self.warehouse)
|
||||
env.METEOR_WAREHOUSE_DIR = self.warehouse;
|
||||
// By default (ie, with no mock warehouse and no --release arg) we should be
|
||||
// testing the actual release this is built in, so we pretend that it is the
|
||||
// latest release.
|
||||
if (!self.warehouse && release.current.isProperRelease())
|
||||
env.METEOR_TEST_LATEST_RELEASE = release.current.name;
|
||||
|
||||
return new Run(self.execPath, {
|
||||
sandbox: self,
|
||||
@@ -410,6 +415,12 @@ _.extend(Sandbox.prototype, {
|
||||
var self = this;
|
||||
files.cp_r(path.join(__dirname, 'tests', 'apps', template),
|
||||
path.join(self.cwd, to));
|
||||
// If the test isn't explicitly managing a mock warehouse, ensure that apps
|
||||
// run with our release by default.
|
||||
if (!self.warehouse && release.current.isProperRelease()) {
|
||||
self.write(path.join(self.cwd, to, '.meteor/release'),
|
||||
release.current.name);
|
||||
}
|
||||
},
|
||||
|
||||
// Change the cwd to be used for subsequent runs. For example:
|
||||
|
||||
Reference in New Issue
Block a user