Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🏗 On Travis, collapse the copious error logs printed after test runs #14615

Merged
merged 1 commit into from
Apr 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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