Skip to content

Commit

Permalink
[v2] internal/civisibility: Add auto test retries telemetry metric (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyredondo authored Dec 12, 2024
1 parent b5a98c3 commit 9e02ac3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions internal/civisibility/utils/net/settings_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ func (c *client) GetSettings() (*SettingsResponseData, error) {
if responseObject.Data.Attributes.EarlyFlakeDetection.Enabled {
settingsResponseType = append(settingsResponseType, telemetry.EfdEnabledSettingsResponseType...)
}
if responseObject.Data.Attributes.FlakyTestRetriesEnabled {
settingsResponseType = append(settingsResponseType, telemetry.FlakyTestRetriesEnabledSettingsResponseType...)
}
telemetry.GitRequestsSettingsResponse(settingsResponseType)
return &responseObject.Data.Attributes, nil
}
7 changes: 4 additions & 3 deletions internal/civisibility/utils/telemetry/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,10 @@ const (
type SettingsResponseType []string

var (
CoverageEnabledSettingsResponseType SettingsResponseType = []string{"coverage_enabled"}
ItrSkipEnabledSettingsResponseType SettingsResponseType = []string{"itrskip_enabled"}
EfdEnabledSettingsResponseType SettingsResponseType = []string{"early_flake_detection_enabled:true"}
CoverageEnabledSettingsResponseType SettingsResponseType = []string{"coverage_enabled"}
ItrSkipEnabledSettingsResponseType SettingsResponseType = []string{"itrskip_enabled"}
EfdEnabledSettingsResponseType SettingsResponseType = []string{"early_flake_detection_enabled:true"}
FlakyTestRetriesEnabledSettingsResponseType SettingsResponseType = []string{"flaky_test_retries_enabled:true"}
)

// removeEmptyStrings removes empty string values inside an array or use the same if not empty string is found.
Expand Down

0 comments on commit 9e02ac3

Please sign in to comment.