From 6fed865586907db916945aa24f52910152baceae Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Thu, 9 Mar 2017 21:37:33 +0100 Subject: [PATCH] fix: coverage issue with saucelabs --- scripts/ci/build-and-test.sh | 2 +- test/karma.conf.js | 2 +- tools/gulp/tasks/coverage.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ci/build-and-test.sh b/scripts/ci/build-and-test.sh index 820bb1fe560f..56ff03ff5cb6 100755 --- a/scripts/ci/build-and-test.sh +++ b/scripts/ci/build-and-test.sh @@ -26,7 +26,7 @@ else fi # Don't upload coverage for both test modes (browserstack and saucelabs) and inside of PRs. -if [[ "$MODE" == "saucelabs_required" ]] && [ "$TRAVIS_PULL_REQUEST" = "false" ]; then +if [[ "$MODE" == "browserstack_required" ]] && [ "$TRAVIS_PULL_REQUEST" != "false" ]; then $(npm bin)/gulp ci:coverage fi diff --git a/test/karma.conf.js b/test/karma.conf.js index 49c1f7038ac0..30298060f2b8 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -100,7 +100,7 @@ module.exports = (config) => { if (process.env['TRAVIS']) { let buildId = `TRAVIS #${process.env.TRAVIS_BUILD_NUMBER} (${process.env.TRAVIS_BUILD_ID})`; - if (process.env['TRAVIS_PULL_REQUEST'] === 'false') { + if (process.env['TRAVIS_PULL_REQUEST'] !== 'false') { config.preprocessors['dist/@angular/material/**/!(*+(.|-)spec).js'] = ['coverage']; config.reporters.push('coverage'); } diff --git a/tools/gulp/tasks/coverage.ts b/tools/gulp/tasks/coverage.ts index ea12470bf172..494b01c9714a 100644 --- a/tools/gulp/tasks/coverage.ts +++ b/tools/gulp/tasks/coverage.ts @@ -9,7 +9,7 @@ task('coverage:upload', () => { throw new Error('No coverage file has been found!'); } - if (!isTravisPushBuild()) { + if (isTravisPushBuild()) { throw new Error('Coverage results will be only uploaded inside of Travis Push builds.'); }