1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

respect --test-order=random

Now --test-order=random is simply ignored. This patch respect
this option.
This commit is contained in:
Koichi Sasada 2020-02-27 10:49:14 +09:00
parent 9bede6e942
commit 28399e4e0f
Notes: git 2020-02-28 17:44:51 +09:00
3 changed files with 15 additions and 6 deletions

View file

@ -1387,11 +1387,16 @@ module MiniTest
end
def self.test_order # :nodoc:
:random
:sorted
end
def self.test_suites # :nodoc:
@@test_suites.keys.sort_by { |ts| ts.name.to_s }
case self.test_order
when :random
@@test_suites.keys.shuffle
else
@@test_suites.keys.sort_by { |ts| ts.name.to_s }
end
end
def self.test_methods # :nodoc:

View file

@ -474,6 +474,14 @@ module Test
# Require needed thing for parallel running
require 'timeout'
@tasks = @files.dup # Array of filenames.
case MiniTest::Unit::TestCase.test_order
when :random
@tasks.shuffle!
else
# sorted
end
@need_quit = false
@dead_workers = [] # Array of dead workers.
@warnings = []

View file

@ -18,10 +18,6 @@ module Test
super runner
end
def self.test_order
:sorted
end
def self.method_added(name)
super
return unless name.to_s.start_with?("test_")