Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions civisibility/civisibility.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ const (
var DefaultTraceAgentUDSPath = "/var/run/datadog/apm.socket"

var (
status atomic.Int32
isTestMode atomic.Bool
status atomic.Int32
)

func GetState() State {
Expand All @@ -48,14 +47,6 @@ func SetState(state State) {
status.Store(int32(state))
}

func SetTestMode() {
isTestMode.Store(true)
}

func IsTestMode() bool {
return isTestMode.Load()
}

// AgentURLFromEnv resolves the URL for the trace agent based on
// the default host/port and UDS path, and via standard environment variables.
// AgentURLFromEnv has the following priority order:
Expand Down
57 changes: 19 additions & 38 deletions civisibility/constants/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,37 @@
package constants

const (
// CIVisibilityEnabledEnvironmentVariable indicates if CI Visibility mode is enabled.
// This environment variable should be set to "1" or "true" to enable CI Visibility mode, which activates tracing and other
// features related to CI Visibility in the Datadog platform.
CIVisibilityEnabledEnvironmentVariable = "DD_CIVISIBILITY_ENABLED"
// TestOptimizationEnabledEnvironmentVariable indicates if Test Optimization mode is enabled.
// This environment variable should be set to "1" or "true" to enable Test Optimization mode.
TestOptimizationEnabledEnvironmentVariable = "DD_CIVISIBILITY_ENABLED"

// CIVisibilityAgentlessEnabledEnvironmentVariable indicates if CI Visibility agentless mode is enabled.
// This environment variable should be set to "1" or "true" to enable agentless mode for CI Visibility, where traces
// TestOptimizationAgentlessEnabledEnvironmentVariable indicates if Test Optimization agentless mode is enabled.
// This environment variable should be set to "1" or "true" to enable agentless mode for Test Optimization, where traces
// are sent directly to Datadog without using a local agent.
CIVisibilityAgentlessEnabledEnvironmentVariable = "DD_CIVISIBILITY_AGENTLESS_ENABLED"
TestOptimizationAgentlessEnabledEnvironmentVariable = "DD_CIVISIBILITY_AGENTLESS_ENABLED"

// CIVisibilityAgentlessURLEnvironmentVariable forces the agentless URL to a custom one.
// This environment variable allows you to specify a custom URL for the agentless intake in CI Visibility mode.
CIVisibilityAgentlessURLEnvironmentVariable = "DD_CIVISIBILITY_AGENTLESS_URL"
// TestOptimizationAgentlessURLEnvironmentVariable forces the agentless URL to a custom one.
// This environment variable allows you to specify a custom URL for the agentless intake in Test Optimization mode.
TestOptimizationAgentlessURLEnvironmentVariable = "DD_CIVISIBILITY_AGENTLESS_URL"

// APIKeyEnvironmentVariable indicates the API key to be used for agentless intake.
// This environment variable should be set to your Datadog API key, allowing the agentless mode to authenticate and
// send data directly to the Datadog platform.
APIKeyEnvironmentVariable = "DD_API_KEY"

// CIVisibilityTestSessionNameEnvironmentVariable indicate the test session name to be used on CI Visibility payloads
CIVisibilityTestSessionNameEnvironmentVariable = "DD_TEST_SESSION_NAME"
// TestOptimizationTestSessionNameEnvironmentVariable indicates the test session name to be used on Test Optimization payloads.
TestOptimizationTestSessionNameEnvironmentVariable = "DD_TEST_SESSION_NAME"

// CIVisibilityFlakyRetryEnabledEnvironmentVariable kill-switch that allows to explicitly disable retries even if the remote setting is enabled.
// TestOptimizationFlakyRetryEnabledEnvironmentVariable kill-switch that allows to explicitly disable retries even if the remote setting is enabled.
// This environment variable should be set to "0" or "false" to disable the flaky retry feature.
CIVisibilityFlakyRetryEnabledEnvironmentVariable = "DD_CIVISIBILITY_FLAKY_RETRY_ENABLED"
TestOptimizationFlakyRetryEnabledEnvironmentVariable = "DD_CIVISIBILITY_FLAKY_RETRY_ENABLED"

// CIVisibilityFlakyRetryCountEnvironmentVariable indicates the maximum number of retry attempts for a single test case.
CIVisibilityFlakyRetryCountEnvironmentVariable = "DD_CIVISIBILITY_FLAKY_RETRY_COUNT"
// TestOptimizationManagementEnabledEnvironmentVariable indicates if the test management feature is enabled.
TestOptimizationManagementEnabledEnvironmentVariable = "DD_TEST_MANAGEMENT_ENABLED"

// CIVisibilityTotalFlakyRetryCountEnvironmentVariable indicates the maximum number of retry attempts for the entire session.
CIVisibilityTotalFlakyRetryCountEnvironmentVariable = "DD_CIVISIBILITY_TOTAL_FLAKY_RETRY_COUNT"
// TestOptimizationAttemptToFixRetriesEnvironmentVariable indicates the maximum number of retries for the attempt to fix a test.
TestOptimizationAttemptToFixRetriesEnvironmentVariable = "DD_TEST_MANAGEMENT_ATTEMPT_TO_FIX_RETRIES"

// CIVisibilityTestManagementEnabledEnvironmentVariable indicates if the test management feature is enabled.
CIVisibilityTestManagementEnabledEnvironmentVariable = "DD_TEST_MANAGEMENT_ENABLED"

// CIVisibilityTestManagementAttemptToFixRetriesEnvironmentVariable indicates the maximum number of retries for the attempt to fix a test.
CIVisibilityTestManagementAttemptToFixRetriesEnvironmentVariable = "DD_TEST_MANAGEMENT_ATTEMPT_TO_FIX_RETRIES"

// CIVisibilityAutoInstrumentationProviderEnvironmentVariable indicates that the auto-instrumentation script was used.
CIVisibilityAutoInstrumentationProviderEnvironmentVariable = "DD_CIVISIBILITY_AUTO_INSTRUMENTATION_PROVIDER"

// CIVisibilityEnvironmentDataFilePath is the environment variable that holds the path to the file containing the environmental data.
CIVisibilityEnvironmentDataFilePath = "DD_TEST_OPTIMIZATION_ENV_DATA_FILE"

// CIVisibilityImpactedTestsDetectionEnabled indicates if the impacted tests detection feature is enabled.
CIVisibilityImpactedTestsDetectionEnabled = "DD_CIVISIBILITY_IMPACTED_TESTS_DETECTION_ENABLED"

// CIVisibilityInternalParallelEarlyFlakeDetectionEnabled indicates if the internal parallel early flake detection feature is enabled.
CIVisibilityInternalParallelEarlyFlakeDetectionEnabled = "DD_CIVISIBILITY_INTERNAL_PARALLEL_EARLY_FLAKE_DETECTION_ENABLED"

// CIVisibilitySubtestFeaturesEnabled indicates if subtest-specific management and retry features are enabled.
CIVisibilitySubtestFeaturesEnabled = "DD_CIVISIBILITY_SUBTEST_FEATURES_ENABLED"
// TestOptimizationEnvironmentDataFilePath is the environment variable that holds the path to the file containing the environmental data.
TestOptimizationEnvironmentDataFilePath = "DD_TEST_OPTIMIZATION_ENV_DATA_FILE"
)
4 changes: 0 additions & 4 deletions civisibility/constants/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ const (
// This tag helps in identifying the source of the trace data.
Origin = "_dd.origin"

// LogicalCPUCores is a tag used to indicate the number of logical cpu cores
// This tag is used by the backend to perform calculations
LogicalCPUCores = "_dd.host.vcpu_count"

// CIAppTestOrigin defines the CIApp test origin value.
// This constant is used to tag traces that originate from CIApp test executions.
CIAppTestOrigin = "ciapp-test"
Expand Down
4 changes: 0 additions & 4 deletions civisibility/constants/test_tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ const (
// This constant is used to tag traces with the line number in the source file where the test ends.
TestSourceEndLine = "test.source.end"

// TestCodeOwners indicates the test code owners.
// This constant is used to tag traces with the code owners responsible for the test.
TestCodeOwners = "test.codeowners"

// TestCommand indicates the test command.
// This constant is used to tag traces with the command used to execute the test.
TestCommand = "test.command"
Expand Down
111 changes: 0 additions & 111 deletions civisibility/integrations/civisibility.go

This file was deleted.

Loading
Loading