Module: Datadog::CI::Contrib::Minitest::Runner::ClassMethods

Defined in:
lib/datadog/ci/contrib/minitest/runner.rb

Instance Method Summary collapse

Instance Method Details

#init_plugins(*args) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/datadog/ci/contrib/minitest/runner.rb', line 19

def init_plugins(*args)
  super

  return unless datadog_configuration[:enabled]

  # minitest does not store the total number of tests, so we can't pass it to the test session
  # instead, we use the number of test suites * DD_ESTIMATED_TESTS_PER_SUITE as a rough estimate
  test_visibility_component.start_test_session(
    tags: {
      CI::Ext::Test::TAG_FRAMEWORK => Ext::FRAMEWORK,
      CI::Ext::Test::TAG_FRAMEWORK_VERSION => datadog_integration.version.to_s
    },
    service: datadog_configuration[:service_name],
    total_tests_count: (DD_ESTIMATED_TESTS_PER_SUITE * ::Minitest::Runnable.runnables.size).to_i
  )
  test_visibility_component.start_test_module(Ext::FRAMEWORK)
end

#run_one_method(klass, method_name) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
# File 'lib/datadog/ci/contrib/minitest/runner.rb', line 37

def run_one_method(klass, method_name)
  return super unless datadog_configuration[:enabled]

  result = nil

  test_retries_component.with_retries do
    result = super
  end

  result
end