Created
January 29, 2016 19:49
-
-
Save johndaley-me/585069466503ddb2c959 to your computer and use it in GitHub Desktop.
Devops script for running testem inside virtual display on Bamboo node.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'Running tests in Xvfb virtual display for Firefox' | |
xvfb-run testem ci --reporter=xunit --launch=firefox | |
# ensure that non-zero is returned for any failures | |
# because xvfb-run may return 0 even in case of a test failure | |
if [ -r test-reports/testem.xml ]; then | |
# check results for failures | |
failures=$(grep --count '<failure' ./test-reports/testem.xml) | |
if [ $failures -eq 0 ]; then | |
echo 'Tests ran successfully' | |
else | |
echo 'Tests failed. Test results are available.' | |
exit 1 | |
fi | |
else | |
echo 'Tests failed. No test results are available.' | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment