Skip to content

Commit b1d0d2f

Browse files
authored
Merge pull request #202 from OpenVoxProject/r10k_service_tests
Test for r10k failure condition
2 parents 2cc3775 + 9649de5 commit b1d0d2f

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

acceptance/tests/r10k.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This test ONLY checks if r10k is executable without gem version conflicts,
2+
# due to running into problems here with gem version bumps in puppet-runtime.
3+
# It does not test r10k functionality itself.
4+
test_name 'Can install and execute r10k with no gem conflicts'
5+
6+
# On pre-8.23.0, we already had fast_gettext installed to the
7+
# /opt/puppetlabs/puppet/lib/ruby/vendor_gems/gems directory, so
8+
# when r10k was installed, it would not install fast_gettext to
9+
# /opt/puppetlabs/puppet/lib/ruby/gems/3.2.0/gems. Then, upon agent
10+
# upgrade, that version in vendor_gems was replaced with 4.1.0 and
11+
# since r10k has a dependency on gettext-setup which pins
12+
# fast_gettext to ~> 2.1, it would fail. Below simulates
13+
# this condition by removing any fast_gettext installed automatically
14+
# via 'gem install r10k'.
15+
#
16+
# To test this more robustly, we'll want to implement this test in an upgrade
17+
# test suite instead.
18+
on(master, '/opt/puppetlabs/puppet/bin/gem install r10k')
19+
on(master, 'rm -rf "/opt/puppetlabs/puppet/lib/ruby/gems/3.2.0/gems/fast_gettext*"')
20+
on(master, 'rm -f /opt/puppetlabs/puppet/lib/ruby/gems/3.2.0/specifications/fast_gettext*.gemspec')
21+
on(master, '/opt/puppetlabs/puppet/bin/r10k')
22+
23+
teardown { on(master, '/opt/puppetlabs/puppet/bin/gem uninstall -ax r10k') }

0 commit comments

Comments
 (0)