eventing: Don't dump K8s events on console log

Describe the bug We are dumping K8s events on console log, no matter if the test is successful or not. That makes it really hard to know what actually happened as it makes the log extremely long.

This is the code that does this:

https://github.com/knative/eventing/blob/ede5a2ac8beb888edeae49539f041ea9bb085476/test/lib/test_runner.go#L214-L216

Expected behavior We should dump those directly to a $ARTIFACTS directory instead of console. Maybe we also make if skippable, using environment configuration - for ex.: TEST_RUNNER_DUMP_EVENTS=yes|no|on_error.

To Reproduce Run any eventing test that uses test runner, like upgrade tests.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 23 (16 by maintainers)

Most upvoted comments

@zhongduo I can add additional environment variable, let’s say TEST_RUNNER_DUMP_EVENTS_LOCATION=stdout|logfile. And if logfile will be used I would put those events to a file and write on console:

K8s events for ns test-events-propagation-with-prober-txtxn has been dumped to: artifacts/path/gotest-k8s-events/test-events-propagation-with-prober-txtxn.log

Then it will be super easy to look them up if you like to. Or, you can set that flag to stdout, to keep current behavior.