From 2a9a3ea827d18b6fdb35f118d77b1d3d72759b8e Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Thu, 20 Mar 2025 12:09:44 +0100 Subject: [PATCH] test: switch gotestsum quiet output format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "--format standard-quiet" shows log output on stderr (= klog logging) if it occurs outside of a test (= test has leaked something). That is inconsistent with "go test" without -v and a problem for pull-kubernetes-unit because many tests do not clean up properly. "pkgname-and-test-fails" hides the extra output and seems similar enough: pkgname-and-test-fails print a line for each package and failed test output $ gotestsum --format pkgname-and-test-fails ./test/internal/logging --count=1 ✓ test/internal/logging (5.007s) DONE 1 tests in 5.384s --- hack/make-rules/test.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hack/make-rules/test.sh b/hack/make-rules/test.sh index 91c62d96459..9961f102b55 100755 --- a/hack/make-rules/test.sh +++ b/hack/make-rules/test.sh @@ -139,7 +139,8 @@ testargs=() eval "testargs=(${KUBE_TEST_ARGS:-})" # gotestsum --format value -gotestsum_format=standard-quiet +# "standard-quiet" let's some stderr log messages through, "pkgname-and-test-fails" is similar and doesn't (https://github.com/kubernetes/kubernetes/issues/130934#issuecomment-2739957840). +gotestsum_format=pkgname-and-test-fails if [[ -n "${FULL_LOG:-}" ]] ; then gotestsum_format=standard-verbose fi