summaryrefslogtreecommitdiff
path: root/ci
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2016-04-17 09:34:29 -0700
committerJohn Keiser <john@johnkeiser.com>2016-04-18 14:21:02 -0700
commit01cf3ef2a85d3190b0bd46835ff6ae37f830764a (patch)
treeb15fc1934d56c4449101b10d074b72e26a4884e3 /ci
parent31f9ada8660a2831204aca436e343b6a10b103cd (diff)
downloadchef-01cf3ef2a85d3190b0bd46835ff6ae37f830764a.tar.gz
Remove Gemfile.windows and put both platforms in Gemfile.lock
Diffstat (limited to 'ci')
-rwxr-xr-xci/verify-chef.bat8
-rwxr-xr-xci/verify-chef.sh26
2 files changed, 26 insertions, 8 deletions
diff --git a/ci/verify-chef.bat b/ci/verify-chef.bat
index 1f8be56ef1..a063cd417e 100755
--- a/ci/verify-chef.bat
+++ b/ci/verify-chef.bat
@@ -46,8 +46,8 @@ 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
+REM ; Test against the vendored chef gem (cd into the output of "bundle show chef")
+for /f "delims=" %%a in ('bundle show chef') do cd %%a
IF NOT EXIST "Gemfile.lock" (
ECHO "Chef gem does not contain a Gemfile.lock! This is needed to run any tests."
@@ -61,4 +61,8 @@ IF "%PIPELINE_NAME%" == "chef-fips" (
REM ; ffi-yajl must run in c-extension mode for perf, so force it so we don't accidentally fall back to ffi
set FORCE_FFI_YAJL=ext
+set BUNDLE_IGNORE_CONFIG=true
+set BUNDLE_FROZEN=1
+set BUNDLE_WITHOUT=docgen:maintenance:omnibus_package:integration:aix:bsd:linux:mac_os_x:solaris
+call bundle install
call bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o %WORKSPACE%\test.xml -f documentation spec/functional
diff --git a/ci/verify-chef.sh b/ci/verify-chef.sh
index d6486f3b35..61dc3ba699 100755
--- a/ci/verify-chef.sh
+++ b/ci/verify-chef.sh
@@ -1,5 +1,7 @@
#!/bin/sh
+set -evx
+
# Set up a custom tmpdir, and clean it up before and after the tests
TMPDIR="${TMPDIR:-/tmp}/cheftest"
export TMPDIR
@@ -84,22 +86,31 @@ export FORCE_FFI_YAJL
# ACCEPTANCE environment variable will be set on acceptance testers.
# If is it set; we run the acceptance tests, otherwise run rspec tests.
if [ "x$ACCEPTANCE" != "x" ]; then
+ # Find the Chef gem and cd there.
+ OLD_PATH=$PATH
+ PATH=/opt/$PROJECT_NAME/bin:/opt/$PROJECT_NAME/embedded/bin:$PATH
+ cd /opt/$PROJECT_NAME
+ CHEF_GEM=`bundle show chef`
+ PATH=$OLD_PATH
+ cd $CHEF_GEM
+
# On acceptance testers we have Chef DK. We will use its Ruby environment
# to cut down the gem installation time.
PATH=/opt/chefdk/bin:/opt/chefdk/embedded/bin:$PATH
export PATH
- # Test against the vendored Chef gem
- cd /opt/$PROJECT_NAME/embedded/lib/ruby/gems/*/gems/chef-[0-9]*/acceptance
+ # Test against the Chef bundle
+ sudo env PATH=$PATH AWS_SSH_KEY_ID=$AWS_SSH_KEY_ID ARTIFACTORY_USERNAME=$ARTIFACTORY_USERNAME ARTIFACTORY_PASSWORD=$ARTIFACTORY_PASSWORD gem install bundler
sudo env PATH=$PATH AWS_SSH_KEY_ID=$AWS_SSH_KEY_ID ARTIFACTORY_USERNAME=$ARTIFACTORY_USERNAME ARTIFACTORY_PASSWORD=$ARTIFACTORY_PASSWORD bundle install
sudo env PATH=$PATH AWS_SSH_KEY_ID=$AWS_SSH_KEY_ID ARTIFACTORY_USERNAME=$ARTIFACTORY_USERNAME ARTIFACTORY_PASSWORD=$ARTIFACTORY_PASSWORD KITCHEN_DRIVER=ec2 bundle exec chef-acceptance test --force-destroy
else
PATH=/opt/$PROJECT_NAME/bin:/opt/$PROJECT_NAME/embedded/bin:$PATH
export PATH
- # Test against the vendored Chef gem
- cd /opt/$PROJECT_NAME/embedded/lib/ruby/gems/*/gems/chef-[0-9]*
-
+ # Test against the installed Chef gem
+ cd /opt/$PROJECT_NAME
+ CHEF_GEM=`bundle show chef`
+ cd $CHEF_GEM
if [ ! -f "Gemfile.lock" ]; then
echo "Chef gem does not contain a Gemfile.lock! This is needed to run any tests."
exit 1
@@ -111,5 +122,8 @@ else
CHEF_FIPS=1
export CHEF_FIPS
fi
- sudo env PATH=$PATH TERM=xterm CHEF_FIPS=$CHEF_FIPS bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o $WORKSPACE/test.xml -f documentation spec/functional
+
+ # TODO Fix Solaris and AIX so we don't have to do GIT_SSL_NO_VERIFY=true
+ sudo env BUNDLE_IGNORE_CONFIG=true BUNDLE_FROZEN=1 BUNDLE_WITHOUT=docgen:maintenance:omnibus_package:integration GIT_SSL_NO_VERIFY=true PATH=$PATH TERM=xterm CHEF_FIPS=$CHEF_FIPS bundle install
+ sudo env BUNDLE_IGNORE_CONFIG=true BUNDLE_FROZEN=1 BUNDLE_WITHOUT=docgen:maintenance:omnibus_package:integration GIT_SSL_NO_VERIFY=true PATH=$PATH TERM=xterm CHEF_FIPS=$CHEF_FIPS bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o $WORKSPACE/test.xml -f documentation spec/functional
fi