e2e log: skip log.Failf in stack information

The function itself isn't relevant.
This commit is contained in:
Patrick Ohly 2019-08-30 08:51:21 +02:00
parent 02ce619078
commit 6cecc0ab37
2 changed files with 2 additions and 3 deletions

View File

@ -41,7 +41,7 @@ func Logf(format string, args ...interface{}) {
// Failf logs the fail info.
func Failf(format string, args ...interface{}) {
FailfWithOffset(1, format, args...)
FailfWithOffset(2, format, args...)
}
// FailfWithOffset calls "Fail" and logs the error at "offset" levels above its caller

View File

@ -89,8 +89,7 @@ func TestFailureOutput(t *testing.T) {
name: "[Top Level] log fails",
output: "INFO: before\nFAIL: I'm failing.\nINFO: after\nFAIL: true is never false either\nExpected\n <bool>: true\nto equal\n <bool>: false\n",
failure: "I'm failing.",
// TODO: should framework/log.Failf be skipped?
stack: "k8s.io/kubernetes/test/e2e/framework/log.Failf()\n\tlogger.go:44\nk8s.io/kubernetes/test/e2e/framework/log_test.glob..func1.2.1(...)\n\tlogger_test.go:41\nk8s.io/kubernetes/test/e2e/framework/log_test.glob..func1.2()\n\tlogger_test.go:42\nk8s.io/kubernetes/test/e2e/framework/log_test.TestFailureOutput()\n\tlogger_test.go:65",
stack: "k8s.io/kubernetes/test/e2e/framework/log_test.glob..func1.2.1(...)\n\tlogger_test.go:41\nk8s.io/kubernetes/test/e2e/framework/log_test.glob..func1.2()\n\tlogger_test.go:42\nk8s.io/kubernetes/test/e2e/framework/log_test.TestFailureOutput()\n\tlogger_test.go:65",
},
}
// Compare individual fields. Comparing the slices leads to unreadable error output when there is any mismatch.