summaryrefslogtreecommitdiff
path: root/tasks/external_tests.rb
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2015-09-30 13:35:18 -0700
committerJohn Keiser <john@johnkeiser.com>2015-09-30 14:24:57 -0700
commit25bd140d724dc6f9eb3333aa9182cf7fa88aa434 (patch)
treea5b2030cc41438d14219efeb7194beb023a33054 /tasks/external_tests.rb
parente6959f4e9306a65ac52bc9087acdf4a0bccc2f59 (diff)
downloadchef-25bd140d724dc6f9eb3333aa9182cf7fa88aa434.tar.gz
Add cheffish, chef-zero, chef-provisioning and chef-provisioning-aws specs
Diffstat (limited to 'tasks/external_tests.rb')
-rw-r--r--tasks/external_tests.rb26
1 files changed, 16 insertions, 10 deletions
diff --git a/tasks/external_tests.rb b/tasks/external_tests.rb
index b87b5bf1d6..9304244424 100644
--- a/tasks/external_tests.rb
+++ b/tasks/external_tests.rb
@@ -1,6 +1,6 @@
require 'tempfile'
-def bundle_exec_with_chef(test_gem, command)
+def bundle_exec_with_chef(test_gem, commands)
gem_path = Bundler.environment.specs[test_gem].first.full_gem_path
gemfile_path = File.join(gem_path, 'Gemfile.chef-external-test')
gemfile = File.open(gemfile_path, "w")
@@ -22,7 +22,9 @@ def bundle_exec_with_chef(test_gem, command)
gemfile.close
Dir.chdir(gem_path) do
system({ 'BUNDLE_GEMFILE' => gemfile.path, 'RUBYOPT' => nil }, "bundle install")
- system({ 'BUNDLE_GEMFILE' => gemfile.path, 'RUBYOPT' => nil }, "bundle exec #{command}")
+ Array(commands).each do |command|
+ system({ 'BUNDLE_GEMFILE' => gemfile.path, 'RUBYOPT' => nil }, "bundle exec #{command}")
+ end
end
ensure
File.delete(gemfile_path)
@@ -30,18 +32,22 @@ def bundle_exec_with_chef(test_gem, command)
end
EXTERNAL_PROJECTS = {
- "chef-sugar" => "rake",
- "foodcritic" => "rake test",
- "chefspec" => "rake",
- "chef-rewind" => "rake spec",
- "poise" => "rake spec",
- "halite" => "rake spec"
+ "chef-zero" => [ "rake spec", "rake pedant" ],
+ "cheffish" => "rake spec",
+ "chef-provisioning" => "rake spec",
+ "chef-provisioning-aws" => "rake spec",
+ "chef-sugar" => "rake",
+ "foodcritic" => "rake test",
+ "chefspec" => "rake",
+ "chef-rewind" => "rake spec",
+ "poise" => "rake spec",
+ "halite" => "rake spec"
}
task :external_specs => EXTERNAL_PROJECTS.keys.map { |g| :"#{g.sub("-","_")}_spec" }
-EXTERNAL_PROJECTS.each do |test_gem, command|
+EXTERNAL_PROJECTS.each do |test_gem, commands|
task :"#{test_gem.gsub('-','_')}_spec" do
- bundle_exec_with_chef(test_gem, command)
+ bundle_exec_with_chef(test_gem, commands)
end
end