From 50ba1559ef9cdf931d79c1edd6a5ce97bdaeeebb Mon Sep 17 00:00:00 2001 From: Andrey Date: Thu, 30 Jan 2025 16:25:10 +0100 Subject: [PATCH] add "known_tests" telemetry tag for settings response metric --- lib/datadog/ci/ext/telemetry.rb | 1 + lib/datadog/ci/remote/library_settings_client.rb | 3 ++- sig/datadog/ci/ext/telemetry.rbs | 2 ++ spec/datadog/ci/remote/library_settings_client_spec.rb | 3 +++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/datadog/ci/ext/telemetry.rb b/lib/datadog/ci/ext/telemetry.rb index 1e38de1c..b108ee3a 100644 --- a/lib/datadog/ci/ext/telemetry.rb +++ b/lib/datadog/ci/ext/telemetry.rb @@ -86,6 +86,7 @@ module Telemetry TAG_REQUIRE_GIT = "require_git" TAG_EARLY_FLAKE_DETECTION_ENABLED = "early_flake_detection_enabled" TAG_FLAKY_TEST_RETRIES_ENABLED = "flaky_test_retries_enabled" + TAG_KNOWN_TESTS_ENABLED = "known_tests_enabled" # tags for test_session metric TAG_PROVIDER = "provider" TAG_AUTO_INJECTED = "auto_injected" diff --git a/lib/datadog/ci/remote/library_settings_client.rb b/lib/datadog/ci/remote/library_settings_client.rb index 12dfa476..196cb682 100644 --- a/lib/datadog/ci/remote/library_settings_client.rb +++ b/lib/datadog/ci/remote/library_settings_client.rb @@ -62,7 +62,8 @@ def fetch(test_session) Ext::Telemetry::TAG_EARLY_FLAKE_DETECTION_ENABLED => library_settings.early_flake_detection_enabled?.to_s, Ext::Telemetry::TAG_FLAKY_TEST_RETRIES_ENABLED => library_settings.flaky_test_retries_enabled?.to_s, Ext::Telemetry::TAG_ITR_ENABLED => library_settings.itr_enabled?.to_s, - Ext::Telemetry::TAG_REQUIRE_GIT => library_settings.require_git?.to_s + Ext::Telemetry::TAG_REQUIRE_GIT => library_settings.require_git?.to_s, + Ext::Telemetry::TAG_KNOWN_TESTS_ENABLED => library_settings.known_tests_enabled?.to_s } ) diff --git a/sig/datadog/ci/ext/telemetry.rbs b/sig/datadog/ci/ext/telemetry.rbs index 9ef2fd3c..229b49ed 100644 --- a/sig/datadog/ci/ext/telemetry.rbs +++ b/sig/datadog/ci/ext/telemetry.rbs @@ -136,6 +136,8 @@ module Datadog TAG_FLAKY_TEST_RETRIES_ENABLED: "flaky_test_retries_enabled" + TAG_KNOWN_TESTS_ENABLED: "known_tests_enabled" + TAG_EARLY_FLAKE_DETECTION_ABORT_REASON: "early_flake_detection_abort_reason" TAG_PROVIDER: "provider" diff --git a/spec/datadog/ci/remote/library_settings_client_spec.rb b/spec/datadog/ci/remote/library_settings_client_spec.rb index 5d3fa946..9984c988 100644 --- a/spec/datadog/ci/remote/library_settings_client_spec.rb +++ b/spec/datadog/ci/remote/library_settings_client_spec.rb @@ -43,6 +43,7 @@ "itr_enabled" => "True", "require_git" => require_git, "flaky_test_retries_enabled" => "true", + "known_tests_enabled" => "true", "early_flake_detection" => { "enabled" => "true", "slow_test_retries" => { @@ -115,6 +116,7 @@ expect(response.tests_skipping_enabled?).to be false expect(response.flaky_test_retries_enabled?).to be true expect(response.early_flake_detection_enabled?).to be true + expect(response.known_tests_enabled?).to be true expect(response.slow_test_retries.entries).to eq( [ Datadog::CI::Remote::SlowTestRetries::Entry.new(5.0, 10), @@ -132,6 +134,7 @@ "itrskip_enabled" => "false", "early_flake_detection_enabled" => "true", "flaky_test_retries_enabled" => "true", + "known_tests_enabled" => "true", "require_git" => "false" ) end