diff --git a/.travis.yml b/.travis.yml index 2f3ef748e4..f04e1adc01 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,7 +48,7 @@ script: - ./travis_build.sh after_success: - - grunt release + - test $TRAVIS_PULL_REQUEST == "false" && test $TRAVIS_BRANCH == "master" && grunt release after_failure: - ./travis_print_logs.sh diff --git a/lib/sauce/sauce_connect_block.sh b/lib/sauce/sauce_connect_block.sh index 4146d9efd1..aeb8b48488 100644 --- a/lib/sauce/sauce_connect_block.sh +++ b/lib/sauce/sauce_connect_block.sh @@ -1,7 +1,9 @@ #!/bin/bash - -# Wait for Connect to be ready before exiting -while [ ! -f $SAUCE_CONNECT_READY_FILE ]; do - sleep .5 -done \ No newline at end of file +if [ ! $TRAVIS_PULL_REQUEST ] +then + # Wait for Connect to be ready before exiting + while [ ! -f $SAUCE_CONNECT_READY_FILE ]; do + sleep .5 + done +fi \ No newline at end of file diff --git a/lib/sauce/sauce_connect_setup.sh b/lib/sauce/sauce_connect_setup.sh index 456f81fbc3..6d191531f7 100644 --- a/lib/sauce/sauce_connect_setup.sh +++ b/lib/sauce/sauce_connect_setup.sh @@ -12,6 +12,12 @@ set -e # before_script: # - curl https://gist.github.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash +# Skip this if we're un a pull request, we won't be able to connect +if [ $TRAVIS_PULL_REQUEST ] +then + exit 0 +fi + CONNECT_URL="http://saucelabs.com/downloads/Sauce-Connect-latest.zip" CONNECT_DIR="/tmp/sauce-connect-$RANDOM" CONNECT_DOWNLOAD="Sauce_Connect.zip" diff --git a/travis_build.sh b/travis_build.sh index 7f8fb5422f..ad72798b31 100644 --- a/travis_build.sh +++ b/travis_build.sh @@ -17,8 +17,19 @@ set -e grunt # grunt test:e2e:ci --verbose -grunt test:ci -# Send coverage data to coveralls.io -grunt coverage -cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js || true \ No newline at end of file +# If this is a pull request then we won't have access to secure variables and can't do integration tests with SauceLabs. +# In this case just do normal local tests +if [ $TRAVIS_PULL_REQUEST ] +then + grunt test +else + grunt test:ci + + # Send coverage data to coveralls.io + if [ $TRAVIS_BRANCH == "master" ] + then + grunt coverage + cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js || true\ + fi +fi \ No newline at end of file