-
Notifications
You must be signed in to change notification settings - Fork 38.6k
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
e2e: pretty-print objects #111884
Comments
/sig testing |
|
/triage accepted |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
I believe that However, tests must explicitly call it. I'd like to do a bit more work before closing this issue:
|
/remove-lifecycle stale |
The upstream ktesting uses the normal text formatting. This is not very useful for test output because in tests it is fairly common that larger data types (structs, slices) need to be dumped and the default `%+v` does not render those nicely. In particular Kubernetes API objects become very large (kubernetes#111884). By installing gomega as formatting helper, we get more readable output, in particular with the YAML extension for gomega.
klog cannot use it by default because it must not depend on YAML. But JSON is now the default, which is close enough for me. /close |
@pohly: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What would you like to be added?
There is no good pretty-printing for Kubernetes API objects, which affects debugging. All of the following options have drawbacks:
fmt.Sprintf("%+v")
(single line, no clear distinction between fields)obj.String()
(auto-generated, single line, does not omit empty fields)What we want is probably:
In other words, YAML?
/cc @tallclair
Why is this needed?
For example for
kubernetes/test/e2e/framework/pod/wait.go
Lines 77 to 82 in 619f1cf
=>
The text was updated successfully, but these errors were encountered: