Skip to content

Commit

Permalink
Preserve return code from running rspec
Browse files Browse the repository at this point in the history
  • Loading branch information
btm committed Nov 29, 2012
1 parent 0cb9363 commit 72aee57
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ci/jenkins_run_tests.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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%
6 changes: 6 additions & 0 deletions ci/jenkins_run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 72aee57

Please sign in to comment.