revert: "build: speed up karma run by passing in list of dist files that changed"

This reverts commit 7fc1ee67d1.

This commit caused the build to break.
This commit is contained in:
Jeff Cross 2015-06-30 14:43:50 -07:00
parent d49459750a
commit fa7da0ca5d
2 changed files with 0 additions and 32 deletions

View File

@ -416,27 +416,9 @@ gulp.task('docs/angular.io', ['build/clean.docs_angular_io'], function() {
// CI tests suites // CI tests suites
function runKarma(configFile, done) { function runKarma(configFile, done) {
var fs = require('fs');
var path = require('path');
var cmd = process.platform === 'win32' ? 'node_modules\\.bin\\karma run ' : var cmd = process.platform === 'win32' ? 'node_modules\\.bin\\karma run ' :
'node node_modules/.bin/karma run '; 'node node_modules/.bin/karma run ';
cmd += configFile; cmd += configFile;
// this file is written into the tmp folder by DestCopy broccoli plugin after each build
var karmaArgsPath = path.join('tmp', 'build-log-karma-args.txt');
if (fs.existsSync(karmaArgsPath)) {
var changedFilesArgs = fs.readFileSync(karmaArgsPath, {encoding: 'utf-8'});
// windows has a limit for the length of the command it can execute, so on win we check the
// length of args provide them only if the length is not over the limit.
// additionally, the arguments don't help the speedup the initial run, so we can safely ignore
// the args when there is lots of them on all platforms
if (changedFilesArgs.length > 10 && changedFilesArgs.length + cmd.length < 0x2000) {
cmd += changedFilesArgs;
}
}
exec(cmd, function(e, stdout) { exec(cmd, function(e, stdout) {
// ignore errors, we don't want to fail the build in the interactive (non-ci) mode // ignore errors, we don't want to fail the build in the interactive (non-ci) mode
// karma server will print all test failures // karma server will print all test failures

View File

@ -30,20 +30,6 @@ class DestCopy implements DiffingBroccoliPlugin {
// TODO: what about obsolete directories? we are not cleaning those up yet // TODO: what about obsolete directories? we are not cleaning those up yet
fs.unlinkSync(destFilePath); fs.unlinkSync(destFilePath);
}); });
// Write log of added/changed/removed files to be used when we call `karma run` from gulp.
var karmaArgs = '';
if (treeDiff.addedPaths.length) {
karmaArgs += ' --addedFiles ' + treeDiff.addedPaths.join(',');
}
if (treeDiff.changedPaths.length) {
karmaArgs += ' --changedFiles ' + treeDiff.changedPaths.join(',');
}
if (treeDiff.removedPaths.length) {
karmaArgs += ' --removedFiles ' + treeDiff.removedPaths.join(',')
}
fs.writeFileSync(path.join('tmp', 'build-log-karma-args.txt'), karmaArgs, {encoding: 'utf-8'});
} }
} }