lib/minitest/distributed/test_selector.rb in minitest-distributed-0.2.8 vs lib/minitest/distributed/test_selector.rb in minitest-distributed-0.2.9

- old
+ new

@@ -34,11 +34,21 @@ @filters << Filters::IncludeFileFilter.new(Pathname.new(include_file)) if include_file end sig { returns(T::Array[Minitest::Runnable]) } def discover_tests - Minitest::Runnable.runnables.flat_map do |runnable| + runnables.flat_map do |runnable| runnable.runnable_methods.map { |method_name| runnable.new(method_name) } + end + end + + sig { returns(T::Array[T.class_of(Minitest::Runnable)]) } + def runnables + if options[:distributed].shuffle_suites + srand(Minitest.seed) + Minitest::Runnable.runnables.shuffle + else + Minitest::Runnable.runnables end end sig { params(tests: T::Array[Minitest::Runnable]).returns(T::Array[Minitest::Runnable]) } def select_tests(tests)