Skip to content

Commit 741e7d4

Browse files
devversionkara
authored andcommitted
chore: update version of sauce connect (#2553)
1 parent 30c3bac commit 741e7d4

File tree

4 files changed

+31
-46
lines changed

4 files changed

+31
-46
lines changed

scripts/browserstack/start-tunnel.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ rm $TUNNEL_FILE
3333
ARGS=""
3434

3535
# Set tunnel-id only on Travis, to make local testing easier.
36-
if [ ! -z "$TRAVIS_JOB_NUMBER" ]; then
37-
ARGS="$ARGS --local-identifier $TRAVIS_JOB_NUMBER"
36+
if [ ! -z "$TRAVIS_JOB_ID" ]; then
37+
ARGS="$ARGS --local-identifier $TRAVIS_JOB_ID"
3838
fi
3939

4040
echo "Starting Browserstack Local in the background, logging into:"

scripts/saucelabs/start-tunnel.sh

Lines changed: 25 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,43 @@
22

33
set -e -o pipefail
44

5-
# Setup and start Sauce Connect for your TravisCI build
6-
# This script requires your .travis.yml to include the following two private env variables:
7-
# SAUCE_USERNAME
8-
# SAUCE_ACCESS_KEY
9-
# Follow the steps at https://saucelabs.com/opensource/travis to set that up.
10-
#
11-
# Curl and run this script as part of your .travis.yml before_script section:
12-
# before_script:
13-
# - curl https://gist.github.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash
14-
15-
CONNECT_DIR="/tmp/sauce-connect-$RANDOM"
16-
CONNECT_DOWNLOAD="sc-latest-linux.tar.gz"
17-
18-
CONNECT_LOG="$LOGS_DIR/sauce-connect"
19-
CONNECT_STDOUT="$LOGS_DIR/sauce-connect.stdout"
20-
CONNECT_STDERR="$LOGS_DIR/sauce-connect.stderr"
21-
22-
# Get the appropriate URL for downloading Sauce Connect
23-
if [ `uname -s` = "Darwin" ]; then
24-
# If the user is running Mac, download the OSX version
25-
# https://en.wikipedia.org/wiki/Darwin_(operating_system)
26-
CONNECT_URL="https://saucelabs.com/downloads/sc-4.4.2-osx.zip"
27-
else
28-
# Otherwise, default to Linux for Travis-CI
29-
CONNECT_URL="https://saucelabs.com/downloads/sc-4.4.2-linux.tar.gz"
30-
fi
31-
mkdir -p $CONNECT_DIR
32-
cd $CONNECT_DIR
33-
curl $CONNECT_URL -o $CONNECT_DOWNLOAD 2> /dev/null 1> /dev/null
34-
mkdir sauce-connect
35-
tar --extract --file=$CONNECT_DOWNLOAD --strip-components=1 --directory=sauce-connect > /dev/null
36-
rm $CONNECT_DOWNLOAD
5+
TUNNEL_FILE="sc-4.4.2-linux.tar.gz"
6+
TUNNEL_URL="https://saucelabs.com/downloads/$TUNNEL_FILE"
7+
TUNNEL_DIR="/tmp/saucelabs-connect"
378

9+
TUNNEL_LOG="$LOGS_DIR/sauce-connect"
3810

3911
SAUCE_ACCESS_KEY=`echo $SAUCE_ACCESS_KEY | rev`
4012

13+
# Cleanup and create the folder structure for the tunnel connector.
14+
rm -rf $TUNNEL_DIR $BROWSER_PROVIDER_READY_FILE
15+
mkdir -p $TUNNEL_DIR
16+
17+
cd $TUNNEL_DIR
18+
19+
# Download the saucelabs connect binaries.
20+
curl $TUNNEL_URL -o $TUNNEL_FILE 2> /dev/null 1> /dev/null
21+
22+
# Extract the saucelabs connect binaries from the tarball.
23+
mkdir -p sauce-connect
24+
tar --extract --file=$TUNNEL_FILE --strip-components=1 --directory=sauce-connect > /dev/null
25+
26+
# Cleanup the download directory.
27+
rm $TUNNEL_FILE
28+
4129
ARGS=""
4230

4331
# Set tunnel-id only on Travis, to make local testing easier.
44-
if [ ! -z "$TRAVIS_JOB_NUMBER" ]; then
45-
ARGS="$ARGS --tunnel-identifier $TRAVIS_JOB_NUMBER"
32+
if [ ! -z "$TRAVIS_JOB_ID" ]; then
33+
ARGS="$ARGS --tunnel-identifier $TRAVIS_JOB_ID"
4634
fi
4735
if [ ! -z "$BROWSER_PROVIDER_READY_FILE" ]; then
4836
ARGS="$ARGS --readyfile $BROWSER_PROVIDER_READY_FILE"
4937
fi
5038

51-
5239
echo "Starting Sauce Connect in the background, logging into:"
53-
echo " $CONNECT_LOG"
54-
echo " $CONNECT_STDOUT"
55-
echo " $CONNECT_STDERR"
40+
echo " $TUNNEL_LOG"
5641
echo " ---"
5742
echo " $ARGS"
58-
sauce-connect/bin/sc -u $SAUCE_USERNAME -k $SAUCE_ACCESS_KEY $ARGS \
59-
--logfile $CONNECT_LOG 2> $CONNECT_STDERR 1> $CONNECT_STDOUT &
43+
44+
sauce-connect/bin/sc -u $SAUCE_USERNAME -k $SAUCE_ACCESS_KEY $ARGS --logfile $TUNNEL_LOG &

test/karma.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ export function config(config) {
105105

106106
if (platform === 'saucelabs') {
107107
config.sauceLabs.build = buildId;
108-
config.sauceLabs.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;
108+
config.sauceLabs.tunnelIdentifier = process.env.TRAVIS_JOB_ID;
109109
} else if (platform === 'browserstack') {
110110
config.browserStack.build = buildId;
111-
config.browserStack.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;
111+
config.browserStack.tunnelIdentifier = process.env.TRAVIS_JOB_ID;
112112
} else {
113113
throw new Error(`Platform "${platform}" unknown, but Travis specified. Exiting.`);
114114
}

test/protractor.conf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ if (process.env['TRAVIS']) {
4141
config.sauceKey = key;
4242
config.capabilities = {
4343
'browserName': 'chrome',
44-
'tunnel-identifier': process.env['TRAVIS_JOB_NUMBER'],
45-
'build': process.env['TRAVIS_JOB_NUMBER'],
44+
'tunnel-identifier': process.env['TRAVIS_JOB_ID'],
45+
'build': process.env['TRAVIS_JOB_ID'],
4646
'name': 'Material 2 E2E Tests',
4747

4848
// Enables concurrent testing in the Webdriver. Currently runs five e2e files in parallel.

0 commit comments

Comments
 (0)