testing: allow keeping detailed go test JUnit results

Pruning of tests to the top-level test was added for jobs like
pull-kubernetes-unit which run many tests. For other, more focused jobs like
scheduler-perf benchmarking it would be nice to keep the more detailed
information, in particular because it includes the duration per test case.
This commit is contained in:
Patrick Ohly 2024-11-18 12:44:34 +01:00
parent ac3d43a8a6
commit 25a4758bcc

View File

@ -81,6 +81,8 @@ fi
# Set to 'y' to keep the verbose stdout from tests when KUBE_JUNIT_REPORT_DIR is
# set.
KUBE_KEEP_VERBOSE_TEST_OUTPUT=${KUBE_KEEP_VERBOSE_TEST_OUTPUT:-n}
# Set to 'false' to disable reduction of the JUnit file to only the top level tests.
KUBE_PRUNE_JUNIT_TESTS=${KUBE_PRUNE_JUNIT_TESTS:-true}
kube::test::usage() {
kube::log::usage_from_stdin <<EOF
@ -234,7 +236,7 @@ runTests() {
&& rc=$? || rc=$?
if [[ -n "${junit_filename_prefix}" ]]; then
prune-junit-xml "${junit_filename_prefix}.xml"
prune-junit-xml -prune-tests="${KUBE_PRUNE_JUNIT_TESTS}" "${junit_filename_prefix}.xml"
fi
if [[ ${KUBE_COVER} =~ ^[yY]$ ]]; then