Skip to content

Commit f905436

Browse files
[CI] Make dispatch_job.py fail of build failed
Otherwise the job always gets marked as succeeding on the buildbot side.
1 parent f1bfa38 commit f905436

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

zorg/buildbot/builders/annotated/premerge/dispatch_job.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,14 @@ def main(commit_sha: str, platform: str):
248248
logging.error(f"Failed to get logs from the pod: {log_exception}")
249249
break
250250
time.sleep(SECONDS_QUERY_LOGS_EVERY)
251+
pod_status = get_pod_status(pod_name, namespace, v1_api)
251252
v1_api.delete_namespaced_pod(pod_name, namespace)
253+
if pod_status == "Succeeded":
254+
print("Job Succeeded.")
255+
sys.exit(0)
256+
else:
257+
print("Job Failed.")
258+
sys.exit(1)
252259

253260

254261
if __name__ == "__main__":

0 commit comments

Comments
 (0)