Module: Minitest

Extended by:
T::Sig
Defined in:
lib/minitest/junitxml_plugin.rb,
lib/minitest/distributed.rb,
lib/minitest/test_order_plugin.rb,
lib/minitest/distributed_plugin.rb,
lib/minitest/distributed/version.rb,
lib/minitest/distributed/result_type.rb,
lib/minitest/distributed/test_runner.rb,
lib/minitest/distributed/configuration.rb,
lib/minitest/distributed/test_selector.rb,
lib/minitest/distributed/result_aggregate.rb,
lib/minitest/distributed/enqueued_runnable.rb,
lib/minitest/distributed/filters/exclude_filter.rb,
lib/minitest/distributed/filters/include_filter.rb,
lib/minitest/distributed/filters/file_filter_base.rb,
lib/minitest/distributed/filters/filter_interface.rb,
lib/minitest/distributed/filters/exclude_file_filter.rb,
lib/minitest/distributed/filters/include_file_filter.rb,
lib/minitest/distributed/reporters/junitxml_reporter.rb,
lib/minitest/distributed/reporters/test_order_reporter.rb,
lib/minitest/distributed/coordinators/redis_coordinator.rb,
lib/minitest/distributed/coordinators/memory_coordinator.rb,
lib/minitest/distributed/coordinators/coordinator_interface.rb,
lib/minitest/distributed/reporters/distributed_summary_reporter.rb,
lib/minitest/distributed/reporters/distributed_progress_reporter.rb,
lib/minitest/distributed/reporters/redis_coordinator_warnings_reporter.rb

Overview

typed: strict frozen_string_literal: true

Defined Under Namespace

Modules: Distributed Classes: AttemptsExhausted, Discard, Requeue

Class Method Summary collapse

Class Method Details

.plugin_distributed_init(options) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/minitest/distributed_plugin.rb', line 25

def plugin_distributed_init(options)
  return if options[:disable_distributed]

  Minitest.singleton_class.prepend(Minitest::Distributed::TestRunnerPatch)

  remove_reporter(::Rails::TestUnitReporter) if defined?(::Rails::TestUnitReporter)
  remove_reporter(Minitest::ProgressReporter)
  remove_reporter(Minitest::SummaryReporter)

  options[:distributed].coordinator.register_reporters(reporter: reporter, options: options)

  reporter << Minitest::Distributed::Reporters::DistributedPogressReporter.new(options[:io], options)
  reporter << Minitest::Distributed::Reporters::DistributedSummaryReporter.new(options[:io], options)
end

.plugin_distributed_options(opts, options) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/minitest/distributed_plugin.rb', line 10

def plugin_distributed_options(opts, options)
  continuous_integration = ENV.fetch("CI", "false") == "true"
  options[:disable_distributed] = !continuous_integration

  opts.on("--disable-distributed", "Disable the distributed plugin") do
    options[:disable_distributed] = true
  end

  opts.on("--enable-distributed", "Enable the distributed plugin") do
    options[:disable_distributed] = false
  end

  options[:distributed] = Minitest::Distributed::Configuration.from_command_line_options(opts, options)
end

.plugin_junitxml_init(options) ⇒ Object



14
15
16
17
18
19
# File 'lib/minitest/junitxml_plugin.rb', line 14

def plugin_junitxml_init(options)
  return if options[:junitxml].nil?

  require "minitest/distributed/reporters/junitxml_reporter"
  reporter << Minitest::Distributed::Reporters::JUnitXMLReporter.new(options[:io], options)
end

.plugin_junitxml_options(opts, options) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/minitest/junitxml_plugin.rb', line 6

def plugin_junitxml_options(opts, options)
  options[:junitxml] = ENV["MINITEST_JUNITXML"]

  opts.on("--junitxml=PATH", "Generate a JUnitXML report at the specified path") do |path|
    options[:junitxml] = path
  end
end

.plugin_test_order_init(options) ⇒ Object



14
15
16
17
18
19
# File 'lib/minitest/test_order_plugin.rb', line 14

def plugin_test_order_init(options)
  return if options[:test_order_file].nil?

  require_relative "distributed/reporters/test_order_reporter"
  reporter << Minitest::Distributed::Reporters::TestOrderReporter.new(options[:io], options)
end

.plugin_test_order_options(opts, options) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/minitest/test_order_plugin.rb', line 6

def plugin_test_order_options(opts, options)
  options[:test_order_file] = ENV["MINITEST_TEST_ORDER"]

  opts.on("--test_order=PATH", "Log order of tests executed to provided file.") do |path|
    options[:test_order_file] = path
  end
end