Commit Graph

9 Commits

Author SHA1 Message Date
Patrick Ohly
b330eeac2f prune-junit-xml: preserve system out + err text during test pruning
When stripping out log messages from the failure text, the original text gets
stored as <system-out>. That part then got lost when reducing tests. Instead of
dropping it, it needs to be joined from all failed tests. Same for
<system-err>, although that isn't used yet.
2024-12-02 11:17:57 +01:00
Patrick Ohly
e0e4af8a58 prune-junit-xml: smarter concatenation when pruning tests
Repeating the same "Failed" message text doesn't add any
information. Separating with a blank line is more readable.

Before:

    <failure message="Failed; Failed; Failed" type="">
       ...
       --- FAIL: TestFrontProxyConfig/WithoutUID (64.89s) ; === RUN TestFrontProxyConfig/WithUID

After:

    <failure message="Failed" type="">
       ...
       --- FAIL: TestFrontProxyConfig/WithoutUID (64.89s)

       === RUN TestFrontProxyConfig/WithUID
2024-12-02 11:17:57 +01:00
Patrick Ohly
dd6ad66f5f prune-junit-xml: avoid appending semicolon
Appending a semicolon after some text is unnecessary if it's the last
entry. This led to visually distracting extra semicolons in Spyglass which
looked like a bug in Spyglass.

Now the code checks if a semicolon is necessary before inserting it.
2024-11-08 16:12:47 +01:00
Kubernetes Prow Robot
62c1aa0529 Merge pull request #127929 from pohly/prune-junit-xml-failure
prune-junit-xml: simplify failure message
2024-10-14 17:08:21 +01:00
Patrick Ohly
fba2bcf2d2 prune-junit-xml: simplify failure message
In Go unit tests, the entire test output becomes the failure message because
`go test` doesn't track why a test fails. This can make the failure message
pretty large, in particular in integration tests.

We cannot identify the real failure either because Kubernetes has no convention
for how to format test failures. What we can do is recognize log output added
by klog.

prune-junit-xml now moves the full text to to the test output and only keep
those lines in the failure which are not from klog.

The klog output parsing might eventually get moved to
k8s.io/logtools/logparse. For now it is developed as a sub-package of
prune-junit-xml.
2024-10-13 09:37:50 +02:00
Cookiery
4ce7f8547d chore: cleanup code
chore: cleanup code

chore: cleanup code

chore: cleanup code
2024-10-04 20:43:01 +08:00
Rajalakshmi Girish
dddbecb47e prune's xml files to display only top level tests and failed sub-tests 2023-06-06 05:26:00 -07:00
Jordan Liggitt
3b64cb5f11 Include head and tail of clipped test messages 2023-01-10 11:26:34 -05:00
Davanum Srinivas
917c361880 Add a utility to prune junit xml files
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-03-30 12:58:43 -04:00