Skip to content
Open
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
14 changes: 14 additions & 0 deletions cmd/otel-agent/config/agent_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ func (suite *ConfigTestSuite) SetupTest() {
configmock.New(suite.T())
suite.T().Setenv("DD_API_KEY", "")
suite.T().Setenv("DD_SITE", "")
// LoadProxyFromEnv treats a present-but-empty var as set, so these must be
// unset rather than set to "" - otherwise DD_PROXY_* short-circuits the
// HTTP_PROXY/HTTPS_PROXY/NO_PROXY fallback even when a test sets those.
// The lowercase variants are cleared too since LoadProxyFromEnv falls
// back to them when the uppercase ones aren't set.
os.Unsetenv("HTTP_PROXY")
os.Unsetenv("http_proxy")
os.Unsetenv("HTTPS_PROXY")
os.Unsetenv("https_proxy")
os.Unsetenv("NO_PROXY")
os.Unsetenv("no_proxy")
os.Unsetenv("DD_PROXY_HTTP")
os.Unsetenv("DD_PROXY_HTTPS")
os.Unsetenv("DD_PROXY_NO_PROXY")
}

func TestNoURIsProvided(t *testing.T) {
Expand Down
2 changes: 2 additions & 0 deletions cmd/serverless-init/mode/initcontainer_mode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ func TestJavaTracerIsAutoInstrumented(t *testing.T) {
fs := afero.NewMemMapFs()
fs.Create("/dd_tracer/java/")

t.Setenv("JAVA_TOOL_OPTIONS", "")

autoInstrumentTracer(fs)

assert.Equal(t, "-javaagent:/dd_tracer/java/dd-java-agent.jar", os.Getenv("JAVA_TOOL_OPTIONS"))
Expand Down
Loading