Skip to content

Commit

Permalink
Add mage target to test journald
Browse files Browse the repository at this point in the history
  • Loading branch information
belimawr committed May 23, 2024
1 parent 1f9b7e8 commit 3d0bc2a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions filebeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,16 @@ func PythonIntegTest(ctx context.Context) error {
mg.Deps(Fields, Dashboards, devtools.BuildSystemTestBinary)
return devtools.PythonIntegTestFromHost(devtools.DefaultPythonTestIntegrationFromHostArgs())
}

// TestJournald executes the Journald input tests
// Use TEST_COVERAGE=true to enable code coverage profiling.
// Use RACE_DETECTOR=true to enable the race detector.
func TestJournald(ctx context.Context) error {
utArgs := devtools.DefaultGoTestUnitArgs()
utArgs.Packages = []string{"./input/journald"}
if devtools.Platform.GOOS == "linux" {
utArgs.ExtraFlags = append(utArgs.ExtraFlags, "-tags=withjournald")
}

return devtools.GoTest(ctx, utArgs)
}
13 changes: 13 additions & 0 deletions x-pack/filebeat/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,16 @@ func PythonIntegTest(ctx context.Context) error {
mg.Deps(Fields, Dashboards, devtools.BuildSystemTestBinary)
return devtools.PythonIntegTestFromHost(devtools.DefaultPythonTestIntegrationFromHostArgs())
}

// TestJournald executes the Journald input tests
// Use TEST_COVERAGE=true to enable code coverage profiling.
// Use RACE_DETECTOR=true to enable the race detector.
func TestJournald(ctx context.Context) error {
utArgs := devtools.DefaultGoTestUnitArgs()
utArgs.Packages = []string{"./input/journald"}
if devtools.Platform.GOOS == "linux" {
utArgs.ExtraFlags = append(utArgs.ExtraFlags, "-tags=withjournald")
}

return devtools.GoTest(ctx, utArgs)
}

0 comments on commit 3d0bc2a

Please sign in to comment.