Skip to content

Commit 6dbc6b9

Browse files
committed
fixed failing UT
1 parent 16f5a3c commit 6dbc6b9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

internal/collector/otel_collector_plugin_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -794,11 +794,11 @@ func Test_setProxyEnvs(t *testing.T) {
794794
msg := "Setting test proxy"
795795

796796
// Unset first to ensure clean state
797-
_ = os.Unsetenv("HTTP_PROXY")
797+
_ = os.Unsetenv("HTTPS_PROXY")
798798

799799
setProxyEnvs(ctx, proxyURL, msg)
800800

801-
httpProxy := os.Getenv("HTTP_PROXY")
801+
httpProxy := os.Getenv("HTTPS_PROXY")
802802
assert.Equal(t, proxyURL, httpProxy)
803803
}
804804

@@ -812,12 +812,12 @@ func Test_setProxyWithBasicAuth(t *testing.T) {
812812
}
813813

814814
// Unset first to ensure clean state
815-
_ = os.Unsetenv("HTTP_PROXY")
815+
_ = os.Unsetenv("HTTPS_PROXY")
816816

817817
setProxyWithBasicAuth(ctx, proxy, u)
818818

819819
proxyURL := u.String()
820-
httpProxy := os.Getenv("HTTP_PROXY")
820+
httpProxy := os.Getenv("HTTPS_PROXY")
821821
assert.Equal(t, proxyURL, httpProxy)
822822

823823
// Test missing username/password
@@ -878,7 +878,7 @@ func TestSetExporterProxyEnvVars(t *testing.T) {
878878
t.Run(tt.name, func(t *testing.T) {
879879
logBuf.Reset()
880880

881-
_ = os.Unsetenv("HTTP_PROXY")
881+
_ = os.Unsetenv("HTTPS_PROXY")
882882

883883
tmpDir := t.TempDir()
884884
cfg := types.OTelConfig(t)
@@ -889,7 +889,7 @@ func TestSetExporterProxyEnvVars(t *testing.T) {
889889
// added this check to prevent the panic error in UT.
890890
if cfg.Command.Server.Proxy == nil {
891891
// For the nil proxy case, we expect nothing to happen.
892-
assert.Empty(t, os.Getenv("HTTP_PROXY"))
892+
assert.Empty(t, os.Getenv("HTTPS_PROXY"))
893893

894894
return
895895
}
@@ -902,9 +902,9 @@ func TestSetExporterProxyEnvVars(t *testing.T) {
902902
helpers.ValidateLog(t, tt.expectedLog, logBuf)
903903

904904
if tt.setEnv {
905-
assert.NotEmpty(t, os.Getenv("HTTP_PROXY"))
905+
assert.NotEmpty(t, os.Getenv("HTTPS_PROXY"))
906906
} else {
907-
assert.Empty(t, os.Getenv("HTTP_PROXY"))
907+
assert.Empty(t, os.Getenv("HTTPS_PROXY"))
908908
}
909909
})
910910
}

0 commit comments

Comments
 (0)