Skip to content

Commit

Permalink
Move reporter up
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisBr committed Jan 4, 2024
1 parent df21dc7 commit 36f8875
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ruby/lib/minitest/queue/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,11 @@ def report_command
end

unless supervisor.exhausted?
reporter = BuildStatusReporter.new(build: supervisor.build)
reporter.report
msg = "#{supervisor.size} tests weren't run."
if supervisor.max_test_failed?
puts('Encountered too many failed tests. Test run was ended early.')
reporter = BuildStatusReporter.new(build: supervisor.build)
reporter.report
abort!(msg)
else
abort!(msg)
Expand Down
9 changes: 6 additions & 3 deletions ruby/test/integration/minitest_redis_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,14 @@ def test_max_test_failed
assert_empty err
expected = <<~EXPECTED
Waiting for workers to complete
Encountered too many failed tests. Test run was ended early.
Ran 3 tests, 47 assertions, 3 failures, 0 errors, 0 skips, 44 requeues in X.XXs (aggregated)
EXPECTED
assert_equal expected.strip, normalize(out.lines[0..3].join.strip)
assert_equal "97 tests weren't run.", normalize(out.lines.last.strip)
assert_equal expected.strip, normalize(out.lines[0..2].join.strip)
expected = <<~EXPECTED
Encountered too many failed tests. Test run was ended early.
97 tests weren't run.
EXPECTED
assert_equal expected.strip, normalize(out.lines.last(2).join.strip)
end

def test_circuit_breaker
Expand Down

0 comments on commit 36f8875

Please sign in to comment.