Class: Buildkite::TestCollector::MinitestPlugin::Reporter

Inherits:
Minitest::StatisticsReporter
  • Object
show all
Defined in:
lib/buildkite/test_collector/minitest_plugin/reporter.rb

Instance Method Summary collapse

Constructor Details

#initialize(io, options) ⇒ Reporter

Returns a new instance of Reporter.



5
6
7
8
9
# File 'lib/buildkite/test_collector/minitest_plugin/reporter.rb', line 5

def initialize(io, options)
  super
  @io = io
  @options = options
end

Instance Method Details

#record(result) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/buildkite/test_collector/minitest_plugin/reporter.rb', line 11

def record(result)
  super

  if Buildkite::TestCollector.uploader
    if trace = Buildkite::TestCollector.uploader.traces[result.source_location]
      Buildkite::TestCollector.session.add_example_to_send_queue(result.source_location)
    end
  end
end

#reportObject



21
22
23
24
25
26
27
28
# File 'lib/buildkite/test_collector/minitest_plugin/reporter.rb', line 21

def report
  super

  if Buildkite::TestCollector.session
    Buildkite::TestCollector.session.send_remaining_data
    Buildkite::TestCollector.session.close
  end
end