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
3030# Cleanup the download directory.
3131rm ${TUNNEL_FILE}
3232
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 ;
3437
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} "
3939
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} "
4142
4243# Extension to the BrowserStackLocal binaries, because those can't create a readyfile.
4344function create_ready_file {
Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ module.exports = (config) => {
9999
100100 if ( process . env [ 'TRAVIS' ] ) {
101101 const buildId = `TRAVIS #${ process . env . TRAVIS_BUILD_NUMBER } (${ process . env . TRAVIS_BUILD_ID } )` ;
102+ const tunnelIdentifier = process . env . TRAVIS_JOB_ID ;
102103
103104 if ( process . env [ 'TRAVIS_PULL_REQUEST' ] === 'false'
104105 && process . env [ 'MODE' ] === "test-travis-1" ) {
@@ -115,7 +116,8 @@ module.exports = (config) => {
115116
116117 if ( platform === 'browserstack' ) {
117118 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 } "` ) ;
119121 } else if ( platform !== 'travis' ) {
120122 throw new Error ( `Platform "${ platform } " is unknown. Exiting..` ) ;
121123 }
You can’t perform that action at this time.
0 commit comments