Created
April 13, 2012 18:47
-
-
Save joshuasiler/2379135 to your computer and use it in GitHub Desktop.
Jenkins shell script to run headless rails tests
This file contains 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
# loads RVM into current shell for correct ruby and gem environment | |
source /etc/profile.d/rvm.sh | |
# source the .rvmrc file in the project | |
cd . | |
# instantiates an Xvfb session on display port 99 | |
Xvfb :99 -ac & | |
# environment variable to let firefox know where to run | |
export DISPLAY=:99 | |
# run tests with a custom rake task to fire up Capybara and Selenium Web driver | |
rake test:browser | |
# Jenkins will pass or fail this script based on the final return value, so I am saving the return value for later use | |
set $STATUS = $? | |
# end Xvfb session | |
killall Xvfb | |
# let Jenkins know how the tests went | |
exit $STATUS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment