From 99d84c6ab288788b85c0c3603d4630b39cf29ed0 Mon Sep 17 00:00:00 2001 From: Matthew Draper Date: Tue, 5 Mar 2019 01:40:36 +1030 Subject: Clean up AR's isolated test runner --- activerecord/Rakefile | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'activerecord/Rakefile') diff --git a/activerecord/Rakefile b/activerecord/Rakefile index be2380ebdc..f259ae7e12 100644 --- a/activerecord/Rakefile +++ b/activerecord/Rakefile @@ -80,9 +80,19 @@ end require "bundler/setup" unless defined?(Bundler) - # Every test file loads this first, so doing it post-fork gains - # us nothing. - require "cases/helper" + # Every test file loads "cases/helper" first, so doing it + # post-fork gains us nothing. + + # We need to dance around minitest autorun, though. + require "minitest" + Minitest.instance_eval do + alias _original_autorun autorun + def autorun + # no-op + end + require "cases/helper" + alias autorun _original_autorun + end failing_files = [] @@ -115,6 +125,8 @@ end ARGV.clear.concat test_options Rake.application = nil + Minitest.autorun + load file } -- cgit v1.2.3