Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ env:
- BROWSER_STACK_USERNAME=angularteam1
- BROWSER_STACK_ACCESS_KEY=BWCd4SynLzdDcv8xtzsB
- BROWSER_PROVIDER_READY_FILE=/tmp/material-angular-io-build/readyfile
- BROWSER_PROVIDER_ERROR_FILE=/tmp/material-angular-io-build/errorfile
matrix:
- MODE=lint
- MODE=e2e
Expand Down
9 changes: 9 additions & 0 deletions scripts/browserstack/block-tunnel.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
#!/bin/bash

TUNNEL_LOG="$LOGS_DIR/browserstack-tunnel.log"

# Wait for Connect to be ready before exiting
# Time out if we wait for more than 2 minutes, so the process won't run forever.
let "counter=0"

# Exit the process if there are errors reported. Print the tunnel log to the console.
if [ -f $BROWSER_PROVIDER_ERROR_FILE ]; then
echo
echo "An error occurred while starting the tunnel. See error:"
cat $TUNNEL_LOG
exit 5
fi

while [ ! -f $BROWSER_PROVIDER_READY_FILE ]; do
let "counter++"

Expand Down
7 changes: 4 additions & 3 deletions scripts/browserstack/start-tunnel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ touch $TUNNEL_LOG

cd $TUNNEL_DIR

# Download the saucelabs connect binaries.
# Download the browserstack local binaries.
curl $TUNNEL_URL -o $TUNNEL_FILE 2> /dev/null 1> /dev/null

# Extract the saucelabs connect binaries from the tarball.
# Extract the browserstack local binaries from the tarball.
mkdir -p browserstack-tunnel
unzip -q $TUNNEL_FILE -d browserstack-tunnel

Expand All @@ -43,7 +43,7 @@ function create_ready_file {

# To be able to exit the tail properly we need to have a sub shell spawned, which is
# used to track the state of tail.
sleep 120 &
{ sleep 120; touch $BROWSER_PROVIDER_ERROR_FILE; } &

TIMER_PID=$!

Expand All @@ -56,6 +56,7 @@ function create_ready_file {
tail -n0 -f $TUNNEL_LOG --pid $TIMER_PID | { sed '/Ctrl/q' && kill -9 $TIMER_PID; };
} &> /dev/null

echo
echo "BrowserStack Tunnel ready"

touch $BROWSER_PROVIDER_READY_FILE
Expand Down