mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
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.
This commit is contained in:
parent
f021d6590e
commit
cdaba2bea3
@ -148,8 +148,9 @@ func stripAddresses(in string) string {
|
|||||||
return instanceAddr.ReplaceAllString(in, ">")
|
return instanceAddr.ReplaceAllString(in, ">")
|
||||||
}
|
}
|
||||||
|
|
||||||
// stackLocation matches "\t/<some path>/<file>.go:75 +0x1f1".
|
// stackLocation matches "<some path>/<file>.go:75 +0x1f1" after a slash (built
|
||||||
var stackLocation = regexp.MustCompile(`/.*/([[:^space:]]+.go:[[:digit:]]+)( \+0x[0-9a-fA-F]+)?`)
|
// locally) or one of a few relative paths (built in the Kubernetes CI).
|
||||||
|
var stackLocation = regexp.MustCompile(`(?:/|vendor/|test/|GOROOT/).*/([[:^space:]]+.go:[[:digit:]]+)( \+0x[0-9a-fA-F]+)?`)
|
||||||
|
|
||||||
// functionArgs matches "<function name>(...)".
|
// functionArgs matches "<function name>(...)".
|
||||||
var functionArgs = regexp.MustCompile(`([[:alpha:]]+)\(.*\)`)
|
var functionArgs = regexp.MustCompile(`([[:alpha:]]+)\(.*\)`)
|
||||||
|
Loading…
Reference in New Issue
Block a user