diff --git a/lib/datadog/ci.rb b/lib/datadog/ci.rb index e14f6c96..bede82c0 100644 --- a/lib/datadog/ci.rb +++ b/lib/datadog/ci.rb @@ -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: diff --git a/lib/datadog/ci/recorder.rb b/lib/datadog/ci/recorder.rb index 3fae5f14..2952fbfb 100644 --- a/lib/datadog/ci/recorder.rb +++ b/lib/datadog/ci/recorder.rb @@ -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 @@ -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