Skip to content

Commit b2cb8de

Browse files
committed
no message
1 parent b4e82a5 commit b2cb8de

File tree

1 file changed

+13
-31
lines changed

1 file changed

+13
-31
lines changed

spec/spec_helper_acceptance_local.rb

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ class Helper
2929

3030
if ENV['GITHUB_ACTIONS'] == 'true'
3131
Helper.instance.run_shell("gsutil -q cp -r gs://artifactory-modules/puppetlabs-sqlserver/#{WIN_2012R2_ISO} C:/Windows/Temp/#{WIN_2012R2_ISO}")
32-
# iso_opts = {
33-
# folder: 'C:/Windows/Temp',
34-
# file: WIN_2012R2_ISO,
35-
# drive_letter: 'I',
36-
# }
37-
# mount_iso(iso_opts)
32+
iso_opts = {
33+
folder: 'C:/Windows/Temp',
34+
file: WIN_2012R2_ISO,
35+
drive_letter: 'I',
36+
}
37+
mount_iso(iso_opts)
3838

3939
# Temp fix to prove code works
4040
base_install('2016', 'C:/Windows/Temp')
@@ -105,61 +105,48 @@ def mount_iso(opts = {})
105105
end
106106

107107
def base_install(sql_version, resource_root)
108-
i_iso_opts = {
109-
folder: 'C:/Windows/Temp',
110-
file: WIN_2012R2_ISO,
111-
drive_letter: 'I',
112-
}
113-
mount_iso(i_iso_opts)
114-
115108
case sql_version.to_i
116109
when 2012
117110
Helper.instance.run_shell("gsutil -q cp -r gs://artifactory-modules/puppetlabs-sqlserver/#{SQL_2012_ISO} C:/Windows/Temp/#{SQL_2012_ISO}") if ENV['GITHUB_ACTIONS'] == 'true'
118-
h_iso_opts = {
111+
iso_opts = {
119112
folder: resource_root,
120113
file: SQL_2012_ISO,
121114
drive_letter: 'H',
122115
}
123116
when 2014
124117
Helper.instance.run_shell("gsutil -q cp -r gs://artifactory-modules/puppetlabs-sqlserver/#{SQL_2014_ISO} C:/Windows/Temp/#{SQL_2014_ISO}") if ENV['GITHUB_ACTIONS'] == 'true'
125-
h_iso_opts = {
118+
iso_opts = {
126119
folder: resource_root,
127120
file: SQL_2014_ISO,
128121
drive_letter: 'H',
129122
}
130123
when 2016
131124
Helper.instance.run_shell("gsutil -q cp -r gs://artifactory-modules/puppetlabs-sqlserver/#{SQL_2016_ISO} C:/Windows/Temp/#{SQL_2016_ISO}") if ENV['GITHUB_ACTIONS'] == 'true'
132-
h_iso_opts = {
125+
iso_opts = {
133126
folder: resource_root,
134127
file: SQL_2016_ISO,
135128
drive_letter: 'H',
136129
}
137130
when 2017
138131
Helper.instance.run_shell("gsutil -q cp -r gs://artifactory-modules/puppetlabs-sqlserver/#{SQL_2017_ISO} C:/Windows/Temp/#{SQL_2017_ISO}") if ENV['GITHUB_ACTIONS'] == 'true'
139-
h_iso_opts = {
132+
iso_opts = {
140133
folder: resource_root,
141134
file: SQL_2017_ISO,
142135
drive_letter: 'H',
143136
}
144137
when 2019
145138
Helper.instance.run_shell("gsutil -q cp -r gs://artifactory-modules/puppetlabs-sqlserver/#{SQL_2019_ISO} C:/Windows/Temp/#{SQL_2019_ISO}") if ENV['GITHUB_ACTIONS'] == 'true'
146-
h_iso_opts = {
139+
iso_opts = {
147140
folder: resource_root,
148141
file: SQL_2019_ISO,
149142
drive_letter: 'H',
150143
}
151144
end
152145
# Mount the ISO on the agent
153-
mount_iso(h_iso_opts)
146+
mount_iso(iso_opts)
154147
# Install Microsoft SQL on the agent before running any tests
155148
features = ['DQ', 'FullText', 'Replication', 'SQLEngine']
156149
install_sqlserver(features)
157-
158-
reboot()
159-
# Remount the ISO on the agent
160-
mount_iso(i_iso_opts)
161-
mount_iso(h_iso_opts)
162-
install_sqlserver(features)
163150
end
164151

165152
def install_sqlserver(features)
@@ -183,12 +170,7 @@ def install_sqlserver(features)
183170
windows_feature_source => 'I:\\sources\\sxs',
184171
}
185172
MANIFEST
186-
Helper.instance.apply_manifest(pp)
187-
end
188-
189-
def reboot()
190-
# Call the reboot plan
191-
system("bundle exec bolt --modulepath ./spec/fixtures/modules/ -i spec/fixtures/litmus_inventory.yaml plan run reboot targets='#{ENV['TARGET_HOST']}' reconnect_timeout=300")
173+
Helper.instance.apply_manifest(pp, catch_failures: true)
192174
end
193175

194176
def run_sql_query(opts = {}, &block)

0 commit comments

Comments
 (0)