From bf312f305a20d939a693783a86158b618a95fca9 Mon Sep 17 00:00:00 2001 From: Vickenty Fesunov Date: Fri, 11 Oct 2024 19:05:20 +0200 Subject: [PATCH] AMLII-2065 remove bogus test (#29951) --- pkg/collector/check/stats/stats_test.go | 27 +------------------------ 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/pkg/collector/check/stats/stats_test.go b/pkg/collector/check/stats/stats_test.go index 37f9bf62871a2f..436a55cc9f4775 100644 --- a/pkg/collector/check/stats/stats_test.go +++ b/pkg/collector/check/stats/stats_test.go @@ -8,8 +8,6 @@ package stats import ( "net/http" "net/http/httptest" - "os" - "runtime" "testing" "time" @@ -79,31 +77,8 @@ func TestNewStats(t *testing.T) { assert.Equal(t, stats.Interval, 15*time.Second) } -func TestNewStatsStateTelemetryIgnoredWhenGloballyDisabled(t *testing.T) { - if os.Getenv("CI") == "true" && runtime.GOOS == "darwin" { - t.Skip("TestNewStatsStateTelemetryIgnoredWhenGloballyDisabled is known to fail on the macOS Gitlab runners because of the already running Agent") - } - mockConfig := configmock.New(t) - mockConfig.SetWithoutSource("agent_telemetry.enabled", false) - mockConfig.SetWithoutSource("telemetry.enabled", false) - mockConfig.SetWithoutSource("telemetry.checks", "*") - - NewStats(newMockCheck()) - - tlmData, err := getTelemetryData() - if !assert.NoError(t, err) { - return - } - - // Assert that no telemetry is recorded - assert.NotContains(t, tlmData, "checkString") - assert.NotContains(t, tlmData, "state=\"fail\"") - assert.NotContains(t, tlmData, "state=\"ok\"") -} - -func TestNewStatsStateTelemetryInitializedWhenGloballyEnabled(t *testing.T) { +func TestNewStatsStateTelemetryInitialized(t *testing.T) { mockConfig := configmock.New(t) - mockConfig.SetWithoutSource("telemetry.enabled", true) mockConfig.SetWithoutSource("telemetry.checks", "*") NewStats(newMockCheck())