From b716828a484977bad84e21c8755f4b4e604103e4 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Fri, 11 Dec 2015 18:26:18 +0100 Subject: [PATCH] chore(travis): add a new job that runs ci-checks Previously, ddescribe, merge-conflicts, jshint, and jscs would run after unit & e2e tests ran. The order was orginally changed as part of https://github.com/angular/angular.js/pull/9792. While the logic is sound that style errors shouldn't block tests from running, ddescribe should always run. This was not guaraneteed; when Travis exits with a warning after some browsers have run, ddescribe doesn't get run and it doesn't become apparent that not all tests have run. Additionally, a separate job clearly separates style from test errors, which e.g. means you can open a PR that includes an iit to speed up the job, and see immediately if the test passes, because the ddescribe error is in another job. --- .travis.yml | 7 ++----- scripts/travis/before_build.sh | 18 ++++++++++++++++++ scripts/travis/build.sh | 5 +++-- 3 files changed, 23 insertions(+), 7 deletions(-) create mode 100755 scripts/travis/before_build.sh diff --git a/.travis.yml b/.travis.yml index 61872e42aaf5..13366393e3db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ branches: env: matrix: + - JOB=ci-checks - JOB=unit BROWSER_PROVIDER=saucelabs - JOB=docs-e2e BROWSER_PROVIDER=saucelabs - JOB=e2e TEST_TARGET=jqlite BROWSER_PROVIDER=saucelabs @@ -51,11 +52,7 @@ install: - npm install before_script: - - mkdir -p $LOGS_DIR - - ./scripts/travis/start_browser_provider.sh - - npm install -g grunt-cli - - grunt package - - ./scripts/travis/wait_for_browser_provider.sh + - ./scripts/travis/before_build.sh script: - ./scripts/travis/build.sh diff --git a/scripts/travis/before_build.sh b/scripts/travis/before_build.sh new file mode 100755 index 000000000000..de67dbbcab78 --- /dev/null +++ b/scripts/travis/before_build.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -e + +mkdir -p $LOGS_DIR + +if [ $JOB != "ci-checks" ]; then + echo "start_browser_provider" + ./scripts/travis/start_browser_provider.sh +fi + +npm install -g grunt-cli + +if [ $JOB != "ci-checks" ]; then + grunt package + echo "wait_for_browser_provider" + ./scripts/travis/wait_for_browser_provider.sh +fi diff --git a/scripts/travis/build.sh b/scripts/travis/build.sh index 9e4f4fcd180a..374b3f92de76 100755 --- a/scripts/travis/build.sh +++ b/scripts/travis/build.sh @@ -5,7 +5,9 @@ set -e export BROWSER_STACK_ACCESS_KEY=`echo $BROWSER_STACK_ACCESS_KEY | rev` export SAUCE_ACCESS_KEY=`echo $SAUCE_ACCESS_KEY | rev` -if [ $JOB = "unit" ]; then +if [ $JOB = "ci-checks" ]; then + grunt ci-checks +elif [ $JOB = "unit" ]; then if [ "$BROWSER_PROVIDER" == "browserstack" ]; then BROWSERS="BS_Chrome,BS_Safari,BS_Firefox,BS_IE_9,BS_IE_10,BS_IE_11,BS_iOS" else @@ -14,7 +16,6 @@ if [ $JOB = "unit" ]; then grunt test:promises-aplus grunt test:unit --browsers $BROWSERS --reporters dots - grunt ci-checks grunt tests:docs --browsers $BROWSERS --reporters dots elif [ $JOB = "docs-e2e" ]; then grunt test:travis-protractor --specs "docs/app/e2e/**/*.scenario.js"