chore(dart e2e): add --[no-]pub flag (#2171)

This flag (on by default) determines if `pub {upgrade,build}` is run
before launching e2e tests. It is useful to be able to disable when
tweaking the e2e tests themselves.
This commit is contained in:
Patrice Chalin 2016-08-22 15:02:19 -07:00 committed by Kathy Walrath
parent 10568ca5b3
commit d7ade2366a
1 changed files with 8 additions and 4 deletions

View File

@ -344,10 +344,14 @@ function runE2eDartTests(appDir, outputFile) {
gutil.log('http-server failed to launch over ' + deployDir);
return false;
}
var pubUpgradeSpawnInfo = spawnExt('pub', ['upgrade'], { cwd: appDir });
var prepPromise = pubUpgradeSpawnInfo.promise.then(function (data) {
return spawnExt('pub', ['build'], { cwd: appDir }).promise;
});
if (argv.pub === false) {
var prepPromise = Promise.resolve(true);
} else {
var pubUpgradeSpawnInfo = spawnExt('pub', ['upgrade'], { cwd: appDir });
var prepPromise = pubUpgradeSpawnInfo.promise.then(function (data) {
return spawnExt('pub', ['build'], { cwd: appDir }).promise;
});
}
return runProtractor(prepPromise, appDir, appRunSpawnInfo, outputFile);
}