summaryrefslogtreecommitdiff
path: root/ci
diff options
context:
space:
mode:
authorsersut <serdar@opscode.com>2013-10-11 12:43:38 -0700
committersersut <serdar@opscode.com>2013-10-11 12:43:38 -0700
commit77300e48b1de3db496a1248aa1b313faa1a642f2 (patch)
tree8de8c928430c2483d3e621cf91d6a1d540270892 /ci
parente986fc3ea9d0a6f09c005e7240db60b4db2861a7 (diff)
downloadmixlib-shellout-77300e48b1de3db496a1248aa1b313faa1a642f2.tar.gz
Add scripts to run the specs on Jenkins.
Diffstat (limited to 'ci')
-rw-r--r--ci/jenkins_run_tests.bat9
-rwxr-xr-xci/jenkins_run_tests.sh13
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 0000000..4d1b1d1
--- /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 0000000..5bf7def
--- /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