Skip to content

Commit

Permalink
Merge pull request #1173 from chef/cache_gems
Browse files Browse the repository at this point in the history
Cache gems in testing using Expeditor gem caching
  • Loading branch information
tas50 authored May 12, 2020
2 parents 96a344b + 762402c commit eeda8a4
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 17 deletions.
16 changes: 16 additions & 0 deletions .expeditor/run_linux_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
#
# This script runs a passed in command, but first setups up the bundler caching on the repo

set -ue

export USER="root"
export LANG=C.UTF-8 LANGUAGE=C.UTF-8

echo "--- bundle install"

bundle config --local path vendor/bundle
bundle install --jobs=7 --retry=3

echo "+++ bundle exec task"
bundle exec $@
12 changes: 6 additions & 6 deletions .expeditor/verify.pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
expeditor:
cached_folders:
- vendor
steps:
- label: chefstyle-tests-ruby-2.7
command:
- export USER="root"
- bundle install --jobs=7 --retry=3
- bundle exec rake style
- .expeditor/run_linux_tests.sh rake style
expeditor:
executor:
docker:
image: ruby:2.7-buster
# This tests that our verify.rb script (and dependencies) can successfully test components included in CW
- label: component-test-tests-ruby-2.7
command:
- export USER="root"
- bundle install --jobs=7 --retry=3
- bundle exec rspec omnibus/verification
- .expeditor/run_linux_tests.sh rspec omnibus/verification
expeditor:
executor:
docker:
Expand Down
8 changes: 1 addition & 7 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,4 @@ group :development do
# enable tests for the verification behavior in omnibus/verification
gem "chef-cli"
gem "rspec"
end

instance_eval(ENV["GEMFILE_MOD"]) if ENV["GEMFILE_MOD"]

# If you want to load debugging tools into the bundle exec sandbox,
# add these additional dependencies into Gemfile.local
eval_gemfile(__FILE__ + ".local") if File.exist?(__FILE__ + ".local")
end
8 changes: 4 additions & 4 deletions omnibus/verification/verify.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@ def components

add_component "chef-apply" do |c|
c.gem_base_dir = "chef-apply"
# c.unit_test do
# bundle_install_mutex.synchronize { sh("#{embedded_bin("bundle")} install") }
# sh("#{embedded_bin("bundle")} exec rspec")
# end
# c.unit_test do
# bundle_install_mutex.synchronize { sh("#{embedded_bin("bundle")} install") }
# sh("#{embedded_bin("bundle")} exec rspec")
# end
c.smoke_test { sh("#{bin("chef-run")} -v", env: { "CHEF_TELEMETRY_OPT_OUT" => "true" }) }
end

Expand Down

0 comments on commit eeda8a4

Please sign in to comment.