mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-18 17:33:39 +00:00
Some of our API types contain fields that get rendered very poorly by gomega.format.Object because they contain lots of internal information, for example CreationTimestamp. As a result, dumping full API object typically gets truncated. What we want is a representation that is a) multi-line (in contrast to the stringer implemented by our types) and b) drops empty fields where it was defined that this is okay. The normal YAML representation fits that requirement. We just need to teach gomega how and when to do that. This cannot be done for each type through a generated GomegaString method (lots of code, additional dependency in public API on YAML encoder), but it can be done inside tests by adding a formatting handler (new gomega feature). |
||
---|---|---|
.. | ||
format_test.go | ||
format.go |