94 Commits

Author SHA1 Message Date
Antonio Ojea
1065377f97 Revert "tests: include stdout of failed commands in JUnit" 2025-01-22 23:36:50 +01:00
Patrick Ohly
03a3288ddd tests: include stdout of failed commands in JUnit
All of the shell commands used by `make test-cmd` log success and
failures to stdout, e.g.:
   get.sh -> if_has_string ->
   2c9153576e/hack/lib/test.sh (L340-L360)

juLog captured stdout in addition to forwarding it to the overall test stdout,
but then only used it to check for text that indicates a problem. The result
was that after a test failure, the only thing visible in Spyglass was a fairly
useless "script error" generated by juLog for its own call chain. One had to
know that the entire build log contained more information and where to look for
it.

Now the stdout text is included in the JUnit file and thus visible when looking
at just one failed test. The output itself is still hard to read (contains one
line saying "FAIL!" and one has to know that the text below that line explains
the failure), but that is a different story.
2025-01-20 09:28:19 +01:00
Kir Kolyshkin
3a1b0f2864 kubelet/kuberuntime: switch to runc/libct
runc/libcontainer/cgroups.ParseCgroupFile is a universal function; for
cgroup v2 it returns path to unified in a map with "" as a key.

Let's use it here, dropping cgroups dependency entirely.

Amends commit e86d02b60c.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-11-07 13:04:56 -08:00
Davanum Srinivas
e86d02b60c Copy ParseCgroupFileUnified and Drop rest of containerd/cgroups
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-10-31 13:42:39 -04:00
Davanum Srinivas
abbc5ad346 Copy limited pieces of code we use from runc's apparmor and utils packages
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-10-22 09:56:22 -04: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
Akihiro Suda
07c701fecb agnhost: merge registry.k8s.io/stress:v1 (github.com/vishh/stress)
Merge vishh/stress@eab4e3384b into
agnhost.

Old usage: `stress -mem-alloc-size 12Mi -mem-alloc-sleep 10s -mem-total 4Gi`
New usage: `agnhost stress --mem-alloc-size 12Mi --mem-alloc-sleep 10s --mem-total 4Gi`

This is a part of the steps to migrate from legacy Schema 1 images
(issue 123146)

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-02-13 23:21:05 +09:00
Tim Hockin
a7cf7fe55a Bump shellcheck to 0.9.0
Fix everything it flagged.
2024-01-26 16:26:40 -08:00
Patrick Ohly
0b4efddae0 verify: nicer failure message rendering in Prow
The "message" attribute is redundant. Adding line breaks ensures that the curly
brackets used by Prow are on separate lines.

Before:
    {Script Error ScriptError test/e2e/e2e.go:437:5: var `unused` is unused (unused)
    var unused = 1 // intentionally trigger a golangci-lint warning.
        ^}

After:
    {ScriptError
    test/e2e/e2e.go:437:5: var `unused` is unused (unused)
    var unused = 1 // intentionally trigger a golangci-lint warning.
        ^
    }
2023-06-02 15:39:27 +02:00
Patrick Ohly
dbbb21469f verify: pick relevant lines from verify-golangci-lint.sh as failure message
When sh2ju.sh was called to generate the junit_verify.xml, it used to include
the entire output of a failed script twice: once as failure message, once as
log output.

This output can be large and often the actual failure isn't near the top, but
rather at the end or (in the case of the different golangci-lint invocations)
embedded in the log. This makes them hard to see at a glance when looking at
the Prow result page for a job.

Now a verify script can prefix relevant lines with "ERROR: " and then only
those lines are used as failure message in JUnit, without that prefix.

That string was chosen because Prow itself also then picks up those lines when
viewing the entire build log and it is unlikely that some script prints such
lines when they are not meant to be part of the failure.

If some script outputs no such lines, "see stderr for details" is used as
failure message. This is better than before because it avoids the redundancy.
2023-06-02 15:37:50 +02:00
Kubernetes Prow Robot
bd6c284583 Merge pull request #109244 from alexzielenski/clean-third-party-forks
remove unused/orphaned golang package forks
2022-05-03 19:29:35 -07: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
Alexander Zielenski
dcbf693e0a remove unused packages 2022-04-01 08:54:06 -07:00
Davanum Srinivas
9682b7248f OWNERS cleanup - Jan 2021 Week 1
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-01-10 08:14:29 -05:00
Jordan Liggitt
c4ecdad570 Copy golang license to staging copies 2021-08-10 17:37:28 -04:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Kubernetes Prow Robot
18f4156c40 Merge pull request #97808 from aojea/miekdns
remove e2e miekg/dns dependency
2021-01-25 11:43:00 -08:00
Antonio Ojea
3790290c9b remove e2e miekg/dns dependency
miekg dependency was forking some of the golang standard library.
We can fork it directly into the third_party folder respecting
the LICENSE.
2021-01-22 18:27:25 +01:00
he.qingguo
27dfaafe93 Fix Spelling error about [errrors]
Signed-off-by: he.qingguo <he.qingguo@zte.com.cn>
2021-01-05 12:27:08 +08:00
Jeff Grafton
089a1af421 Move ixdy to emeritus 2020-07-06 10:39:56 -07:00
Dax McDonald
c5edd4565c Fix typo in docstring of DeepEqual
Change "imformative" to informative
2019-10-01 17:18:30 -07:00
Davanum Srinivas
f58f126715 Remove support for etcd2 from cluster/images/etcd image
Removes etcd2 code and images.
Etcd2 is no longer supported as of 1.13, so rollback and management
tools for etcd2 should not be shipped any longer. If it is still desired
the older versions of the image can be used.

Change-Id: I516c40067f0a57c42d2a6ab4612071c5e556a005
2019-07-11 21:20:24 -04:00
Bob Killen
9e719d8d9c Fix shellcheck lint errors in third_party/forked/shell2junit/sh2ju.sh 2019-04-11 10:25:41 -07:00
Jordan Liggitt
7f246d461b Remove third_party/forked/godep 2019-04-03 10:19:39 -04:00
Davanum Srinivas
eb4865fbe5 Hack to ignore stale packages in godep
Change-Id: Ibf0877521310d6f2baad605bf1216940e95cb9cd
2019-03-12 09:49:03 -04:00
Prasad Ghangal
317ecf58cc Update golang.org/x/net/... dependencies to release-branch.go1.11
- latest grpc-ecosystem/go-grpc-middleware

Change-Id: Ida7d01e4606f6e0313e1355db6e85be0c0ef1dd1
2019-03-12 09:48:52 -04:00
Roy Lenferink
b43c04452f Updated OWNERS files to include link to docs 2019-02-04 22:33:12 +01:00
Christoph Blecker
c0967edd4a Add license declaration to forked godep 2018-11-07 11:02:08 -08:00
Christoph Blecker
d15da2c586 Update godeps 2018-11-07 11:02:07 -08:00
Christoph Blecker
9d241ec454 Modify forked godep to have custom version 2018-11-06 12:23:23 -08:00
Filipe Brandenburger
db89546591 Use a fixed abbreviation size in git describe output
Currently, this setting depends on whatever the user of `godep` has in
their `git config --get core.abbrev`, if it is set.

Even when it is not set, the number of characters used in the shortened
git commit will depend on whether there are collisions for that prefix
on the local repository (which in large part depends on how much
activity exists there.)

As a result, when multiple users are maintaining Godeps/ for a single
project, many spurious changes to Godeps/Godeps.json are generated due
to the lack of stability in the length of the abbreviated commit in
output of `git describe`.

Let's fix this by enforcing a reasonable abbreviation length in godep's
use of `git describe`. 14 characters is very unlikely to result in
collisions for prefixes.
2018-11-06 11:44:02 -08:00
Christoph Blecker
57e1d0adcc Move godep from vendor to third_party/forked/ 2018-11-06 11:44:02 -08:00
Christoph Blecker
31601caa8d Remove forked go/types 2018-10-24 17:40:06 -07:00
Lei Gong
36a7a1a79b fix some style error using gofmt 2018-06-28 15:02:30 +08:00
Jeff Grafton
a725660640 Update to gazelle 0.12.0 and run hack/update-bazel.sh 2018-06-22 16:22:18 -07:00
Jeff Grafton
01f94051c8 Remove the go_default_library_protos filegroups using buildozer 2018-06-22 16:22:18 -07:00
Ibrahim AshShohail
73f4cd89af Fix error message in Equalities.DeepEqual
Signed-off-by: Ibrahim AshShohail <me@ibrasho.com>
2018-05-20 02:22:09 +03:00
Matthias Bertschy
9b15af19b2 Update all script to use /usr/bin/env bash in shebang 2018-04-19 13:20:13 +02:00
Ryan Hitchman
90d99b346f Fix spurious whitespace in messages from sh2ju.
<failure>
<![CDATA[
...
]]>
</failure>

creates a <failure> tag with text == "\n\n...\n".

It needs to be on one line.
2018-03-28 20:11:58 -07:00
Ryan Hitchman
ba16cd9071 Make sh2ju use awk instead of bc.
awk is available in all of our test runners (as part of busybox or debian base packages), bc is not.
2018-03-01 23:47:50 -08:00
Kubernetes Submit Queue
7f49ccd2d0 Merge pull request #60506 from php-coder/fix_suppress_gdate_cmd
Automatic merge from submit-queue (batch tested with PRs 60475, 60514, 60506, 59903, 60319). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

sh2ju.sh: suppress `which` command output when gdate not found in $PATH

**What this PR does / why we need it**:
`make quick-verify` (and probably some other commands) doesn't produce a lot of unrelated and useless information to a console now.

Here is the related PR in the upstream: https://github.com/manolo/shell2junit/pull/7

How it was before:
>SUCCESS  verify-pkg-names.sh	1s
>Verifying verify-readonly-packages.sh
>which: no gdate in (/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/coder/bin:/home/coder/git/bin:/opt/maven/bin:/opt/go1.9.2/bin:/home/coder/.cargo/bin:/home/coder/git/src/github.com/openshift/origin/_output/local/bin/linux/amd64:/home/coder/git/kubernetes/third_party/etcd:/opt/groovy-2.4.12/bin:/home/coder/bin:/home/coder/git/bin:/opt/maven/bin:/opt/go1.9.2/bin:/home/coder/.cargo/bin:/home/coder/git/src/github.com/openshift/origin/_output/local/bin/linux/amd64:/home/coder/git/kubernetes/third_party/etcd:/opt/groovy-2.4.12/bin)
2018-02-28 07:20:25 -08:00
Ryan Hitchman
c3acf0749b Vendor golang's go/types to include a fix for CGo typechecking.
Ts is go/types forked from go@236abdb46b (just after 1.10) and
cherry-picked go@1006f703ffc, which fixes https://github.com/golang/go/issues/23712.
It can be removed when all builders are >= go1.11.
2018-02-27 13:53:32 -08:00
Slava Semushin
ac8d6a295a sh2ju.sh: suppress which command output when gdate not found in $PATH. 2018-02-27 16:27:57 +01:00
Jeff Grafton
ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
Christoph Blecker
3bcc6e9eeb Add brackets and quotes where needed 2018-01-26 15:11:53 -08:00
Christoph Blecker
670505e5ff Contain variable names in shell2unit
Also correct unbound assertions variable error on line 176
2018-01-26 14:08:25 -08:00
Christoph Blecker
92b1e6d227 Add cblecker to shell2junit OWNERS
You break it, you bought it.
2018-01-26 13:57:35 -08:00
Christoph Blecker
33a0b5af0c Fix unset variables in shell2junit 2018-01-25 13:30:27 -08:00
Christoph Blecker
5fe4d279ca Produce junit results for verify job 2018-01-25 13:30:25 -08:00
Jeff Grafton
efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00