From 53d5c6a15b6a67be65d0eb1371b4ca558d58af67 Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Thu, 18 Aug 2022 15:05:53 +0200 Subject: [PATCH] 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 --- test/e2e/e2e.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/e2e/e2e.go b/test/e2e/e2e.go index b9df43a52d9..c48c46edf95 100644 --- a/test/e2e/e2e.go +++ b/test/e2e/e2e.go @@ -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)