From 031e1c562c91058a665c93c16252e983d4150309 Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Mon, 1 Feb 2021 12:16:07 -0500 Subject: [PATCH] Install gotestsum if needed for junit results --- hack/make-rules/test.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hack/make-rules/test.sh b/hack/make-rules/test.sh index 729b7b3c9ea..7b8637a130f 100755 --- a/hack/make-rules/test.sh +++ b/hack/make-rules/test.sh @@ -225,9 +225,10 @@ produceJUnitXMLReport() { junit_xml_filename="${junit_filename_prefix}.xml" if ! command -v gotestsum >/dev/null 2>&1; then - kube::log::error "gotestsum not found; please cd to hack/tools and install with " \ - "GO111MODULE=on go install gotest.tools/gotestsum" - return + kube::log::status "gotestsum not found; installing from hack/tools" + pushd "${KUBE_ROOT}/hack/tools" >/dev/null + GO111MODULE=on go install gotest.tools/gotestsum + popd >/dev/null fi gotestsum --junitfile "${junit_xml_filename}" --raw-command cat "${junit_filename_prefix}"*.stdout if [[ ! ${KUBE_KEEP_VERBOSE_TEST_OUTPUT} =~ ^[yY]$ ]]; then