Update integration task
added common integartion task to allow this rake file to be used by other cookbooks Depends-On: Ie84d5258a4290110df9bf7754eb3dfce7791e223 Depends-On: I6bddae9fc83a5fc133e43a27e96e1a7110c94cfb Change-Id: I4834e9557b07db05591b78d28ef27a6046e4c0f0
This commit is contained in:
parent
82b4e9b318
commit
1810d2d190
18
Rakefile
18
Rakefile
|
@ -2,22 +2,27 @@ task default: ["test"]
|
||||||
|
|
||||||
task :test => [:lint, :style, :unit]
|
task :test => [:lint, :style, :unit]
|
||||||
|
|
||||||
|
desc "Vendor the cookbooks in the Berksfile"
|
||||||
task :berks_prep do
|
task :berks_prep do
|
||||||
sh %{chef exec berks vendor}
|
sh %{chef exec berks vendor}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc "Run FoodCritic (lint) tests"
|
||||||
task :lint do
|
task :lint do
|
||||||
sh %{chef exec foodcritic --epic-fail any --tags ~FC003 --tags ~FC023 .}
|
sh %{chef exec foodcritic --epic-fail any --tags ~FC003 --tags ~FC023 .}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc "Run RuboCop (style) tests"
|
||||||
task :style do
|
task :style do
|
||||||
sh %{chef exec rubocop}
|
sh %{chef exec rubocop}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc "Run RSpec (unit) tests"
|
||||||
task :unit => :berks_prep do
|
task :unit => :berks_prep do
|
||||||
sh %{chef exec rspec --format documentation}
|
sh %{chef exec rspec --format documentation}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc "Remove the berks-cookbooks directory and the Berksfile.lock"
|
||||||
task :clean do
|
task :clean do
|
||||||
rm_rf [
|
rm_rf [
|
||||||
'berks-cookbooks',
|
'berks-cookbooks',
|
||||||
|
@ -25,9 +30,14 @@ task :clean do
|
||||||
]
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "All-in-One Neutron build Infra"
|
desc "All-in-One Neutron build"
|
||||||
task :integration do
|
task :integration => :common_integration do
|
||||||
# Use the berksfile REPO_DEV support to make use of the existing patch clone.
|
# Noop
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Common task used by all cookbooks for integration test"
|
||||||
|
task :common_integration do
|
||||||
|
# Use the berksfile support to make use of the existing patch clones.
|
||||||
# Make a sym link from workspace/gate-cookbook-openstack-common-chef-rake-integration
|
# Make a sym link from workspace/gate-cookbook-openstack-common-chef-rake-integration
|
||||||
# to workspace/cookbook-openstack-common
|
# to workspace/cookbook-openstack-common
|
||||||
patch_dir = Dir.pwd
|
patch_dir = Dir.pwd
|
||||||
|
@ -36,6 +46,6 @@ task :integration do
|
||||||
|
|
||||||
sh %(git clone --depth 1 git://github.com/stackforge/openstack-chef-repo.git ../openstack-chef-repo)
|
sh %(git clone --depth 1 git://github.com/stackforge/openstack-chef-repo.git ../openstack-chef-repo)
|
||||||
Dir.chdir('../openstack-chef-repo') do
|
Dir.chdir('../openstack-chef-repo') do
|
||||||
sh %(REPO_DEV=ON chef exec rake integration)
|
sh %(chef exec rake integration)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue