diff options
author | Bryan McLellan <btm@loftninjas.org> | 2012-11-29 17:04:35 -0500 |
---|---|---|
committer | Bryan McLellan <btm@loftninjas.org> | 2012-11-29 17:06:03 -0500 |
commit | 72aee57b0360773d846c4e8e55d5c6129b70a374 (patch) | |
tree | 14ee97582beee3046ad0d71290191263f8f51073 /ci | |
parent | 0cb93634fa7f2b36e81d4d438ec19bd2a1277946 (diff) | |
download | chef-72aee57b0360773d846c4e8e55d5c6129b70a374.tar.gz |
Preserve return code from running rspec
Diffstat (limited to 'ci')
-rw-r--r-- | ci/jenkins_run_tests.bat | 6 | ||||
-rwxr-xr-x | ci/jenkins_run_tests.sh | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/ci/jenkins_run_tests.bat b/ci/jenkins_run_tests.bat index f2ac0d18dd..a1ed4858c8 100644 --- a/ci/jenkins_run_tests.bat +++ b/ci/jenkins_run_tests.bat @@ -6,4 +6,10 @@ cd chef ruby -v call bundle install --binstubs --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 place rspec output back in jenkins working directory move test.xml .. + +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 index 8139d24d8c..293ec84da5 100755 --- a/ci/jenkins_run_tests.sh +++ b/ci/jenkins_run_tests.sh @@ -10,4 +10,10 @@ ruby -v; # This should take care of Gemfile changes that result in "bad" bundles without forcing us to rebundle every time bundle install --binstubs --path vendor/bundle || ( rm Gemfile.lock && bundle install --binstubs --path vendor/bundle ) bin/rspec -r rspec_junit_formatter -f RspecJunitFormatter -o test.xml -f documentation spec; +RSPEC_RETURNCODE=$? + +# move the rspec results back into the jenkins working directory mv test.xml .. + +# exit with the result of running rspec +return $RSPEC_RETURNCODE |