Skip to content

Commit 4d4a63e

Browse files
devversiontinayuangao
authored andcommitted
fix: coverage issue with saucelabs (#3540)
* Saucelabs seems to have issues with Edge and the `karma-coverage` plugin. * Running on Browserstack seems to be work without any flakiness and also makes the build faster (runs less browsers than on saucelabs)
1 parent 675c9df commit 4d4a63e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

scripts/ci/build-and-test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ else
2525
$(npm bin)/gulp ci:test
2626
fi
2727

28-
# Don't upload coverage for both test modes (browserstack and saucelabs) and inside of PRs.
29-
if [[ "$MODE" == "saucelabs_required" ]] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
28+
# Upload coverage results if those are present.
29+
if [ -f dist/coverage/coverage-summary.json ]; then
3030
$(npm bin)/gulp ci:coverage
3131
fi
3232

test/karma.conf.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ module.exports = (config) => {
106106
if (process.env['TRAVIS']) {
107107
let buildId = `TRAVIS #${process.env.TRAVIS_BUILD_NUMBER} (${process.env.TRAVIS_BUILD_ID})`;
108108

109-
if (process.env['TRAVIS_PULL_REQUEST'] === 'false') {
109+
if (process.env['TRAVIS_PULL_REQUEST'] === 'false' &&
110+
process.env['MODE'] === "browserstack_required") {
111+
110112
config.preprocessors['dist/@angular/material/**/!(*+(.|-)spec).js'] = ['coverage'];
111113
config.reporters.push('coverage');
112114
}

0 commit comments

Comments
 (0)