Skip to content

Commit a044ce1

Browse files
committed
(maint) Add support for agent-only testing
Previously the acceptance test suite had been modified to use test tiering and test mode switcher. However the spec acceptance helper method still expected a master to be present. This commit modifies the helper to only execute master provisioning steps if there is indeed a master specified in the hosts array.
1 parent 29af633 commit a044ce1

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

spec/spec_helper_acceptance.rb

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,14 @@
2727
# Install PE
2828
run_puppet_install_helper
2929

30-
# Install PE License onto Master
31-
install_pe_license(master)
30+
# Install PE License onto Master, if one exists.
31+
install_pe_license(master) unless hosts_as("master").empty?
32+
33+
# Determine root path of local module source.
34+
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
35+
# In CI install from staging forge, otherwise from local
36+
staging = { :module_name => 'puppetlabs-sqlserver' }
37+
local = { :module_name => 'sqlserver', :source => proj_root }
3238

3339
unless ENV['MODULE_provision'] == 'no'
3440
hosts_as("sql_host").each do |agent|
@@ -66,16 +72,8 @@
6672
on(agent, puppet("module install #{dep}"))
6773
end
6874

69-
# Determine root path of local module source.
70-
proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
71-
72-
# In CI install from staging forge, otherwise from local
73-
staging = { :module_name => 'puppetlabs-sqlserver' }
74-
local = { :module_name => 'sqlserver', :source => proj_root }
75-
7675
# Install sqlserver dependencies.
7776
on(agent, puppet('module install puppetlabs-stdlib'))
78-
on(master, puppet('module install puppetlabs-stdlib'))
7977

8078
# Mount windows 2012R2 ISO to allow install of .NET 3.5 Windows Feature
8179
iso_opts = {
@@ -88,6 +86,15 @@
8886
# Install sqlserver module from local source.
8987
# See FM-5062 for more details.
9088
copy_module_to(agent, local)
91-
copy_module_to(master, local)
89+
end
90+
91+
hosts_as("master").each do |host|
92+
# Install sqlserver dependencies.
93+
on(host, puppet('module install puppetlabs-stdlib'))
94+
95+
# Install sqlserver module from local source.
96+
# See FM-5062 for more details.
97+
local = { :module_name => 'sqlserver', :source => proj_root }
98+
copy_module_to(host, local)
9299
end
93100
end

0 commit comments

Comments
 (0)