Skip to content

Commit

Permalink
move test_suite param back to tags
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Nov 1, 2023
1 parent 3ceada4 commit 12e04e4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions lib/datadog/ci.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ module Datadog
module CI
module_function

def trace_test(test_name, test_suite, service_name, operation_name, tags = {})
def trace_test(test_name, service_name, operation_name, tags = {})
span_options = {
resource: test_name,
service: service_name
}

tags[:test_name] = test_name
tags[:test_suite] = test_suite
tags[:span_options] = span_options

if block_given?
Expand Down
4 changes: 2 additions & 2 deletions lib/datadog/ci/contrib/cucumber/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ def bind_events(config)
def on_test_case_started(event)
@current_feature_span = CI.trace_test(
event.test_case.name,
event.test_case.location.file,
configuration[:service_name],
configuration[:operation_name],
{
framework: Ext::FRAMEWORK,
framework_version: CI::Contrib::Cucumber::Integration.version.to_s,
test_type: Ext::TEST_TYPE
test_type: Ext::TEST_TYPE,
test_suite: event.test_case.location.file
}
)
end
Expand Down
4 changes: 2 additions & 2 deletions lib/datadog/ci/contrib/minitest/hooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ def before_setup

test_span = CI.trace_test(
test_name,
test_suite,
configuration[:service_name],
configuration[:operation_name],
{
framework: Ext::FRAMEWORK,
framework_version: CI::Contrib::Minitest::Integration.version.to_s,
test_type: Ext::TEST_TYPE
test_type: Ext::TEST_TYPE,
test_suite: test_suite
}
)

Expand Down
4 changes: 2 additions & 2 deletions lib/datadog/ci/contrib/rspec/example.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ def run(example_group_instance, reporter)

CI.trace_test(
test_name,
metadata[:example_group][:file_path],
configuration[:service_name],
configuration[:operation_name],
{
framework: Ext::FRAMEWORK,
framework_version: CI::Contrib::RSpec::Integration.version.to_s,
test_type: Ext::TEST_TYPE
test_type: Ext::TEST_TYPE,
test_suite: metadata[:example_group][:file_path]
}
) do |test_span|
result = super
Expand Down
4 changes: 2 additions & 2 deletions spec/support/tracer_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ def produce_test_trace(

Datadog::CI.trace_test(
test_name,
test_suite,
service,
operation,
{
framework: framework,
framework_version: "1.0.0",
test_type: "test"
test_type: "test",
test_suite: test_suite
}
) do |test|
if with_http_span
Expand Down

0 comments on commit 12e04e4

Please sign in to comment.