From d9d7972b24de6022c7079f8721fd8335c3319dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Piotrowski?= Date: Fri, 20 Oct 2023 09:52:58 +0200 Subject: [PATCH] client: Re-fetch build/extended to see check jobs status --- flat-manager-client | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/flat-manager-client b/flat-manager-client index 822b9b0..981a361 100755 --- a/flat-manager-client +++ b/flat-manager-client @@ -466,7 +466,6 @@ async def wait_for_checks(session, build_url, token): async with resp: if resp.status == 404: return - if resp.status >= 500: raise ServerApiError(resp, await resp.text()) elif resp.status != 200: @@ -479,6 +478,21 @@ async def wait_for_checks(session, build_url, token): job_url = build_url + "/check/" + check["check_name"] + "/job" await wait_for_job(session, job_url, token) + resp = await session.get(build_url + "/extended", headers={'Authorization': 'Bearer ' + token}) + async with resp: + if resp.status == 404: + return + if resp.status >= 500: + raise ServerApiError(resp, await resp.text()) + elif resp.status != 200: + raise ApiError(resp, await resp.text()) + + build = await resp.json() + for check in build["checks"]: + if check["status"] == 2: + print("\ Check {} has failed".format(check["check_name"])) + raise FailedJobError(check) + @retry( stop=TENACITY_STOP_AFTER, wait=TENACITY_WAIT_BETWEEN,