Sha256: fb4fc65accff55387c0bce808e4bc6cdc31663aa4c89f4a208f1640c0e9a0896

Contents?: true

Size: 778 Bytes

Versions: 10

Compression:

Stored size: 778 Bytes

Contents

# frozen_string_literal: true

module Buildkite::TestCollector::MinitestPlugin
  class Reporter < Minitest::StatisticsReporter
    def initialize(io, options)
      super
      @io = io
      @options = options
    end

    def record(result)
      super

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

    def report
      super

      if Buildkite::TestCollector.session.present?
        examples_count = {
          examples: count,
          failed: failures,
          pending: skips,
          errors_outside_examples: 0, # Minitest does not report this
        }

        Buildkite::TestCollector.session.close(examples_count)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
buildkite-test_collector-1.3.0 lib/buildkite/test_collector/minitest_plugin/reporter.rb
buildkite-test_collector-1.2.5 lib/buildkite/test_collector/minitest_plugin/reporter.rb
buildkite-test_collector-1.2.4 lib/buildkite/test_collector/minitest_plugin/reporter.rb
buildkite-test_collector-1.2.3 lib/buildkite/test_collector/minitest_plugin/reporter.rb
buildkite-test_collector-1.1.3 lib/buildkite/test_collector/minitest_plugin/reporter.rb
buildkite-test_collector-1.1.2 lib/buildkite/test_collector/minitest_plugin/reporter.rb
buildkite-test_collector-1.1.1 lib/buildkite/test_collector/minitest_plugin/reporter.rb
buildkite-test_collector-1.1.0 lib/buildkite/test_collector/minitest_plugin/reporter.rb
buildkite-test_collector-1.0.1 lib/buildkite/test_collector/minitest_plugin/reporter.rb
buildkite-test_collector-1.0.0 lib/buildkite/test_collector/minitest_plugin/reporter.rb