From c7ece4b546487f74078fbc0a367de4b6e46aeaf3 Mon Sep 17 00:00:00 2001 From: stephsachrajda Date: Fri, 13 Oct 2023 19:17:32 -0400 Subject: [PATCH] put it in the correct part --- ruby/lib/minitest/queue/runner.rb | 11 +++++++++++ ruby/lib/rspec/queue.rb | 11 ----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ruby/lib/minitest/queue/runner.rb b/ruby/lib/minitest/queue/runner.rb index 7fa75df4..bd79f1ac 100644 --- a/ruby/lib/minitest/queue/runner.rb +++ b/ruby/lib/minitest/queue/runner.rb @@ -229,6 +229,17 @@ def report_command unless supervisor.exhausted? msg = "#{supervisor.size} tests weren't run." if supervisor.max_test_failed? + puts("Encountered #{supervisor.test_failed} failures") + + if queue_config.failure_file + reporter = BuildStatusReporter.new(build: supervisor.build) + failures = reporter.error_reports.map(&:to_h).to_json + puts "----" + puts failures + puts "----" + File.write(queue_config.failure_file, failures) + end + puts('Encountered too many failed tests. Test run was ended early.') abort!(msg) else diff --git a/ruby/lib/rspec/queue.rb b/ruby/lib/rspec/queue.rb index 52e67432..43073921 100644 --- a/ruby/lib/rspec/queue.rb +++ b/ruby/lib/rspec/queue.rb @@ -292,17 +292,6 @@ def call(options, stdout, stderr) end unless supervisor.exhausted? - errors = supervisor.build.error_reports.sort_by(&:first).map(&:last) - if errors.empty? - step(green('No errors found')) - 0 - else - message = errors.size == 1 ? "1 error found" : "#{errors.size} errors found" - step(red(message), collapsed: false) - puts errors - 1 - end - abort! "#{supervisor.size} tests weren't run." end end