From 04ab03664db817f879bcb2c674d9268bf2d38cfa Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Thu, 12 Dec 2019 10:39:10 +0100 Subject: [PATCH] ci: ensure saucelabs test output is human readable (#34277) Currently the Saucelabs test output (also an issue in the POC bazel saucelabs master-only cronjob), is very verbose because two Karma reporters conflict. Basically resulting in the progress messages being printed in new lines (while they usually are just updated using a tty cursor reset). PR Close #34277 --- karma-js.conf.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/karma-js.conf.js b/karma-js.conf.js index fb827d1037..17142c5d21 100644 --- a/karma-js.conf.js +++ b/karma-js.conf.js @@ -116,8 +116,6 @@ module.exports = function(config) { '/base/npm/': '/base/', }, - reporters: ['dots'], - sauceLabs: { testName: 'Angular2', retryLimit: 3, @@ -145,11 +143,19 @@ module.exports = function(config) { browserDisconnectTimeout: 180000, browserDisconnectTolerance: 3, browserNoActivityTimeout: 300000, - } + }; + + // Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1431. The idea is + // that we do no not allow `@bazel/karma` to add the `progress` reporter. + Object.defineProperty(conf, 'reporters', { + enumerable: true, + get: () => ['dots'], + set: () => {}, + }); // When running under Bazel with karma_web_test, SAUCE_TUNNEL_IDENTIFIER and KARMA_WEB_TEST_MODE - // will only be available when `--config=saucelabs` is set. See //:test_web_all target - // and /.bazelrc. + // will only be available if they are part of the Bazel action environment. More details in the + // "scripts/saucelabs/run-bazel-via-tunnel.sh" script. if (process.env['SAUCE_TUNNEL_IDENTIFIER']) { console.log(`SAUCE_TUNNEL_IDENTIFIER: ${process.env.SAUCE_TUNNEL_IDENTIFIER}`);