From bed7f5b9e13f8eb4c4563356d85f9ee62bfbd222 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Tue, 2 Jan 2024 16:37:14 +0100 Subject: [PATCH] Prefix mtps-get-task logfile with SKIP if the task exits with one of the special exit codes This is for the viewer (generate-result-json) to be able to know that the task has been skipped, not failed. --- mtps-get-task | 7 +++++-- viewer/viewer.html | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/mtps-get-task b/mtps-get-task index 34464b2..14f3703 100755 --- a/mtps-get-task +++ b/mtps-get-task @@ -587,6 +587,7 @@ LOGS_DIR="$(realpath "$LOGS_DIR")" while true; do TESTRUN_ID="$(date +%H%M%S)" logfname="${LOGS_DIR%%/}/${TESTRUN_ID}-${TASK}-mtps-get-task.log" + logfname_skip="$(dirname "$logfname")/SKIP-$(basename "$logfname")" logfname_pass="$(dirname "$logfname")/PASS-$(basename "$logfname")" logfname_fail="$(dirname "$logfname")/FAIL-$(basename "$logfname")" if [[ -e "$logfname" || -e "$logfname_pass" || -e "$logfname_fail" ]]; then @@ -602,8 +603,10 @@ do_clean_exit() { rc=$? trap - SIGINT SIGTERM SIGABRT EXIT # clear the trap new_logfname="$logfname_fail" - if [ "$rc" = "0" ]; then + if [[ "$rc" -eq 0 ]]; then new_logfname="$logfname_pass" + elif [[ "$rc" -eq $RET_NO_RPMS_IN_BREW || "$rc" -eq $RET_NO_RPMS_IN_REPOS ]]; then + new_logfname="$logfname_skip" fi # Close tee pipes for pid in $(ps -o pid --no-headers --ppid $$); do @@ -704,7 +707,7 @@ if [ -n "$SRPM" ]; then fi if [ -z "${rpms_from_task_all}${rpms_from_task_noarch_all}" ]; then - echo "There are no x86_64/noarch RPMs for Brew task $TASK" + echo "There are no x86_64/noarch RPMs for Brew/Koji task $TASK" exit "$RET_NO_RPMS_IN_BREW" fi diff --git a/viewer/viewer.html b/viewer/viewer.html index 7d49dbd..224ba8f 100644 --- a/viewer/viewer.html +++ b/viewer/viewer.html @@ -130,7 +130,7 @@

Installability

// Compute an overall result for inspections // Return a list of { name, results: [...], result } objects - // results is a list of all occuring result types, sorted like RESULTS + // results is a list of all occurring result types, sorted like RESULTS // result is the most severe of results (i.e. last array item) function getInspectionResults(report) { const inspections = []; @@ -282,7 +282,7 @@

Installability

if (response.ok) renderResults(await response.json()); else renderError( - `Failed to fetch ${url}: ${response.status} ${response.statusText}`, + `Failed to render fetched ${url}: ${response.status} ${response.statusText}`, ); } catch (error) { renderError(`Failed to fetch ${url}: ${error}`);