Files
angular__angular/scripts/browserstack/wait-tunnel.sh
T
Paul Gschwendtner a681438eef build: suppress logging of sauce-connect (#4856)
* Suppresses normal log messages from Saucelabs Conect. Error messages will still show up (In a follow-up PR the normal stdout will be printed together with the stdout on CI failures)
* No longer suppresses the whole Browserstack Tunnel execution. Stderr output will be printed if present. (In a follow-up stdout will be printed as well on CI failures)
* Switches to best-practice variable referencing in Bash
2017-05-30 09:27:06 -07:00

32 lines
702 B
Bash
Executable File

#!/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++"
if [ $counter -gt 240 ]; then
echo
echo "Timed out after 2 minutes waiting for tunnel ready file"
exit 5
fi
printf "."
sleep .5
done
echo ""
echo "Connected to Browserstack"