summaryrefslogtreecommitdiff
path: root/app.py
diff options
context:
space:
mode:
Diffstat (limited to 'app.py')
-rw-r--r--app.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/app.py b/app.py
index e221686..f4022ea 100644
--- a/app.py
+++ b/app.py
@@ -85,6 +85,25 @@ def index_release(LPUSER, PPA, PACKAGE, RELEASE):
base_url=flask.request.base_url)
+
+
+def human_exitcode(code: int):
+ if code in (0, 2):
+ return 'pass'
+ if code in (4, 6, 12):
+ return 'fail'
+ if code in (8,):
+ return 'neutral'
+ if code == 99:
+ return 'denylisted'
+ if code == 16:
+ return 'tmpfail'
+ if code == 20:
+ return 'error'
+ return 'exit code %i' % code
+
+
+
@app.route("/<LPUSER>/<PPA>/<PACKAGE>/<RELEASE>/<ARCH>")
def index_results(LPUSER, PPA, PACKAGE, RELEASE, ARCH):
@@ -125,7 +144,7 @@ def index_results(LPUSER, PPA, PACKAGE, RELEASE, ARCH):
"date": date,
"duration": duration,
"requester": requester,
- "result": "pass" if exitcode == 0 else "fail",
+ "result": human_exitcode(exitcode),
"url_prefix": f"{autopkgtest_url_base}/{idx}",
}
package_results.append([result[h] for h in headers])