Skip to content

Commit ce9d560

Browse files
[release-1.27] Fix junit report generation (#1221)
* Fix junit report generation Fix the junit report generation for every test run for our e2e test execution Signed-off-by: Francisco Herrera <[email protected]> * Fix lint Fixing lint error Signed-off-by: Francisco Herrera <[email protected]> --------- Signed-off-by: Francisco Herrera <[email protected]> Co-authored-by: Francisco Herrera <[email protected]>
1 parent ca25e95 commit ce9d560

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/e2e/common-operator-integ-suite.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,15 @@ if [ "${OLM}" != "true" ] && [ "${SKIP_DEPLOY}" != "true" ]; then
230230
fi
231231
fi
232232

233+
set +e
234+
# Disable to avoid fail the test run and not generate the report.xml
235+
# We need to catch the exit code to be able to generate the report
233236
# shellcheck disable=SC2086
234237
IMAGE="${HUB}/${IMAGE_BASE}:${TAG}" \
235238
go run github.com/onsi/ginkgo/v2/ginkgo -tags e2e \
236-
--timeout 60m --junit-report=report.xml ${GINKGO_FLAGS} "${WD}"/...
239+
--timeout 60m --junit-report="${ARTIFACTS}/report.xml" ${GINKGO_FLAGS:-} "${WD}"/...
240+
TEST_EXIT_CODE=$?
241+
set -e
237242

238243
if [ "${OLM}" != "true" ] && [ "${SKIP_DEPLOY}" != "true" ]; then
239244
if [ "${MULTICLUSTER}" == true ]; then
@@ -244,3 +249,6 @@ if [ "${OLM}" != "true" ] && [ "${SKIP_DEPLOY}" != "true" ]; then
244249
fi
245250
fi
246251

252+
253+
echo "JUnit report: ${ARTIFACTS}/report.xml"
254+
exit ${TEST_EXIT_CODE}

0 commit comments

Comments
 (0)