Skip to content

Commit b8be72a

Browse files
committed
fix: coverage issue with saucelabs
* 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 ce0e933 commit b8be72a

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
@@ -100,7 +100,9 @@ module.exports = (config) => {
100100
if (process.env['TRAVIS']) {
101101
let buildId = `TRAVIS #${process.env.TRAVIS_BUILD_NUMBER} (${process.env.TRAVIS_BUILD_ID})`;
102102

103-
if (process.env['TRAVIS_PULL_REQUEST'] === 'false') {
103+
if (process.env['TRAVIS_PULL_REQUEST'] === 'false' &&
104+
process.env['MODE'] === "browserstack_required") {
105+
104106
config.preprocessors['dist/@angular/material/**/!(*+(.|-)spec).js'] = ['coverage'];
105107
config.reporters.push('coverage');
106108
}

0 commit comments

Comments
 (0)