diff --git a/ruby/lib/minitest/queue/runner.rb b/ruby/lib/minitest/queue/runner.rb index 6c3b88f1..153e2646 100644 --- a/ruby/lib/minitest/queue/runner.rb +++ b/ruby/lib/minitest/queue/runner.rb @@ -199,7 +199,7 @@ def report_command msg = "#{supervisor.size} tests weren't run." if supervisor.max_test_failed? puts('Encountered too many failed tests. Test run was ended early.') - puts(msg) + abort!(msg) else abort!(msg) end diff --git a/ruby/test/integration/minitest_redis_test.rb b/ruby/test/integration/minitest_redis_test.rb index c5bbc737..d0ca2d7b 100644 --- a/ruby/test/integration/minitest_redis_test.rb +++ b/ruby/test/integration/minitest_redis_test.rb @@ -91,6 +91,7 @@ def test_max_test_failed assert_equal 'Ran 47 tests, 47 assertions, 3 failures, 0 errors, 0 skips, 44 requeues in X.XXs', output # Run the reporter + exit_code = nil out, err = capture_subprocess_io do system( @exe, 'report', @@ -102,12 +103,13 @@ def test_max_test_failed chdir: 'test/fixtures/', ) end + + refute_predicate $?, :success? assert_empty err expected = <<~EXPECTED Waiting for workers to complete Encountered too many failed tests. Test run was ended early. 97 tests weren't run. - 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..4].join.strip) end