Commit graph

18 commits

Author SHA1 Message Date
Mark Rossetti
c97ed1a58c
fixup! Fixing prune-junit-xml directory walking so labels get removed for Windows too 2026-04-30 10:03:30 -07:00
Mark Rossetti
fd288806ed
Fixing prune-junit-xml directory walking so labels get removed for Windows too
Signed-off-by: Mark Rossetti <marosset@microsoft.com>
2026-04-29 11:54:34 -07:00
Patrick Ohly
4e38454959 test/integration: add missing sig labels
Each directory with tests should have a sig label in its OWNERS file to
document which SIG is responsible for the test. Otherwise SIG Testing gets
pinged by SIG Release as the default owner of all tests when a test fails.

Some integration test packages are either empty (objectmeta) or useless with
unclear owner (configmap); those get removed.
2026-04-10 14:01:51 +02:00
Patrick Ohly
5ceba3ca26 test: inject [sig-...] prefix into unit and integration test names
When SIG Release triaged testgrid failures for unit or integration
test jobs, they often ended up reaching out to SIG Testing as the
owner of those jobs.

Injecting the same [sig-...] prefix as in E2E tests makes it more
obvious which SIG needs to handle specific test failures. This
avoids the manual step of looking up source code and finding
the relevant OWNERS file: those steps are now done automatically
by prune-junit-xml.
2026-04-09 12:23:56 +02:00
Patrick Ohly
6189addb68 test: simplify pruned testsuite name
During unit or integration testing we collapsed all tests in a "class" (=
package) into a single entry, with a shorter name. But the suite name was left
unchanged, with the result that testgrid showed
e.g. "k8s.io/kubernetes/test/integration/scheduler/preemption.preemption".
Shortening the suite name in the same way as the class name turns that into
"k8s.io/kubernetes/test/integration/scheduler.preemption".

Spyglass uses the class name and shows
"k8s.io/kubernetes/test/integration/scheduler: preemption", with and without
this change.
2026-04-09 10:06:12 +02:00
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
Benjamin Elder
96d48de9b9 add OWNERS for cmd/prune-junit-xml 2023-05-22 11:01:38 -07:00
Benjamin Elder
82c40e3697 drop redundant NArg check when looping Args 2023-05-16 23:12:37 -07:00
Jordan Liggitt
3b64cb5f11
Include head and tail of clipped test messages 2023-01-10 11:26:34 -05:00
Davanum Srinivas
108e3e28a9
Correctly attribute some datastructures from gotestsum repository
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-04-01 14:49:15 -04:00
Davanum Srinivas
d20df79545
prune junit xml files in ci harness
Over time the size of our junit xml has exploded to the point where
test-grid fails to process them. We still have the original/full
*.stdout files from where the junit xml files are generated from so the
junit xml files need NOT have the fill/exact output for
processing/display. So let us prune the large messages with an
indicator that we have "[... clipped...]" some of the content so folks
can see that they have to consult the full *.stdout files.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-03-30 12:58:43 -04: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