File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -241,6 +241,34 @@ if [ "${TEST_OUTPUT_FORMAT}" == "junit" ]; then
241241 setup_junit_report
242242 " ${base_cmd[@]} " 2>&1 | tee >( " ${JUNIT_REPORT} " > " ${ARTIFACTS_DIR} /junit/junit.xml" )
243243 test_status=${PIPESTATUS[0]}
244+
245+ elif [ " ${TEST_OUTPUT_FORMAT} " == " gotestsum" ]; then
246+ echo " Using gotestsum to run tests and generate junit report"
247+ # Install gotestsum if not already available
248+ if ! command -v gotestsum & > /dev/null; then
249+ go install gotest.tools/gotestsum@latest
250+ # Get Go binary path (prefer GOBIN, fallback to GOPATH/bin)
251+ gobin=$( go env GOBIN 2> /dev/null)
252+ if [ -z " $gobin " ]; then
253+ gobin=" $( go env GOPATH) /bin"
254+ fi
255+ export PATH=" $gobin :$PATH "
256+ fi
257+
258+ mkdir -p " ${JUNIT_REPORT_DIR} "
259+
260+ gotestsum \
261+ -f testname \
262+ --junitfile-project-name istio \
263+ --junitfile " ${JUNIT_REPORT_DIR} /junit.xml" \
264+ --rerun-fails \
265+ --rerun-fails-max-failures=3 \
266+ --packages " ${TEST_PATH[@]} " \
267+ --debug \
268+ -- " ${base_cmd[@]: 5} "
269+
270+ test_status=$?
271+
244272else
245273 " ${base_cmd[@]} "
246274 test_status=$?
You can’t perform that action at this time.
0 commit comments