e2e framework internal: normalize anonymous functions with parameters

This will become relevant for

   ginkgo.BeforeEach(func(ctx context.Context) { ... })
This commit is contained in:
Patrick Ohly 2022-10-18 13:44:36 +02:00
parent 0d73c0d0e5
commit 16f05373f4
2 changed files with 4 additions and 4 deletions

View File

@ -124,8 +124,8 @@ func stripAddresses(in string) string {
// 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>(...)".
var functionArgs = regexp.MustCompile(`([[:alpha:]]+)\(.*\)`)
// functionArgs matches "<function name>(...)" where <function name> may be an anonymous function (e.g. "pod_test.glob..func1.1")
var functionArgs = regexp.MustCompile(`([[:alpha:][:digit:].]+)\(.*\)`)
// klogPrefix matches "I0822 16:10:39.343790 989127 "
var klogPrefix = regexp.MustCompile(`(?m)^[IEF][[:digit:]]{4} [[:digit:]]{2}:[[:digit:]]{2}:[[:digit:]]{2}\.[[:digit:]]{6}[[:space:]]+[[:digit:]]+ `)

View File

@ -154,12 +154,12 @@ k8s.io/kubernetes/test/e2e/framework_test.glob..func1.5()
FAIL: I'm failing.
Full Stack Trace
k8s.io/kubernetes/test/e2e/framework_test.glob..func1.3.1(...)
k8s.io/kubernetes/test/e2e/framework_test.glob..func1.3.1()
log_test.go:56
k8s.io/kubernetes/test/e2e/framework_test.glob..func1.3()
log_test.go:57` + commonOutput,
Failure: "I'm failing.",
Stack: `k8s.io/kubernetes/test/e2e/framework_test.glob..func1.3.1(...)
Stack: `k8s.io/kubernetes/test/e2e/framework_test.glob..func1.3.1()
log_test.go:56
k8s.io/kubernetes/test/e2e/framework_test.glob..func1.3()
log_test.go:57`,