Skip to content

Commit

Permalink
internal/civisibility: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyredondo committed Oct 2, 2024
1 parent b6cc458 commit 868acf4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions internal/civisibility/integrations/civisibility_features.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ func ensureAdditionalFeaturesInitialization(serviceName string) {
additionalFeaturesInitializationOnce.Do(func() {
// Create the CI Visibility client
ciVisibilityClient = net.NewClientWithServiceName(serviceName)
if ciVisibilityClient == nil {
log.Error("CI Visibility: error getting the ci visibility http client")
return
}

// Get the CI Visibility settings payload for this test session
ciSettings, err := ciVisibilityClient.GetSettings()
Expand Down
3 changes: 2 additions & 1 deletion internal/civisibility/integrations/gotesting/testing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ func TestMain(m *testing.M) {

// set the custom agentless url and the flaky retry count env-var
fmt.Printf("Using mockapi at: %s\n", server.URL)
os.Setenv(constants.CIVisibilityAgentlessEnabledEnvironmentVariable, "true")
os.Setenv(constants.CIVisibilityAgentlessEnabledEnvironmentVariable, "1")
os.Setenv(constants.CIVisibilityAgentlessURLEnvironmentVariable, server.URL)
os.Setenv(constants.APIKeyEnvironmentVariable, "12345")
os.Setenv(constants.CIVisibilityFlakyRetryCountEnvironmentVariable, "10")

// initialize the mock tracer for doing assertions on the finished spans
Expand Down

0 comments on commit 868acf4

Please sign in to comment.