-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logging Quality-of-Life Issues #907
Comments
Solution ImplementationPrints something like this if --verbosity=5: [0]
The very light wrapper around Zap and testing.T. Test changes needed:
[0] Note it doesn't exactly do this in PoC right now |
cc @Harwayne |
This isn't accurate, we did it partly because the alternative that existed couldn't run in t.Parallel without tripping |
I didn't find any reasoning in the change PRs/issues, so I DM'd the author and that's what they remembered. Provided this issue can be addressed, how do you feel about this proposal? |
Well, then perhaps we're talking about different changes because I switched all the e2e tests to use Honestly, so long as we can maintain |
Note: out of scope is capturing klog output to redirect to JUnit (because klog is global and Go does not make it easy to make threadlocal variables for goroutines). |
Regarding addressing of pain point 2, how can one use that on Prow? Does it need to be hardcoded in the job? Regarding addressing of pain point 3, do we have a PoC that if a test times out on Prow we really don't loose logs?
How does it affect the proposed addressing of pain points 4 and 5? |
All our logging libraries allow setting verbosity levels, they just weren't plumbed together. I'm making a flag that controls it so users (including Prow) can set verbosity at whatever level they wish.
It's an explicit feature of testing.T.Log() method that it doesn't print anything until the test completes, so pretty easy to avoid.
All logging will be copied to a separate file (optionally, and intended for Prow), so it's at least collected. Non-parallel runs (and single-test debugging sessions) will have all their logging consecutive. |
Working to introduce structured logging to our tests. See knative#907 This work allows these test functions to be called by objects other than *testing.T. The t.Error() calls are made compatible with structured logging (wrapping Zap sugared logger calls) or code using testing.T.
No, 935 is just a small step toward enabling it. I'm using the serving conformance tests to validate the idea, see knative/serving#6264 and intend to have something to present to serving working group Real Soon Now (probably next week). |
knative/serving#6976 and knative/serving#6978 were to be big steps toward doing this. Using |
This issue is stale because it has been open for 90 days with no |
A while ago, it was chosen to use testing.T logging for our tests, primarily for aesthetic reasons.
Current Problems
Proposed Solution
Tests should log with logr semantics into the Zap logger, along with minimal wrappers to cut down on verbosity in tests.
Why?
It addresses the five pain points:
Enables More Improvement
I wish to expand and improve the conformance tests. Our current logging limitations make it very difficult to have the tests present conformance results well while also making them useful to determine how to change an implementation to make it conform.
The text was updated successfully, but these errors were encountered: