tasks/ci.rake in beaker-puppet-1.26.3 vs tasks/ci.rake in beaker-puppet-1.27.0
- old
+ new
@@ -283,21 +283,26 @@
def beaker_suite_retry(type)
beaker(:init, '--hosts', ENV['HOSTS'], '--options-file', "config/#{String(type)}/options.rb")
beaker(:provision)
begin
- json_results_file = Tempfile.new
-
beaker(:exec, 'pre-suite', '--preserve-state', '--pre-suite', pre_suites(type))
beaker(:exec, 'pre-suite', '--preserve-state')
- beaker(:exec, ENV['TESTS'], '--test-results-file', json_results_file.path)
- rescue RuntimeError
- tests_to_rerun = JSON.load(File.read(json_results_file.path))
- if tests_to_rerun.length > 0
- puts '*** Retrying the following:'
- puts tests_to_rerun.map { |spec| " #{spec}" }
- beaker(:exec, tests_to_rerun.map { |str| "#{str}" }.join(',') )
+
+ begin
+ json_results_file = Tempfile.new
+ beaker(:exec, ENV['TESTS'], '--test-results-file', json_results_file.path)
+ rescue RuntimeError => e
+ puts "ERROR: #{e.message}"
+ tests_to_rerun = JSON.load(File.read(json_results_file.path))
+ if tests_to_rerun.nil? || tests_to_rerun.empty?
+ raise e
+ else
+ puts '*** Retrying the following:'
+ puts tests_to_rerun.map { |spec| " #{spec}" }
+ beaker(:exec, tests_to_rerun.map { |str| "#{str}" }.join(',') )
+ end
end
ensure
beaker(:exec, 'post-suite')
preserve_hosts = ENV['OPTIONS'].include?('--preserve-hosts=always') if ENV['OPTIONS']
beaker(:destroy) unless preserve_hosts
@@ -310,9 +315,10 @@
presuites = case type
when :aio
[
"#{beaker_root}/setup/common/000-delete-puppet-when-none.rb",
"#{beaker_root}/setup/common/003_solaris_cert_fix.rb",
+ "#{beaker_root}/setup/common/005_redhat_subscription_fix.rb",
"#{beaker_root}/setup/aio/010_Install_Puppet_Agent.rb",
"#{beaker_root}/setup/common/011_Install_Puppet_Server.rb",
"#{beaker_root}/setup/common/012_Finalize_Installs.rb",
"#{beaker_root}/setup/common/020_InstallCumulusModules.rb",
"#{beaker_root}/setup/common/021_InstallAristaModuleMasters.rb",