summaryrefslogtreecommitdiff
path: root/ci/verify-chef.bat
diff options
context:
space:
mode:
authorSeth Chisamore <schisamo@chef.io>2016-01-08 18:28:18 -0800
committerKartik Null Cating-Subramanian <ksubramanian@chef.io>2016-01-11 16:10:38 -0500
commit602c9fb3d94b76057c58e2a73174789d39495661 (patch)
tree913af53a8ad79ab1ff6dd47e2920a1d8f118c5dd /ci/verify-chef.bat
parent61bd67e56e7917306eedfe13ef8dc7532671c785 (diff)
downloadchef-602c9fb3d94b76057c58e2a73174789d39495661.tar.gz
Move Jenkins verification scripts to top-level
Diffstat (limited to 'ci/verify-chef.bat')
-rwxr-xr-xci/verify-chef.bat56
1 files changed, 56 insertions, 0 deletions
diff --git a/ci/verify-chef.bat b/ci/verify-chef.bat
new file mode 100755
index 0000000000..1c159f0668
--- /dev/null
+++ b/ci/verify-chef.bat
@@ -0,0 +1,56 @@
+
+@ECHO OFF
+
+REM ; %PROJECT_NAME% is set by Jenkins, this allows us to use the same script to verify
+REM ; Chef and Angry Chef
+cd C:\opscode\%PROJECT_NAME%\bin
+
+REM ; We don't want to add the embedded bin dir to the main PATH as this
+REM ; could mask issues in our binstub shebangs.
+SET EMBEDDED_BIN_DIR=C:\opscode\%PROJECT_NAME%\embedded\bin
+
+ECHO.
+
+FOR %%b IN (
+ chef-client
+ knife
+ chef-solo
+ ohai
+) DO (
+
+
+ ECHO Checking for existence of binfile `%%b`...
+
+ IF EXIST %%b (
+ ECHO ...FOUND IT!
+ ) ELSE (
+ GOTO :error
+ )
+ ECHO.
+)
+
+call chef-client --version
+
+REM ; Exercise various packaged tools to validate binstub shebangs
+call %EMBEDDED_BIN_DIR%\ruby --version
+call %EMBEDDED_BIN_DIR%\gem --version
+call %EMBEDDED_BIN_DIR%\bundle --version
+call %EMBEDDED_BIN_DIR%\rspec --version
+
+SET PATH=C:\opscode\%PROJECT_NAME%\bin;C:\opscode\%PROJECT_NAME%\embedded\bin;%PATH%
+
+REM ; Test against the vendored chef gem
+cd C:\opscode\%PROJECT_NAME%\embedded\lib\ruby\gems\2*\gems\chef-*-mingw32
+
+IF NOT EXIST "Gemfile.lock" (
+ ECHO "Chef gem does not contain a Gemfile.lock! This is needed to run any tests."
+ GOTO :error
+)
+
+IF "%PIPELINE_NAME%" == "chef-13" (
+ REM ; Running unit and functional tests
+ call bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o %WORKSPACE%\test.xml -f documentation spec/unit spec/functional
+) ELSE (
+ REM ; Running unit tests
+ call bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o %WORKSPACE%\test.xml -f documentation spec/unit spec/functional
+)