Skip to content

Commit a63a5d7

Browse files
committed
Fixing spec testing error and turning on debug for acceptance testing to debug RHEL 8 builds
1 parent d3bcca3 commit a63a5d7

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

spec/classes/rabbitmq_spec.rb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,19 @@
190190

191191
context 'with service_manage set to true' do
192192
let(:params) { { admin_enable: true, management_ip_address: '1.1.1.1', service_manage: true } }
193+
let(:python_package) do
194+
if %w[Debian SUSE].include?(facts[:os]['family'])
195+
'python'
196+
elsif %w[FreeBSD OpenBSD].include?(facts[:os]['family'])
197+
'python2'
198+
elsif facts[:os]['family'] == 'RedHat'
199+
if facts[:os]['release']['major'] == '8'
200+
'python3'
201+
else
202+
'python'
203+
end
204+
end
205+
end
193206

194207
context 'with rabbitmqadmin_package set to blub' do
195208
let(:params) { { rabbitmqadmin_package: 'blub' } }
@@ -211,18 +224,7 @@
211224
is_expected.to contain_archive('rabbitmqadmin').with_source('http://1.1.1.1:15672/cli/rabbitmqadmin')
212225
end
213226
end
214-
if %w[Debian SUSE].include?(facts[:os]['family'])
215-
it { is_expected.to contain_package('python') }
216-
if %w[FreeBSD OpenBSD].include?(facts[:os]['family'])
217-
it { is_expected.to contain_package('python2') }
218-
end
219-
if facts[:os]['family'] == 'RedHat'
220-
if facts[:os]['release']['major'] == '8'
221-
it { is_expected.to contain_package('python3') }
222-
else
223-
it { is_expected.to contain_package('python') }
224-
end
225-
end
227+
it { is_expected.to contain_package(python_package) }
226228
end
227229
context 'with manage_python false' do
228230
let(:params) { { manage_python: false } }

spec/spec_helper_acceptance.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@
9595

9696
shared_examples 'an idempotent resource' do
9797
it 'applies with no errors' do
98-
apply_manifest(pp, catch_failures: true)
98+
apply_manifest(pp, catch_failures: true, debug: true)
9999
end
100100

101101
it 'applies a second time without changes' do
102-
apply_manifest(pp, catch_changes: true)
102+
apply_manifest(pp, catch_changes: true, debug: true)
103103
end
104104
end

0 commit comments

Comments
 (0)