lib/datadog/ci/contrib/cucumber/formatter.rb in datadog-ci-0.1.1 vs lib/datadog/ci/contrib/cucumber/formatter.rb in datadog-ci-0.2.0
- old
+ new
@@ -1,10 +1,8 @@
# frozen_string_literal: true
-require_relative "../../test"
-require_relative "../../ext/app_types"
-require_relative "../../ext/environment"
+require_relative "../../recorder"
require_relative "../../ext/test"
require_relative "ext"
module Datadog
module CI
@@ -28,11 +26,11 @@
config.on_event :test_step_started, &method(:on_test_step_started)
config.on_event :test_step_finished, &method(:on_test_step_finished)
end
def on_test_case_started(event)
- @current_feature_span = CI::Test.trace(
+ @current_feature_span = CI::Recorder.trace(
configuration[:operation_name],
{
span_options: {
resource: event.test_case.name,
service: configuration[:service_name]
@@ -48,15 +46,15 @@
def on_test_case_finished(event)
return if @current_feature_span.nil?
if event.result.skipped?
- CI::Test.skipped!(@current_feature_span)
+ CI::Recorder.skipped!(@current_feature_span)
elsif event.result.ok?
- CI::Test.passed!(@current_feature_span)
+ CI::Recorder.passed!(@current_feature_span)
elsif event.result.failed?
- CI::Test.failed!(@current_feature_span)
+ CI::Recorder.failed!(@current_feature_span)
end
@current_feature_span.finish
end
@@ -70,14 +68,14 @@
def on_test_step_finished(event)
return if @current_step_span.nil?
if event.result.skipped?
- CI::Test.skipped!(@current_step_span, event.result.exception)
+ CI::Recorder.skipped!(@current_step_span, event.result.exception)
elsif event.result.ok?
- CI::Test.passed!(@current_step_span)
+ CI::Recorder.passed!(@current_step_span)
elsif event.result.failed?
- CI::Test.failed!(@current_step_span, event.result.exception)
+ CI::Recorder.failed!(@current_step_span, event.result.exception)
end
@current_step_span.finish
end