File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -30,14 +30,15 @@ unzip -q ${TUNNEL_FILE} -d browserstack-tunnel
30
30
# Cleanup the download directory.
31
31
rm ${TUNNEL_FILE}
32
32
33
- ARGS=" "
33
+ if [ -z " ${TRAVIS_JOB_ID} " ]; then
34
+ echo " Error: Cannot set up a BrowserStack tunnel if there is no '\$ TRAVIS_JOB_ID' set."
35
+ exit 1
36
+ fi ;
34
37
35
- # Set tunnel-id only on Travis, to make local testing easier.
36
- if [ ! -z " ${TRAVIS_JOB_ID} " ]; then
37
- ARGS=" ${ARGS} --local-identifier ${TRAVIS_JOB_ID} "
38
- fi
38
+ ARGS=" --local-identifier ${TRAVIS_JOB_ID} "
39
39
40
- echo " Starting Browserstack Local in the background, logging into: ${TUNNEL_LOG} "
40
+ echo " Starting Browserstack Local in the background, logging into: ${TUNNEL_LOG} ." \
41
+ " Using the following tunnel identifier: ${TRAVIS_JOB_ID} "
41
42
42
43
# Extension to the BrowserStackLocal binaries, because those can't create a readyfile.
43
44
function create_ready_file {
Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ module.exports = (config) => {
99
99
100
100
if ( process . env [ 'TRAVIS' ] ) {
101
101
const buildId = `TRAVIS #${ process . env . TRAVIS_BUILD_NUMBER } (${ process . env . TRAVIS_BUILD_ID } )` ;
102
+ const tunnelIdentifier = process . env . TRAVIS_JOB_ID ;
102
103
103
104
if ( process . env [ 'TRAVIS_PULL_REQUEST' ] === 'false'
104
105
&& process . env [ 'MODE' ] === "test-travis-1" ) {
@@ -115,7 +116,8 @@ module.exports = (config) => {
115
116
116
117
if ( platform === 'browserstack' ) {
117
118
config . browserStack . build = buildId ;
118
- config . browserStack . tunnelIdentifier = process . env . TRAVIS_JOB_ID ;
119
+ config . browserStack . tunnelIdentifier = tunnelIdentifier ;
120
+ console . log ( `Setting up Browserstack launcher. Connecting to tunnel: "${ tunnelIdentifier } "` ) ;
119
121
} else if ( platform !== 'travis' ) {
120
122
throw new Error ( `Platform "${ platform } " is unknown. Exiting..` ) ;
121
123
}
You can’t perform that action at this time.
0 commit comments