Class: Minitest::Distributed::TestRunner

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/minitest/distributed/test_runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ TestRunner

Returns a new instance of TestRunner.



22
23
24
25
26
27
28
# File 'lib/minitest/distributed/test_runner.rb', line 22

def initialize(options)
  @options = options

  @configuration = T.let(@options[:distributed], Configuration)
  @coordinator = T.let(configuration.coordinator, Coordinators::CoordinatorInterface)
  @test_selector = T.let(TestSelector.new(options), TestSelector)
end

Instance Attribute Details

#configurationObject (readonly)

Returns the value of attribute configuration.



13
14
15
# File 'lib/minitest/distributed/test_runner.rb', line 13

def configuration
  @configuration
end

#coordinatorObject (readonly)

Returns the value of attribute coordinator.



19
20
21
# File 'lib/minitest/distributed/test_runner.rb', line 19

def coordinator
  @coordinator
end

#optionsObject (readonly)

Returns the value of attribute options.



10
11
12
# File 'lib/minitest/distributed/test_runner.rb', line 10

def options
  @options
end

#test_selectorObject (readonly)

Returns the value of attribute test_selector.



16
17
18
# File 'lib/minitest/distributed/test_runner.rb', line 16

def test_selector
  @test_selector
end

Instance Method Details

#run(reporter) ⇒ Object



31
32
33
34
# File 'lib/minitest/distributed/test_runner.rb', line 31

def run(reporter)
  coordinator.produce(test_selector: test_selector)
  coordinator.consume(reporter: reporter)
end