diff options
author | sersut <serdar@opscode.com> | 2013-10-09 21:42:36 -0700 |
---|---|---|
committer | sersut <serdar@opscode.com> | 2013-10-09 22:15:54 -0700 |
commit | bde85361c9df362cb58285db786db76e9f55dc6b (patch) | |
tree | 77ab8f6f6b30812bf1fcc82e183afaeeb4598a69 | |
parent | b4979ff3ec7f28ed3e0eb31f7f999c7db744ca4e (diff) | |
download | ohai-bde85361c9df362cb58285db786db76e9f55dc6b.tar.gz |
Add scripts that can run specs on jenkins.
-rw-r--r-- | ci/jenkins_run_tests.bat | 9 | ||||
-rwxr-xr-x | ci/jenkins_run_tests.sh | 13 |
2 files changed, 22 insertions, 0 deletions
diff --git a/ci/jenkins_run_tests.bat b/ci/jenkins_run_tests.bat new file mode 100644 index 00000000..4d1b1d14 --- /dev/null +++ b/ci/jenkins_run_tests.bat @@ -0,0 +1,9 @@ +set PATH=C:\Ruby192\bin;%PATH% + +ruby -v +call bundle install --binstubs --without docgen --path vendor/bundle || ( call rm Gemfile.lock && call bundle install --binstubs --path vendor/bundle ) +ruby bin\rspec -r rspec_junit_formatter -f RspecJunitFormatter -o test.xml -f documentation spec/functional spec/unit spec/stress +set RSPEC_ERRORLVL=%ERRORLEVEL% + +REM Return the error level from rspec +exit /B %RSPEC_ERRORLVL% diff --git a/ci/jenkins_run_tests.sh b/ci/jenkins_run_tests.sh new file mode 100755 index 00000000..5bf7def0 --- /dev/null +++ b/ci/jenkins_run_tests.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +export PATH=$PATH:/usr/local/bin + +ruby -v; +# remove the Gemfile.lock and try again if bundler fails. +# This should take care of Gemfile changes that result in "bad" bundles without forcing us to rebundle every time +bundle install --without docgen --path vendor/bundle || ( rm Gemfile.lock && bundle install --path vendor/bundle ) +bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o test.xml -f documentation spec; +RSPEC_RETURNCODE=$? + +# exit with the result of running rspec +exit $RSPEC_RETURNCODE |