From 0af64239248c0d18b376e6a424bac7546e0428d6 Mon Sep 17 00:00:00 2001 From: Andrey Marchenko Date: Thu, 7 Mar 2024 12:17:07 +0100 Subject: [PATCH] fix test suite to reflect test module name changes --- lib/datadog/ci/contrib/rspec/runner.rb | 1 - spec/datadog/ci/contrib/cucumber/instrumentation_spec.rb | 4 ++-- spec/datadog/ci/contrib/minitest/instrumentation_spec.rb | 2 +- spec/datadog/ci/contrib/rspec/instrumentation_spec.rb | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/datadog/ci/contrib/rspec/runner.rb b/lib/datadog/ci/contrib/rspec/runner.rb index 1c8a1776..29d4c692 100644 --- a/lib/datadog/ci/contrib/rspec/runner.rb +++ b/lib/datadog/ci/contrib/rspec/runner.rb @@ -31,7 +31,6 @@ def run_specs(*) 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")