From 6f387b78486c25af9975275e342ec1f3d5bd5c39 Mon Sep 17 00:00:00 2001 From: Guilherme Gallo Date: Tue, 19 Jul 2022 22:13:20 -0300 Subject: [PATCH] ci/skqp: Show reports on crashes Some skqp tests may crash the entire job run, assure that the reports will be showed to the user after the test started to run. Signed-off-by: Guilherme Gallo Part-of: --- .gitlab-ci/skqp-runner.sh | 59 +++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/.gitlab-ci/skqp-runner.sh b/.gitlab-ci/skqp-runner.sh index 5f8199c2283..02b604c96d6 100755 --- a/.gitlab-ci/skqp-runner.sh +++ b/.gitlab-ci/skqp-runner.sh @@ -96,6 +96,35 @@ setup_backends() { fi } +show_reports() ( + set +xe + + # Unit tests produce empty HTML reports, guide the user to check the TXT file. + if echo "${SKQP_BACKENDS}" | grep -qE "unitTest" + then + # Remove the empty HTML report to avoid confusion + rm -f "${SKQP_RESULTS_DIR}"/unitTest/report.html + + echo "See skqp unit test results at:" + echo "https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/${SKQP_RESULTS_DIR}/unitTest/unit_tests.txt" + fi + + REPORT_FILES=$(mktemp) + find "${SKQP_RESULTS_DIR}"/**/report.html -type f > "${REPORT_FILES}" + while read -r REPORT + do + BACKEND_NAME=$(echo "${REPORT}" | sed 's@.*/\([^/]*\)/report.html@\1@') + echo "See skqp ${BACKEND_NAME} render tests report at:" + echo "https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/${REPORT}" + done < "${REPORT_FILES}" + + # If there is no report available, tell the user that something is wrong. + if [ ! -s "${REPORT_FILES}" ] + then + echo "No skqp report available. Probably some fatal error has occured during the skqp execution." + fi +) + usage() { cat < "${REPORT_FILES}" -while read -r REPORT -do - BACKEND_NAME=$(echo "${REPORT}" | sed 's@.*/\([^/]*\)/report.html@\1@') - echo "See skqp ${BACKEND_NAME} render tests report at:" - echo "https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/${REPORT}" -done < "${REPORT_FILES}" - -# If there is no report available, tell the user that something is wrong. -if [ ! -s "${REPORT_FILES}" ] -then - echo "No skqp report available. Probably some fatal error has occured during the skqp execution." -fi - exit $SKQP_EXITCODE