From cdaba2bea349ce142bd7eb602a16c58a55952320 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Tue, 23 Jul 2019 13:15:08 +0200 Subject: [PATCH] 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. --- test/e2e/framework/log/logger_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/e2e/framework/log/logger_test.go b/test/e2e/framework/log/logger_test.go index 469a61c5c7d..76439c06298 100644 --- a/test/e2e/framework/log/logger_test.go +++ b/test/e2e/framework/log/logger_test.go @@ -148,8 +148,9 @@ func stripAddresses(in string) string { return instanceAddr.ReplaceAllString(in, ">") } -// stackLocation matches "\t//.go:75 +0x1f1". -var stackLocation = regexp.MustCompile(`/.*/([[:^space:]]+.go:[[:digit:]]+)( \+0x[0-9a-fA-F]+)?`) +// stackLocation matches "/.go:75 +0x1f1" after a slash (built +// 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 "(...)". var functionArgs = regexp.MustCompile(`([[:alpha:]]+)\(.*\)`)