Skip to content

Commit

Permalink
always store ID tags as string explicitly as tracing logic to split t…
Browse files Browse the repository at this point in the history
…ags and metrics is flaky
  • Loading branch information
anmarchenko committed Dec 4, 2023
1 parent c7e3aa0 commit 469efb7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions lib/datadog/ci.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ module Datadog
module CI
class << self
# Starts a {Datadog::CI::TestSesstion ci_test_session} that represents the whole test session run.
#
# Read Datadog documentation on test sessions
# [here](https://docs.datadoghq.com/continuous_integration/explorer/?tab=testruns#sessions).
#
# Raises an error if a session is already active.
#
# The {#start_test_session} method is used to mark the start of the test session:
Expand Down
6 changes: 3 additions & 3 deletions lib/datadog/ci/recorder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,13 @@ def set_initial_tags(ci_span, tags)

def set_session_context(tags, test_session = nil)
test_session ||= active_test_session
tags[Ext::Test::TAG_TEST_SESSION_ID] = test_session.id if test_session
tags[Ext::Test::TAG_TEST_SESSION_ID] = test_session.id.to_s if test_session
end

def set_module_context(tags, test_module = nil)
test_module ||= active_test_module
if test_module
tags[Ext::Test::TAG_TEST_MODULE_ID] = test_module.id
tags[Ext::Test::TAG_TEST_MODULE_ID] = test_module.id.to_s
tags[Ext::Test::TAG_MODULE] = test_module.name
end
end
Expand All @@ -259,7 +259,7 @@ def set_suite_context(tags, span: nil, name: nil)
test_suite = span || active_test_suite(name)

if test_suite
tags[Ext::Test::TAG_TEST_SUITE_ID] = test_suite.id
tags[Ext::Test::TAG_TEST_SUITE_ID] = test_suite.id.to_s
tags[Ext::Test::TAG_SUITE] = test_suite.name
else
tags[Ext::Test::TAG_SUITE] = name
Expand Down

0 comments on commit 469efb7

Please sign in to comment.