e2e: enable contextual logging

Contextual logging cannot be enabled manually because there is no feature gate
flag. Enabling the feature unconditionally:
- should be low risk for E2E testing
- if it fails, we want to know
- is useful to get better log output from code which already supports it
This commit is contained in:
Patrick Ohly 2022-08-18 15:05:53 +02:00
parent 96e9a93a6b
commit 53d5c6a15b

View File

@ -97,8 +97,18 @@ var _ = ginkgo.SynchronizedAfterSuite(func() {
// generated in this directory, and cluster logs will also be saved.
// This function is called on each Ginkgo node in parallel mode.
func RunE2ETests(t *testing.T) {
// InitLogs disables contextual logging, without a way to enable it again
// in the E2E test suite because it has no feature gates. It used to have a
// misleading --feature-gates parameter but that didn't do what users
// and developers expected (define which features the cluster supports)
// and therefore got removed.
//
// Because contextual logging is useful and should get tested, it gets
// re-enabled here unconditionally.
logs.InitLogs()
defer logs.FlushLogs()
klog.EnableContextualLogging(true)
progressReporter = e2ereporters.NewProgressReporter(framework.TestContext.ProgressReportURL)
gomega.RegisterFailHandler(framework.Fail)