forked from openpgpjs/openpgpjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis.sh
executable file
·40 lines (29 loc) · 1.06 KB
/
travis.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
set -e
if [ $OPENPGPJSTEST = "coverage" ]; then
echo "Running OpenPGP.js unit tests on node.js with code coverage."
grunt coverage
codeclimate-test-reporter < coverage/lcov.info
elif [ $OPENPGPJSTEST = "unit" ]; then
echo "Running OpenPGP.js unit tests on node.js."
npm test
elif [ $OPENPGPJSTEST = "saucelabs" ]; then
echo "Running OpenPGP.js browser unit tests on Saucelabs."
export SELENIUM_BROWSER_CAPABILITIES="{\"browserName\":\"$BROWSER\", \"version\":\"$VERSION\", \"platform\":\"$PLATFORM\", \"extendedDebugging\":true}"
echo "SELENIUM_BROWSER_CAPABILITIES='$SELENIUM_BROWSER_CAPABILITIES'"
grunt saucelabs --compat=$COMPAT &
background_process_pid=$!
# https://github.com/travis-ci/travis-ci/issues/4190
minutes=0
limit=30
while kill -0 $background_process_pid >/dev/null 2>&1; do
echo -n -e " \b" # never leave evidences!
if [ $minutes == $limit ]; then
exit 1
fi
minutes=$((minutes+1))
sleep 60
done
wait $background_process_pid
exit $? # were comes the status of the background_process :)
fi