Skip to content

Commit

Permalink
add check
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita8 committed Mar 1, 2024
1 parent 497eaa3 commit b9208d9
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions ruby/lib/minitest/queue/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,20 @@ def run_command
end
Minitest.queue_reporters = reporters

trap('TERM') { Minitest.queue.shutdown! }
trap('INT') { Minitest.queue.shutdown! }
trap('TERM') do
puts "calling junit reporter1"
Minitest.queue.shutdown!
puts "calling junit reporter2"
puts "start time: #{junit_reporter.start_time}"
junit_reporter.report if junit_reporter.start_time
end
trap('INT') do
puts "calling junit reporter1"
Minitest.queue.shutdown!
puts "calling junit reporter2"
puts "start time: #{junit_reporter.start_time}"
junit_reporter.report if junit_reporter.start_time
end

if queue.rescue_connection_errors { queue.exhausted? }
puts green('All tests were ran already')
Expand All @@ -108,7 +120,6 @@ def run_command

at_exit {
verify_reporters!(reporters)
junit_reporter.report
}
# Let minitest's at_exit hook trigger
end
Expand Down

0 comments on commit b9208d9

Please sign in to comment.