Skip to content

Instantly share code, notes, and snippets.

@johndaley-me
Created January 29, 2016 19:49
Show Gist options
  • Save johndaley-me/585069466503ddb2c959 to your computer and use it in GitHub Desktop.
Save johndaley-me/585069466503ddb2c959 to your computer and use it in GitHub Desktop.
Devops script for running testem inside virtual display on Bamboo node.
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