Skip to content

Commit

Permalink
AMLII-2065 remove bogus test (#29951)
Browse files Browse the repository at this point in the history
  • Loading branch information
vickenty authored Oct 11, 2024
1 parent 30bb5fe commit bf312f3
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions pkg/collector/check/stats/stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ package stats
import (
"net/http"
"net/http/httptest"
"os"
"runtime"
"testing"
"time"

Expand Down Expand Up @@ -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())
Expand Down

0 comments on commit bf312f3

Please sign in to comment.