From 8815baab6fae0f45d2985a42f3b518b159efdfc7 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Sun, 22 Jan 2023 22:29:56 +0100 Subject: support all exit codes that autopkgtest-cloud supports Signed-off-by: Olivier Gayot --- app.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) 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("/////") 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]) -- cgit v1.2.3