summaryrefslogtreecommitdiff
path: root/ci/verify-chef.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ci/verify-chef.sh')
-rwxr-xr-xci/verify-chef.sh26
1 files changed, 10 insertions, 16 deletions
diff --git a/ci/verify-chef.sh b/ci/verify-chef.sh
index 71d4afe0df..0c90d65dbe 100755
--- a/ci/verify-chef.sh
+++ b/ci/verify-chef.sh
@@ -64,7 +64,8 @@ for ruby_env_var in _ORIGINAL_GEM_PATH \
RUBYOPT \
RUBY_ENGINE \
RUBY_ROOT \
- RUBY_VERSION
+ RUBY_VERSION \
+ BUNDLER_VERSION
do
unset $ruby_env_var
@@ -83,14 +84,17 @@ $EMBEDDED_BIN_DIR/rspec --version
FORCE_FFI_YAJL=ext
export FORCE_FFI_YAJL
+OLD_PATH=$PATH
+PATH=/opt/$PROJECT_NAME/bin:/opt/$PROJECT_NAME/embedded/bin:$PATH
+
+gem_list=`gem which chef`
+lib_dir=`dirname $gem_list`
+CHEF_GEM=`dirname $lib_dir`
+
# 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
# On acceptance testers we have Chef DK. We will use its Ruby environment
@@ -109,17 +113,7 @@ if [ "x$ACCEPTANCE" != "x" ]; then
env PATH=$PATH AWS_SSH_KEY_ID=$AWS_SSH_KEY_ID bundle install --deployment
env PATH=$PATH AWS_SSH_KEY_ID=$AWS_SSH_KEY_ID KITCHEN_DRIVER=ec2 KITCHEN_CHEF_CHANNEL=unstable bundle exec chef-acceptance test --force-destroy --data-path $WORKSPACE/chef-acceptance-data
else
- PATH=/opt/$PROJECT_NAME/bin:/opt/$PROJECT_NAME/embedded/bin:$PATH
- export PATH
-
- # 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
- fi
- sudo env BUNDLE_GEMFILE=/opt/$PROJECT_NAME/Gemfile BUNDLE_IGNORE_CONFIG=true BUNDLE_FROZEN=1 PATH=$PATH TERM=xterm bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o $WORKSPACE/test.xml -f documentation spec/functional
+ sudo bundle exec rspec -r rspec_junit_formatter -f RspecJunitFormatter -o $WORKSPACE/test.xml -f documentation spec/functional
fi