Skip to content

Commit

Permalink
Prefix mtps-get-task logfile with SKIP if the task exits with one of …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
jpopelka committed Jan 3, 2024
1 parent 0f66a91 commit bed7f5b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions mtps-get-task
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions viewer/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ <h2>Installability</h2>

// 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 = [];
Expand Down Expand Up @@ -282,7 +282,7 @@ <h2>Installability</h2>
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}`);
Expand Down

0 comments on commit bed7f5b

Please sign in to comment.