Skip to content

Commit 869c390

Browse files
committed
disable saucelab test if travis enviorment vars are not available
1 parent 2ebfa63 commit 869c390

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

buildtools/run_tests.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,14 @@ trap killServer EXIT
7171
# If --saucelabs option is passed, forward it to the protractor command adding
7272
# the second argument that is required for local SauceLabs test run.
7373
if [[ $1 = "--saucelabs" ]]; then
74-
seleniumStarted=false
75-
sleep 2
76-
echo "Using SauceLabs."
77-
# $2 contains the tunnelIdentifier argument if specified, otherwise is empty.
78-
$PROTRACTOR_BIN_PATH/protractor protractor.conf.js --saucelabs $2
74+
# Enable saucelabs tests only when running locally or when Travis enviroment vars are accessible.
75+
if [[ ( "$TRAVIS" = true && "$TRAVIS_SECURE_ENV_VARS" = true ) || ( -z "$TRAVIS" ) ]]; then
76+
seleniumStarted=false
77+
sleep 2
78+
echo "Using SauceLabs."
79+
# $2 contains the tunnelIdentifier argument if specified, otherwise is empty.
80+
$PROTRACTOR_BIN_PATH/protractor protractor.conf.js --saucelabs $2
81+
fi
7982
else
8083
echo "Using Headless Chrome."
8184
# Updates Selenium Webdriver.

0 commit comments

Comments
 (0)