From 0993188bbc6bc43ec886fda8586e68d0b294a608 Mon Sep 17 00:00:00 2001 From: stephsachrajda Date: Fri, 13 Oct 2023 18:25:25 -0400 Subject: [PATCH] add error reporting before abort --- ruby/lib/rspec/queue.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ruby/lib/rspec/queue.rb b/ruby/lib/rspec/queue.rb index 43073921..52e67432 100644 --- a/ruby/lib/rspec/queue.rb +++ b/ruby/lib/rspec/queue.rb @@ -292,6 +292,17 @@ 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