mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
21594d33e8
We currently wait for browser tunnels of Saucelabs and Browserstack to terminate by repeatedly checking with `ps -p`. This is not reliable and can break if the host system is not removing forcibly killed child processes from the process table. This is valid since the tunnels are launched as child processes and we ideally wait for those to terminate using the `wait` command.
33 lines
927 B
Bash
Executable File
33 lines
927 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# In case any command failed, we want to immediately exit the script with the
|
|
# proper exit code.
|
|
set -e
|
|
|
|
# Path to the project directory.
|
|
projectDir="$(dirname ${0})/../.."
|
|
|
|
# Go to project directory.
|
|
cd ${projectDir}
|
|
|
|
# Decode access token and make it accessible for child processes.
|
|
export BROWSER_STACK_ACCESS_KEY=`echo ${BROWSER_STACK_ACCESS_KEY} | rev`
|
|
|
|
# Start tunnel and wait for it being ready.
|
|
./scripts/browserstack/start-tunnel.sh &
|
|
./scripts/browserstack/wait-tunnel.sh
|
|
|
|
# Setup the test platform environment variable that will be read
|
|
# by the Karma configuration script.
|
|
export TEST_PLATFORM="browserstack"
|
|
|
|
# Run the unit tests on Browserstack with Karma.
|
|
yarn gulp ci:test
|
|
|
|
# Kill the Browserstack tunnel. This is necessary in order to avoid rate-limit
|
|
# errors that cause the unit tests to be flaky.
|
|
./scripts/browserstack/stop-tunnel.sh
|
|
|
|
# Wait for all sub processes to terminate properly.
|
|
wait
|