diff --git a/spec/datadog/ci/test_visibility/serializers/span_spec.rb b/spec/datadog/ci/test_visibility/serializers/span_spec.rb index b50060cc..97cd6e71 100644 --- a/spec/datadog/ci/test_visibility/serializers/span_spec.rb +++ b/spec/datadog/ci/test_visibility/serializers/span_spec.rb @@ -45,6 +45,7 @@ "_dd.origin" => "ciapp-test" } ) + expect(metrics).to eq({"_dd.top_level" => 1.0, "custom_metric" => 42}) # TODO: test start and duration with timecop # expect(content["start"]).to eq(1) # expect(content["duration"]).to eq(1) diff --git a/spec/datadog/ci/test_visibility/serializers/test_v1_spec.rb b/spec/datadog/ci/test_visibility/serializers/test_v1_spec.rb index 5fba31e0..7dc952ba 100644 --- a/spec/datadog/ci/test_visibility/serializers/test_v1_spec.rb +++ b/spec/datadog/ci/test_visibility/serializers/test_v1_spec.rb @@ -34,9 +34,13 @@ { "test.framework" => "rspec", "test.status" => "pass", - "_dd.origin" => "ciapp-test" + "_dd.origin" => "ciapp-test", + "test_owner" => "my_team" } ) + expect(metrics).to eq( + {"_dd.measured" => 1.0, "_dd.top_level" => 1.0, "memory_allocations" => 16} + ) # TODO: test start and duration with timecop # expect(content["start"]).to eq(1) # expect(content["duration"]).to eq(1) diff --git a/spec/support/tracer_helpers.rb b/spec/support/tracer_helpers.rb index d81ed861..2c9707d8 100644 --- a/spec/support/tracer_helpers.rb +++ b/spec/support/tracer_helpers.rb @@ -31,9 +31,13 @@ def produce_test_trace( if with_http_span Datadog::Tracing.trace("http-call", type: "http", service: "net-http") do |span, trace| span.set_tag("custom_tag", "custom_tag_value") + span.set_tag("custom_metric", 42) end end + Datadog::Tracing.active_span.set_tag("test_owner", "my_team") + Datadog::Tracing.active_span.set_metric("memory_allocations", 16) + case result when "FAILED" Datadog::CI::Recorder.failed!(span, exception)