lib/minitest/distributed/test_selector.rb in minitest-distributed-0.1.2 vs lib/minitest/distributed/test_selector.rb in minitest-distributed-0.2.0
- old
+ new
@@ -24,29 +24,27 @@
def initialize_filters
@filters << Filters::IncludeFilter.new(options[:filter]) if options[:filter]
@filters << Filters::ExcludeFilter.new(options[:exclude]) if options[:exclude]
end
- sig { returns(T::Array[EnqueuedRunnable]) }
+ sig { returns(T::Array[Minitest::Runnable]) }
def discover_tests
Minitest::Runnable.runnables.flat_map do |runnable|
- runnable.runnable_methods.map do |method_name|
- EnqueuedRunnable.new(class_name: runnable.name, method_name: method_name)
- end
+ runnable.runnable_methods.map { |method_name| runnable.new(method_name) }
end
end
- sig { params(tests: T::Array[EnqueuedRunnable]).returns(T::Array[EnqueuedRunnable]) }
+ sig { params(tests: T::Array[Minitest::Runnable]).returns(T::Array[Minitest::Runnable]) }
def select_tests(tests)
return tests if filters.empty?
tests.flat_map do |runnable_method|
filters.flat_map do |filter|
filter.call(runnable_method)
end
end.compact
end
- sig { returns(T::Array[EnqueuedRunnable]) }
+ sig { returns(T::Array[Minitest::Runnable]) }
def tests
select_tests(discover_tests)
end
end
end