build(gulp): exec karma run in a new process to avoid duplicate output

This is not an ideal solution, but I couldn't find another way to supress the output from the runner.

Closes #1813
This commit is contained in:
Igor Minar 2015-05-19 23:14:20 -07:00
parent f9f917bfa4
commit d18463dcdc
1 changed files with 24 additions and 20 deletions

View File

@ -386,14 +386,13 @@ gulp.task('test.unit.js', ['build.js.dev'], function (neverDone) {
runSequence(
'!test.unit.js/karma-server',
'!test.unit.js/karma-run',
'check-format'
function() {
watch('modules/**', [
'!broccoli.js.dev',
'!test.unit.js/karma-run'
]);
}
);
watch('modules/**', [
'!broccoli.js.dev',
'!test.unit.js/karma-run'
]);
});
gulp.task('watch.js.dev', ['build.js.dev'], function (neverDone) {
@ -410,9 +409,11 @@ gulp.task('!test.unit.js/karma-server', function() {
gulp.task('!test.unit.js/karma-run', function(done) {
karma.runner.run({configFile: __dirname + '/karma-js.conf.js'}, function(exitCode) {
// ignore exitCode, we don't want to fail the build in the interactive (non-ci) mode
// karma will print all test failures
// run the run command in a new process to avoid duplicate logging by both server and runner from
// a single process
exec('node node_modules/.bin/karma run karma-js.conf.js', function(e, stdout) {
// ignore errors, we don't want to fail the build in the interactive (non-ci) mode
// karma server will print all test failures
done();
});
});
@ -421,20 +422,23 @@ gulp.task('!test.unit.js/karma-run', function(done) {
gulp.task('test.unit.dart', ['build/tree.dart'], function (done) {
runSequence(
'!test.unit.dart/karma-server',
'!test.unit.dart/karma-run'
'!test.unit.dart/karma-run',
function() {
watch('modules/angular2/**', [
'!build/tree.dart',
'build/format.dart',
'!test.unit.dart/karma-run'
]);
}
);
watch('modules/angular2/**', [
'!build/tree.dart',
'build/format.dart',
'!test.unit.dart/karma-run'
]);
});
gulp.task('!test.unit.dart/karma-run', function (done) {
karma.runner.run({configFile: __dirname + '/karma-dart.conf.js'}, function(exitCode) {
// ignore exitCode, we don't want to fail the build in the interactive (non-ci) mode
// karma will print all test failures
// run the run command in a new process to avoid duplicate logging by both server and runner from
// a single process
exec('node node_modules/.bin/karma run karma-dart.conf.js', function(e, stdout) {
// ignore errors, we don't want to fail the build in the interactive (non-ci) mode
// karma server will print all test failures
done();
});
});