Skip to content

Commit

Permalink
Revert "testutils: Fix RepoRootPath when Tetragon is vendored"
Browse files Browse the repository at this point in the history
This reverts commit 5bcb468.

Signed-off-by: Anastasios Papagiannis <[email protected]>
  • Loading branch information
tpapagian committed Jan 24, 2024
1 parent 03beec7 commit c1d6f11
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions pkg/testutils/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,10 @@ package testutils
import (
"path/filepath"
"runtime"
"strings"
)

// RepoRootPath retrieves the repository root path (useful to find scripts and other files)
func RepoRootPath(fname string) string {
_, testFname, _, _ := runtime.Caller(0)
// in the case where this file is vendored (i.e. under vendor directory)
// we have to skip the path on the right of vendor/
if index := strings.Index(testFname, "vendor"); index != -1 { // vendor found in path
return filepath.Join(testFname[0:index], fname)
}
return filepath.Join(filepath.Dir(testFname), "..", "..", fname)
}

0 comments on commit c1d6f11

Please sign in to comment.