mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 03:55:49 +08:00
chore(travis): speed up the build
- parallelize the tasks - cache requests (e2e tests) This reduces the time from ~18min to ~12min. It makes the output little messy. We could buffer output of each task and display it once it's fully finished, nicely. I think giving instant feedback is better.
This commit is contained in:
@@ -36,11 +36,13 @@ module.exports = {
|
||||
var browsers = grunt.option('browsers');
|
||||
var reporters = grunt.option('reporters');
|
||||
var noColor = grunt.option('no-colors');
|
||||
var port = grunt.option('port');
|
||||
var p = spawn('node', ['node_modules/karma/bin/karma', 'start', config,
|
||||
singleRun ? '--single-run=true' : '',
|
||||
reporters ? '--reporters=' + reporters : '',
|
||||
browsers ? '--browsers=' + browsers : '',
|
||||
noColor ? '--no-colors' : ''
|
||||
noColor ? '--no-colors' : '',
|
||||
port ? '--port=' + port : ''
|
||||
]);
|
||||
p.stdout.pipe(process.stdout);
|
||||
p.stderr.pipe(process.stderr);
|
||||
@@ -235,5 +237,24 @@ module.exports = {
|
||||
}
|
||||
next();
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
parallelTask: function(name) {
|
||||
var args = [name, '--port=' + this.lastParallelTaskPort];
|
||||
|
||||
if (grunt.option('browsers')) {
|
||||
args.push('--browsers=' + grunt.option('browsers'));
|
||||
}
|
||||
|
||||
if (grunt.option('reporters')) {
|
||||
args.push('--reporters=' + grunt.option('reporters'));
|
||||
}
|
||||
|
||||
this.lastParallelTaskPort++;
|
||||
|
||||
|
||||
return {grunt: true, args: args};
|
||||
},
|
||||
|
||||
lastParallelTaskPort: 9876
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user