From c8dfcaa34b11bb49067c51a7c9823d3dc24e356a Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Wed, 18 Dec 2024 14:48:16 +0100 Subject: [PATCH] Enable and fix `thelper` linter Signed-off-by: Sascha Grunert --- .golangci.yml | 2 +- cmd/critest/cri_test.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index 9aee75863a..9169cd8226 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -85,6 +85,7 @@ linters: - tenv - testableexamples - testifylint + - thelper - tparallel - typecheck - unconvert @@ -109,7 +110,6 @@ linters: # - nlreturn # - nonamedreturns # - testpackage - # - thelper # - varnamelen # - wrapcheck # - wsl diff --git a/cmd/critest/cri_test.go b/cmd/critest/cri_test.go index e8d5de150f..68925cecd5 100644 --- a/cmd/critest/cri_test.go +++ b/cmd/critest/cri_test.go @@ -87,6 +87,7 @@ func isFlagSet(name string) bool { // runTestSuite runs cri validation tests and benchmark tests. func runTestSuite(t *testing.T) { + t.Helper() gomega.RegisterFailHandler(ginkgo.Fail) ginkgo.RunSpecs(t, "CRI validation") } @@ -105,6 +106,7 @@ func generateTempTestName() (string, error) { } func runParallelTestSuite(t *testing.T) { + t.Helper() criPath, err := os.Executable() if err != nil { t.Fatalf("Failed to lookup path of critest: %v", err)