Skip to content

Commit ec7f5a0

Browse files
committed
(maint) Improve acceptance tests
Added puppet7 acceptance tests Added support for gem native extensions in acceptance tests Fixed reporting of errors from the rake tasks
1 parent ab24826 commit ec7f5a0

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

.travis.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,12 @@ jobs:
2929
- bundle exec rake litmus:install_gems
3030
script:
3131
- bundle exec rake litmus:acceptance:parallel
32+
- bundler_args: ""
33+
rvm: 2.7
34+
before_script:
35+
- bundle exec rake 'litmus:provision[docker, centos:7]'
36+
- bundle exec rake 'litmus:install_agent[puppet7]'
37+
- bundle exec rake 'litmus:install_modules_from_directory[./spec/fixtures/acceptance/modules]'
38+
- bundle exec rake litmus:install_gems
39+
script:
40+
- bundle exec rake litmus:acceptance:parallel

Rakefile

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,26 @@ namespace :litmus do
7070
result = run_command(install_command, target_nodes, config: nil, inventory: inventory_hash)
7171
if result.is_a?(Array)
7272
result.each do |node|
73-
puts "#{node['node']} failed #{node['result']}" if node['status'] != 'success'
73+
puts "#{node['target']} failed: '#{node['value']}'" if node['status'] != 'success'
7474
end
7575
else
7676
raise "Failed trying to run '#{install_command}' against inventory."
7777
end
7878
end
7979

80+
def install_build_tools(target_nodes, inventory_hash)
81+
puts 'Installing build tools...'
82+
install_build_command = "yum -y group install 'Development Tools'"
83+
result = run_command(install_build_command, target_nodes, config: nil, inventory: inventory_hash)
84+
if result.is_a?(Array)
85+
result.each do |node|
86+
puts "#{node['target']} failed: '#{node['value']}'" if node['status'] != 'success'
87+
end
88+
else
89+
raise "Failed trying to run '#{install_build_command}' against inventory."
90+
end
91+
end
92+
8093
# Install the gem under test and required fixture on a collection of nodes
8194
#
8295
# @param :target_node_name [Array] nodes on which to install a puppet module for testing.
@@ -92,11 +105,11 @@ namespace :litmus do
92105
include BoltSpec::Run
93106

94107
# Build the gem
108+
puts 'Building gem...'
95109
`gem build puppet-strings.gemspec --quiet`
96110
result = $CHILD_STATUS
97111
raise "Unable to build the puppet-strings gem. Returned exit code #{result.exitstatus}" unless result.exitstatus.zero?
98112

99-
puts 'Built'
100113
# Find the gem build artifact
101114
gem_tar = Dir.glob('puppet-strings-*.gem').max_by { |f| File.mtime(f) }
102115
raise "Unable to find package in 'puppet-strings-*.gem'" if gem_tar.nil?
@@ -111,6 +124,8 @@ namespace :litmus do
111124
puts 'Copying gem to targets...'
112125
upload_file(gem_tar, File.basename(gem_tar), target_string, inventory: inventory_hash)
113126

127+
install_build_tools(target_nodes, inventory_hash)
128+
114129
# Install dependent gems
115130
puts 'Installing yard gem...'
116131
install_remote_gem('yard', target_nodes, inventory_hash)

0 commit comments

Comments
 (0)