Skip to content

Commit

Permalink
add known_tests_enabled? to LibrarySettings
Browse files Browse the repository at this point in the history
  • Loading branch information
anmarchenko committed Jan 30, 2025
1 parent deb627e commit 72d0f32
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/datadog/ci/ext/transport.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ module Transport
DD_API_SETTINGS_RESPONSE_TESTS_SKIPPING_KEY = "tests_skipping"
DD_API_SETTINGS_RESPONSE_REQUIRE_GIT_KEY = "require_git"
DD_API_SETTINGS_RESPONSE_FLAKY_TEST_RETRIES_KEY = "flaky_test_retries_enabled"
DD_API_SETTINGS_RESPONSE_KNOWN_TESTS_ENABLED_KEY = "known_tests_enabled"
DD_API_SETTINGS_RESPONSE_EARLY_FLAKE_DETECTION_KEY = "early_flake_detection"
DD_API_SETTINGS_RESPONSE_ENABLED_KEY = "enabled"
DD_API_SETTINGS_RESPONSE_SLOW_TEST_RETRIES_KEY = "slow_test_retries"
Expand Down
8 changes: 8 additions & 0 deletions lib/datadog/ci/remote/library_settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ def early_flake_detection_enabled?
)
end

def known_tests_enabled?
return @known_tests_enabled if defined?(@known_tests_enabled)

@known_tests_enabled = Utils::Parsing.convert_to_bool(
payload.fetch(Ext::Transport::DD_API_SETTINGS_RESPONSE_KNOWN_TESTS_ENABLED_KEY, false)
)
end

def slow_test_retries
return @slow_test_retries if defined?(@slow_test_retries)

Expand Down
2 changes: 2 additions & 0 deletions sig/datadog/ci/ext/transport.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ module Datadog

DD_API_SETTINGS_RESPONSE_FLAKY_TEST_RETRIES_KEY: "flaky_test_retries_enabled"

DD_API_SETTINGS_RESPONSE_KNOWN_TESTS_ENABLED_KEY: "known_tests_enabled"

DD_API_SETTINGS_RESPONSE_EARLY_FLAKE_DETECTION_KEY: "early_flake_detection"

DD_API_SETTINGS_RESPONSE_ENABLED_KEY: "enabled"
Expand Down
3 changes: 3 additions & 0 deletions sig/datadog/ci/remote/library_settings.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module Datadog
@tests_skipping_enabled: bool
@flaky_test_retries_enabled: bool
@early_flake_detection_enabled: bool
@known_tests_enabled: bool
@slow_test_retries: Datadog::CI::Remote::SlowTestRetries
@faulty_session_threshold: Integer

Expand All @@ -32,6 +33,8 @@ module Datadog

def early_flake_detection_enabled?: () -> bool

def known_tests_enabled?: () -> bool

def slow_test_retries: () -> Datadog::CI::Remote::SlowTestRetries

def faulty_session_threshold: () -> Integer
Expand Down

0 comments on commit 72d0f32

Please sign in to comment.