MCPcopy Index your code
hub / github.com/docker/docker-agent / TestGetTelemetryEnabled

Function TestGetTelemetryEnabled

pkg/telemetry/telemetry_test.go:229–237  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

227}
228
229func TestGetTelemetryEnabled(t *testing.T) {
230 // When running under 'go test', GetTelemetryEnabled() always returns false
231 // because flag.Lookup("test.v") is set. This test verifies that behavior.
232 assert.False(t, GetTelemetryEnabled(), "Expected telemetry to be disabled during tests")
233
234 // Even with TELEMETRY_ENABLED=true, telemetry is disabled during tests
235 t.Setenv("TELEMETRY_ENABLED", "true")
236 assert.False(t, GetTelemetryEnabled(), "Expected telemetry to be disabled during tests even with TELEMETRY_ENABLED=true")
237}
238
239func TestGetTelemetryEnabledFromEnv(t *testing.T) {
240 // Test the environment variable logic directly (bypassing test detection)

Callers

nothing calls this directly

Calls 1

GetTelemetryEnabledFunction · 0.85

Tested by

no test coverage detected