Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

viewer (generate-result-json) related updates #34

Merged
merged 3 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion mini-tps.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name: mini-tps
Version: 0.1
Release: 163%{?dist}
Release: 164%{?dist}
Summary: Mini TPS - Test Package Sanity

License: GPLv2
Expand Down Expand Up @@ -64,6 +64,9 @@ install -pD -m 0755 profiles/fedora/prepare-system %{buildroot}%{_libexecdir}/mi


%changelog
* Tue Jan 02 2024 Jiri Popelka <[email protected]> - 0.1-164
- viewer (generate-result-json) related updates

* Thu Dec 07 2023 Jiri Popelka <[email protected]> - 0.1-163
- Remove the Requires: python-gobject-base
- Move Requires: to mini-tps.conf
Expand Down
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
2 changes: 1 addition & 1 deletion viewer/generate-result-json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import json
from collections import defaultdict
from pathlib import Path

RESULTS_MAPPING = {"PASS": "OK", "WARN": "INFO", "FAIL": "BAD"}
RESULTS_MAPPING = {"SKIP": "SKIP", "PASS": "OK", "WARN": "INFO", "FAIL": "BAD"}

mtps_log_dir = Path(sys.argv[1])

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