Skip to content

Commit

Permalink
Skip test case for sequoia (#42996)
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-gr authored Mar 5, 2025
1 parent 2050421 commit 1854bba
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion x-pack/filebeat/input/unifiedlogs/input_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func TestInput(t *testing.T) {

testCases := []struct {
name string
skip func(*testing.T) bool
cfg config
timeUntilClose time.Duration
assertFunc func(collect *assert.CollectT, events []beat.Event, cursors []*time.Time)
Expand Down Expand Up @@ -139,6 +140,19 @@ func TestInput(t *testing.T) {
},
{
name: "With end date",
skip: func(t *testing.T) bool {
const sequoiaPrefix = "15."
version, err := exec.Command("sw_vers", "-productVersion").CombinedOutput()
if err != nil {
t.Fatalf("failed to get macOS version: %v", err)
return true
}
if strings.HasPrefix(strings.TrimSpace(string(version)), sequoiaPrefix) {
t.Skip("macOS 15.x does not support the --end flag correctly")
return true
}
return false
},
cfg: config{
ShowConfig: showConfig{
ArchiveFile: archivePath,
Expand All @@ -147,7 +161,7 @@ func TestInput(t *testing.T) {
},
timeUntilClose: time.Second,
expectedLogShowCmd: fmt.Sprintf("/usr/bin/log show --style ndjson --archive %s --end 2024-12-04 13:46:00+0200", archivePath),
assertFunc: eventsAndCursorAssertN(462),
assertFunc: eventsAndCursorAssertN(149),
},
{
name: "With predicate",
Expand Down Expand Up @@ -204,6 +218,9 @@ func TestInput(t *testing.T) {
for _, tc := range testCases {
tc := tc
t.Run(tc.name, func(t *testing.T) {
if tc.skip != nil && tc.skip(t) {
return
}
_, cursorInput := newCursorInput(tc.cfg)
input := cursorInput.(*input)

Expand Down

0 comments on commit 1854bba

Please sign in to comment.