From 36f88756eb18d55ae2154a85d8fe6e1f79bb693c Mon Sep 17 00:00:00 2001 From: Christian Bruckmayer Date: Thu, 4 Jan 2024 13:59:18 +0000 Subject: [PATCH] Move reporter up --- ruby/lib/minitest/queue/runner.rb | 4 ++-- ruby/test/integration/minitest_redis_test.rb | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ruby/lib/minitest/queue/runner.rb b/ruby/lib/minitest/queue/runner.rb index 1f19f18b..e195272e 100644 --- a/ruby/lib/minitest/queue/runner.rb +++ b/ruby/lib/minitest/queue/runner.rb @@ -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) diff --git a/ruby/test/integration/minitest_redis_test.rb b/ruby/test/integration/minitest_redis_test.rb index a8e99cc8..7c44d464 100644 --- a/ruby/test/integration/minitest_redis_test.rb +++ b/ruby/test/integration/minitest_redis_test.rb @@ -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