Skip to content

Commit 25a4758

Browse files
committed
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.
1 parent ac3d43a commit 25a4758

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hack/make-rules/test.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ fi
8181
# Set to 'y' to keep the verbose stdout from tests when KUBE_JUNIT_REPORT_DIR is
8282
# set.
8383
KUBE_KEEP_VERBOSE_TEST_OUTPUT=${KUBE_KEEP_VERBOSE_TEST_OUTPUT:-n}
84+
# Set to 'false' to disable reduction of the JUnit file to only the top level tests.
85+
KUBE_PRUNE_JUNIT_TESTS=${KUBE_PRUNE_JUNIT_TESTS:-true}
8486

8587
kube::test::usage() {
8688
kube::log::usage_from_stdin <<EOF
@@ -234,7 +236,7 @@ runTests() {
234236
&& rc=$? || rc=$?
235237

236238
if [[ -n "${junit_filename_prefix}" ]]; then
237-
prune-junit-xml "${junit_filename_prefix}.xml"
239+
prune-junit-xml -prune-tests="${KUBE_PRUNE_JUNIT_TESTS}" "${junit_filename_prefix}.xml"
238240
fi
239241

240242
if [[ ${KUBE_COVER} =~ ^[yY]$ ]]; then

0 commit comments

Comments
 (0)