Skip to content

Commit

Permalink
put it in the correct part
Browse files Browse the repository at this point in the history
  • Loading branch information
stephsachrajda committed Oct 17, 2023
1 parent 0993188 commit 74ccbdc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
8 changes: 8 additions & 0 deletions ruby/lib/minitest/queue/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@ 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
File.write(queue_config.failure_file, failures)
end

puts('Encountered too many failed tests. Test run was ended early.')
abort!(msg)
else
Expand Down
11 changes: 0 additions & 11 deletions ruby/lib/rspec/queue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 74ccbdc

Please sign in to comment.