Skip to content

Commit

Permalink
🏗 On Travis, collapse the copious error logs printed after test runs (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimha authored and glevitzky committed Apr 27, 2018
1 parent 5bf4675 commit 459504e
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion build-system/tasks/runtime-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,17 @@ function runTests() {
// Avoid Karma startup errors
refreshKarmaWdCache();

// On Travis, collapse the summary printed by the 'karmaSimpleReporter'
// reporter, since it likely contains copious amounts of logs.
const shouldCollapseSummary =
process.env.TRAVIS && c.reporters.includes('karmaSimpleReporter');

let resolver;
const deferred = new Promise(resolverIn => {resolver = resolverIn;});
new Karma(c, function(exitCode) {
if (shouldCollapseSummary) {
console./* OK*/log('travis_fold:end:run_summary');
}
server.emit('kill');
if (exitCode) {
log(
Expand All @@ -377,8 +385,15 @@ function runTests() {
} else {
console./* OK*/log(green('Running tests locally...'));
}
}).on('run_complete', function() {
if (shouldCollapseSummary) {
console./* OK*/log(yellow(
'Console logs (expand this section and fix all errors ' +
'printed by your tests)'));
console./* OK*/log('travis_fold:start:run_summary');
}
}).on('browser_complete', function(browser) {
if (argv.saucelabs || argv.saucelabs_lite) {
if (shouldCollapseSummary) {
const result = browser.lastResult;
let message = '\n' + browser.name + ': ';
message += 'Executed ' + (result.success + result.failed) +
Expand Down

0 comments on commit 459504e

Please sign in to comment.