Skip to content

Commit 039ca60

Browse files
devversionandrewseguin
authored andcommitted
build: ensure tunnel identifiers are unique (#14108)
* Currently it can happen that our tunnel identifier conflicts with other tunnel identifiers from other Angular projects. A few PRs reported that their tunnel couldn't be re-opened because it was already used and closed successfully.
1 parent cb57c6c commit 039ca60

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

scripts/browserstack/start-tunnel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ rm ${tunnelFileName}
3131
ARGS=""
3232

3333
if [ ! -z "${CIRCLE_BUILD_NUM}" ]; then
34-
ARGS="${ARGS} --local-identifier ${CIRCLE_BUILD_NUM}-${CIRCLE_NODE_INDEX}"
34+
ARGS="${ARGS} --local-identifier angular-material-${CIRCLE_BUILD_NUM}-${CIRCLE_NODE_INDEX}"
3535
fi
3636

3737
echo "Starting Browserstack Local in the background, logging into: ${tunnelLogFile}"

scripts/saucelabs/start-tunnel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ rm ${tunnelFileName}
3131
sauceArgs="--readyfile ${tunnelReadyFile} --pidfile ${tunnelPidFile}"
3232

3333
if [ ! -z "${CIRCLE_BUILD_NUM}" ]; then
34-
sauceArgs="${sauceArgs} --tunnel-identifier ${CIRCLE_BUILD_NUM}-${CIRCLE_NODE_INDEX}"
34+
sauceArgs="${sauceArgs} --tunnel-identifier angular-material-${CIRCLE_BUILD_NUM}-${CIRCLE_NODE_INDEX}"
3535
fi
3636

3737
echo "Starting Sauce Connect in the background, logging into: ${tunnelLogFile}"

test/karma.conf.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,9 @@ module.exports = config => {
9595
if (process.env['CIRCLECI']) {
9696
const instanceIndex = Number(process.env['CIRCLE_NODE_INDEX']);
9797
const maxParallelInstances = Number(process.env['CIRCLE_NODE_TOTAL']);
98-
const tunnelIdentifier = `${process.env['CIRCLE_BUILD_NUM']}-${instanceIndex}`;
99-
const buildIdentifier = `angular-material-${tunnelIdentifier}`;
98+
const tunnelIdentifier =
99+
`angular-material-${process.env['CIRCLE_BUILD_NUM']}-${instanceIndex}`;
100+
const buildIdentifier = `circleci-${tunnelIdentifier}`;
100101
const testPlatform = process.env['TEST_PLATFORM'];
101102

102103
if (testPlatform === 'browserstack') {

0 commit comments

Comments
 (0)