diff --git a/lib/datadog/ci/contrib/cucumber/formatter.rb b/lib/datadog/ci/contrib/cucumber/formatter.rb index 1ab2e4e1..885534ef 100644 --- a/lib/datadog/ci/contrib/cucumber/formatter.rb +++ b/lib/datadog/ci/contrib/cucumber/formatter.rb @@ -34,14 +34,14 @@ def bind_events(config) end def on_test_run_started(event) - test_session = CI.start_test_session( + CI.start_test_session( tags: { CI::Ext::Test::TAG_FRAMEWORK => Ext::FRAMEWORK, CI::Ext::Test::TAG_FRAMEWORK_VERSION => CI::Contrib::Cucumber::Integration.version.to_s }, service: configuration[:service_name] ) - CI.start_test_module(test_session.name) if test_session + CI.start_test_module(Ext::FRAMEWORK) end def on_test_run_finished(event) diff --git a/lib/datadog/ci/contrib/minitest/runner.rb b/lib/datadog/ci/contrib/minitest/runner.rb index f4ebbcad..cc65f276 100644 --- a/lib/datadog/ci/contrib/minitest/runner.rb +++ b/lib/datadog/ci/contrib/minitest/runner.rb @@ -18,14 +18,14 @@ def init_plugins(*) return unless datadog_configuration[:enabled] - test_session = CI.start_test_session( + CI.start_test_session( tags: { CI::Ext::Test::TAG_FRAMEWORK => Ext::FRAMEWORK, CI::Ext::Test::TAG_FRAMEWORK_VERSION => CI::Contrib::Minitest::Integration.version.to_s }, service: datadog_configuration[:service_name] ) - CI.start_test_module(test_session.name) if test_session + CI.start_test_module(Ext::FRAMEWORK) end private diff --git a/lib/datadog/ci/contrib/rspec/runner.rb b/lib/datadog/ci/contrib/rspec/runner.rb index b9aed9c1..29d4c692 100644 --- a/lib/datadog/ci/contrib/rspec/runner.rb +++ b/lib/datadog/ci/contrib/rspec/runner.rb @@ -25,13 +25,12 @@ def run_specs(*) service: datadog_configuration[:service_name] ) - test_module = CI.start_test_module(test_session.name) if test_session + test_module = CI.start_test_module(Ext::FRAMEWORK) result = super return result unless test_module && test_session if result != 0 - # TODO: repeating this twice feels clunky, we need to remove test_module API before GA test_module.failed! test_session.failed! else diff --git a/spec/datadog/ci/contrib/cucumber/instrumentation_spec.rb b/spec/datadog/ci/contrib/cucumber/instrumentation_spec.rb index 581e40aa..b4099f2a 100644 --- a/spec/datadog/ci/contrib/cucumber/instrumentation_spec.rb +++ b/spec/datadog/ci/contrib/cucumber/instrumentation_spec.rb @@ -145,7 +145,7 @@ it "creates test module span" do expect(test_module_span).not_to be_nil - expect(test_module_span.name).to eq(test_command) + expect(test_module_span.name).to eq("cucumber") expect(test_module_span.service).to eq("jalapenos") expect(test_module_span).to have_test_tag(:span_kind, "test") expect(test_module_span).to have_test_tag(:framework, "cucumber") @@ -171,7 +171,7 @@ it "connects test span to test session, test module, and test suite" do expect(first_test_span).to have_test_tag(:test_module_id, test_module_span.id.to_s) - expect(first_test_span).to have_test_tag(:module, test_command) + expect(first_test_span).to have_test_tag(:module, "cucumber") expect(first_test_span).to have_test_tag(:test_session_id, test_session_span.id.to_s) expect(first_test_span).to have_test_tag(:test_suite_id, first_test_suite_span.id.to_s) expect(first_test_span).to have_test_tag(:suite, first_test_suite_span.name) diff --git a/spec/datadog/ci/contrib/minitest/instrumentation_spec.rb b/spec/datadog/ci/contrib/minitest/instrumentation_spec.rb index c3e019dc..b92e2492 100644 --- a/spec/datadog/ci/contrib/minitest/instrumentation_spec.rb +++ b/spec/datadog/ci/contrib/minitest/instrumentation_spec.rb @@ -425,7 +425,7 @@ def test_pass_other expect(test_module_span).not_to be_nil expect(test_module_span.type).to eq("test_module_end") - expect(test_module_span.name).to eq(test_command) + expect(test_module_span.name).to eq("minitest") expect(test_module_span).to have_test_tag(:span_kind, "test") expect(test_module_span).to have_test_tag(:framework, "minitest") diff --git a/spec/datadog/ci/contrib/rspec/instrumentation_spec.rb b/spec/datadog/ci/contrib/rspec/instrumentation_spec.rb index 83d23894..2337400c 100644 --- a/spec/datadog/ci/contrib/rspec/instrumentation_spec.rb +++ b/spec/datadog/ci/contrib/rspec/instrumentation_spec.rb @@ -469,7 +469,7 @@ def rspec_session_run(with_failed_test: false, with_shared_test: false) expect(test_module_span).not_to be_nil expect(test_module_span.type).to eq("test_module_end") - expect(test_module_span.name).to eq(test_command) + expect(test_module_span.name).to eq("rspec") expect(test_module_span).to have_test_tag(:span_kind, "test") expect(test_module_span).to have_test_tag(:framework, "rspec")