Skip to content

Commit cdaba2b

Browse files
committed
e2e logger test: handle paths in Kubernetes CI
Source code paths during //test/e2e/framework/log:go_default_test in the Kubernetes CI start with relative paths. To avoid too broad matching of the regex, those paths that occur in practice are named explicitly as alternatives to the leading slash.
1 parent f021d65 commit cdaba2b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/e2e/framework/log/logger_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,9 @@ func stripAddresses(in string) string {
148148
return instanceAddr.ReplaceAllString(in, ">")
149149
}
150150

151-
// stackLocation matches "\t/<some path>/<file>.go:75 +0x1f1".
152-
var stackLocation = regexp.MustCompile(`/.*/([[:^space:]]+.go:[[:digit:]]+)( \+0x[0-9a-fA-F]+)?`)
151+
// stackLocation matches "<some path>/<file>.go:75 +0x1f1" after a slash (built
152+
// locally) or one of a few relative paths (built in the Kubernetes CI).
153+
var stackLocation = regexp.MustCompile(`(?:/|vendor/|test/|GOROOT/).*/([[:^space:]]+.go:[[:digit:]]+)( \+0x[0-9a-fA-F]+)?`)
153154

154155
// functionArgs matches "<function name>(...)".
155156
var functionArgs = regexp.MustCompile(`([[:alpha:]]+)\(.*\)`)

0 commit comments

Comments
 (0)