From 459504e2179426621a2188441ffd0f54e094856a Mon Sep 17 00:00:00 2001 From: Raghu Simha Date: Fri, 13 Apr 2018 17:27:39 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=97=20On=20Travis,=20collapse=20the=20?= =?UTF-8?q?copious=20error=20logs=20printed=20after=20test=20runs=20(#1461?= =?UTF-8?q?5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build-system/tasks/runtime-test.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/build-system/tasks/runtime-test.js b/build-system/tasks/runtime-test.js index c9982b7e334ff..8e6d22ee8d22a 100644 --- a/build-system/tasks/runtime-test.js +++ b/build-system/tasks/runtime-test.js @@ -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( @@ -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) +