From a78f01a76d2c5b4664f37e0804be3530e7ea8586 Mon Sep 17 00:00:00 2001 From: Rajalakshmi-Girish Date: Mon, 28 Jun 2021 08:25:08 +0000 Subject: [PATCH] Make Junit report success callout message conditional --- scripts/test_lib.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/test_lib.sh b/scripts/test_lib.sh index 6a27e0591b4..b1d35ba004f 100644 --- a/scripts/test_lib.sh +++ b/scripts/test_lib.sh @@ -238,11 +238,16 @@ function produce_junit_xmlreport { popd >/dev/null || return fi gotestsum --junitfile "${junit_xml_filename}" --raw-command cat "${junit_filename_prefix}"*.stdout + local cmd_code=$? if [ "${VERBOSE}" != "1" ]; then rm "${junit_filename_prefix}"*.stdout fi - log_callout "Saved JUnit XML test report to ${junit_xml_filename}" + if [ ${cmd_code} -ne 0 ]; then + log_error "gotestsum failed and did not generate JUnit XML test report" + else + log_callout "Saved JUnit XML test report to ${junit_xml_filename}" + fi }