Skip to content

Commit

Permalink
build(travis): gracefully shut down the sauce connect tunnel after th…
Browse files Browse the repository at this point in the history
…e tests are done running

This is to prevent sauce connect tunnel leaks.

Closes angular#12921
  • Loading branch information
IgorMinar committed Sep 23, 2015
1 parent 3850066 commit f2724b2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ script:
- ./scripts/travis/build.sh

after_script:
- ./scripts/travis/tear_down_browser_provider.sh
- ./scripts/travis/print_logs.sh

notifications:
Expand Down
8 changes: 8 additions & 0 deletions lib/browserstack/teardown_tunnel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -e -o pipefail


echo "Shutting down Browserstack tunnel"
echo "TODO: implement me"
exit 1
16 changes: 16 additions & 0 deletions lib/saucelabs/teardown_tunnel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e -o pipefail


echo "Shutting down Sauce Connect tunnel"

killall sc

while [[ -n `ps -ef | grep "bin/sc" | grep -v "grep"` ]]; do
printf "."
sleep .5
done

echo ""
echo "Sauce Connect tunnel has bee shut down"
4 changes: 4 additions & 0 deletions scripts/travis/tear_down_browser_provider.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
# Has to be run from project root directory.

./lib/${BROWSER_PROVIDER}/teardown_tunnel.sh

0 comments on commit f2724b2

Please sign in to comment.