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