Module: Datadog::CI::Contrib::Simplecov::ResultExtractor::ClassMethods

Defined in:
lib/datadog/ci/contrib/simplecov/result_extractor.rb

Instance Method Summary collapse

Instance Method Details

#__dd_peek_resultObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/datadog/ci/contrib/simplecov/result_extractor.rb', line 15

def __dd_peek_result
  unless datadog_configuration[:enabled]
    Datadog.logger.debug("SimpleCov instrumentation is disabled")
    return nil
  end

  result = ::SimpleCov::UselessResultsRemover.call(
    ::SimpleCov::ResultAdapter.call(::Coverage.peek_result)
  )

  # SimpleCov 1.0 changed add_not_loaded_files to return a
  # [coverage, not_loaded_files] tuple instead of a coverage hash.
  processed = add_not_loaded_files(result)
  if processed.is_a?(::Array)
    coverage, not_loaded_files = processed
    ::SimpleCov::Result.new(coverage, not_loaded_files: not_loaded_files)
  else
    ::SimpleCov::Result.new(processed)
  end
end

#datadog_configurationObject



36
37
38
# File 'lib/datadog/ci/contrib/simplecov/result_extractor.rb', line 36

def datadog_configuration
  Datadog.configuration.ci[:simplecov]
end