summaryrefslogtreecommitdiff
path: root/acceptance
diff options
context:
space:
mode:
authorKartik Null Cating-Subramanian <ksubramanian@chef.io>2016-04-21 18:57:27 -0400
committerKartik Null Cating-Subramanian <ksubramanian@chef.io>2016-04-25 12:04:09 -0400
commit63dd9afb7aee3c7d1aa61a036e313c4d74f683fe (patch)
tree91bbf9322d709590e20e56c0da66ef9534f31729 /acceptance
parent2034305917a76d4c203e457a9ebf61d28819ccbd (diff)
downloadchef-63dd9afb7aee3c7d1aa61a036e313c4d74f683fe.tar.gz
Split the unit and integration tests to parallelize them
Diffstat (limited to 'acceptance')
-rw-r--r--acceptance/fips/.kitchen.yml6
-rw-r--r--acceptance/fips/test/integration/fips-integration/serverspec/Gemfile (renamed from acceptance/fips/test/integration/fips/serverspec/Gemfile)0
-rw-r--r--acceptance/fips/test/integration/fips-integration/serverspec/fips-integration_spec.rb51
-rw-r--r--acceptance/fips/test/integration/fips-unit-functional/serverspec/Gemfile3
-rw-r--r--acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb (renamed from acceptance/fips/test/integration/fips/serverspec/fips_spec.rb)5
5 files changed, 60 insertions, 5 deletions
diff --git a/acceptance/fips/.kitchen.yml b/acceptance/fips/.kitchen.yml
index 946401a738..23280f9142 100644
--- a/acceptance/fips/.kitchen.yml
+++ b/acceptance/fips/.kitchen.yml
@@ -1,4 +1,8 @@
suites:
- - name: fips
+ - name: fips-unit-functional
+ includes: [centos-6, windows-2012r2]
+ run_list:
+
+ - name: fips-integration
includes: [centos-6, windows-2012r2]
run_list:
diff --git a/acceptance/fips/test/integration/fips/serverspec/Gemfile b/acceptance/fips/test/integration/fips-integration/serverspec/Gemfile
index 3921e6a92a..3921e6a92a 100644
--- a/acceptance/fips/test/integration/fips/serverspec/Gemfile
+++ b/acceptance/fips/test/integration/fips-integration/serverspec/Gemfile
diff --git a/acceptance/fips/test/integration/fips-integration/serverspec/fips-integration_spec.rb b/acceptance/fips/test/integration/fips-integration/serverspec/fips-integration_spec.rb
new file mode 100644
index 0000000000..59a888bef1
--- /dev/null
+++ b/acceptance/fips/test/integration/fips-integration/serverspec/fips-integration_spec.rb
@@ -0,0 +1,51 @@
+require "mixlib/shellout"
+require "bundler"
+
+describe "Chef Fips Integration Specs" do
+ def windows?
+ if RUBY_PLATFORM =~ /mswin|mingw|windows/
+ true
+ else
+ false
+ end
+ end
+
+ let(:omnibus_root) do
+ if windows?
+ "c:/opscode/chef"
+ else
+ "/opt/chef"
+ end
+ end
+
+ let(:env) do
+ {
+ "PATH" => [ "#{omnibus_root}/embedded/bin", ENV["PATH"] ].join(File::PATH_SEPARATOR),
+ "BUNDLE_GEMFILE" => "#{omnibus_root}/Gemfile",
+ "GEM_PATH" => nil, "GEM_CACHE" => nil, "GEM_HOME" => nil,
+ "BUNDLE_IGNORE_CONFIG" => "true",
+ "BUNDLE_FROZEN" => "1",
+ "CHEF_FIPS" => "1"
+ }
+ end
+
+ let(:chef_dir) do
+ cmd = Mixlib::ShellOut.new("bundle show chef", env: env).run_command
+ cmd.error!
+ cmd.stdout.chomp
+ end
+
+ def run_rspec_test(test)
+ Bundler.with_clean_env do
+ cmd = Mixlib::ShellOut.new(
+ "bundle exec rspec -f documentation -t ~requires_git #{test}",
+ env: env, cwd: chef_dir, timeout: 3600
+ )
+ cmd.run_command.error!
+ end
+ end
+
+ it "passes the integration specs" do
+ run_rspec_test("spec/integration")
+ end
+end
diff --git a/acceptance/fips/test/integration/fips-unit-functional/serverspec/Gemfile b/acceptance/fips/test/integration/fips-unit-functional/serverspec/Gemfile
new file mode 100644
index 0000000000..3921e6a92a
--- /dev/null
+++ b/acceptance/fips/test/integration/fips-unit-functional/serverspec/Gemfile
@@ -0,0 +1,3 @@
+source "https://rubygems.org"
+
+gem "mixlib-shellout"
diff --git a/acceptance/fips/test/integration/fips/serverspec/fips_spec.rb b/acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb
index 9bf0db1cd9..446261f83f 100644
--- a/acceptance/fips/test/integration/fips/serverspec/fips_spec.rb
+++ b/acceptance/fips/test/integration/fips-unit-functional/serverspec/fips-unit-functional_spec.rb
@@ -1,7 +1,7 @@
require "mixlib/shellout"
require "bundler"
-describe "Chef Fips Specs" do
+describe "Chef Fips Unit/Functional Specs" do
def windows?
if RUBY_PLATFORM =~ /mswin|mingw|windows/
true
@@ -53,7 +53,4 @@ describe "Chef Fips Specs" do
run_rspec_test("spec/functional")
end
- it "passes the integration specs" do
- run_rspec_test("spec/integration")
- end
end