Skip to content

Commit

Permalink
invoke m.Run on TestMain
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersonQ committed Dec 4, 2024
1 parent 3f51793 commit f994078
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion filebeat/autodiscover/builder/hints/logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package hints

import (
"os"
"path/filepath"
"testing"

Expand All @@ -30,8 +31,10 @@ import (
"github.com/elastic/elastic-agent-libs/paths"
)

func TestMain(t *testing.M) {
func TestMain(m *testing.M) {
InitializeModule()

os.Exit(m.Run())
}

func TestGenerateHints(t *testing.T) {
Expand Down
3 changes: 3 additions & 0 deletions filebeat/processor/add_kubernetes_metadata/matchers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package add_kubernetes_metadata

import (
"fmt"
"os"
"runtime"
"testing"

Expand All @@ -36,6 +37,8 @@ const puid = "005f3b90-4b9d-12f8-acf0-31020a840133"

func TestMain(m *testing.M) {
InitializeModule()

os.Exit(m.Run())
}

func TestLogsPathMatcher_InvalidSource1(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import (

func TestMain(m *testing.M) {
InitializeModule()

os.Exit(m.Run())
}

func TestTokenAppender(t *testing.T) {
Expand Down
2 changes: 2 additions & 0 deletions metricbeat/autodiscover/builder/hints/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import (

func TestMain(m *testing.M) {
InitializeModule()

os.Exit(m.Run())
}

func TestGenerateHints(t *testing.T) {
Expand Down

0 comments on commit f994078

Please sign in to comment.