Class: GitlabQuality::TestTooling::TestMetricsExporter::Formatter

Inherits:
RSpec::Core::Formatters::BaseFormatter
  • Object
show all
Defined in:
lib/gitlab_quality/test_tooling/test_metrics_exporter/formatter.rb

Constant Summary collapse

LOG_PREFIX =
"[MetricsExporter]"

Instance Method Summary collapse

Instance Method Details

#stop(notification) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/gitlab_quality/test_tooling/test_metrics_exporter/formatter.rb', line 16

def stop(notification)
  logger.debug("#{LOG_PREFIX} Starting test metrics export")
  data = notification.examples.filter_map do |example|
    next if config.skip_record_proc.call(example)

    TestMetrics.new(example, time).data
  end
  return logger.warn("#{LOG_PREFIX} No test execution records found, metrics will not be exported!") if data.empty?

  push_to_observer(data)
end