From d43fec5da96eda1a83cd98beeca85e688ff99d85 Mon Sep 17 00:00:00 2001 From: Vignesh Raman Date: Tue, 8 Oct 2024 12:00:31 +0530 Subject: [PATCH] ci/lava: set exit code in exception case Set exit_code to 1 in case of an exception; otherwise, the job exits with 0, and GitLab shows the job as successful. Fixes: b9cee06f9e1 ("ci/lava: handle non-zero exit codes") Signed-off-by: Vignesh Raman Part-of: --- .gitlab-ci/lava/utils/lava_job.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci/lava/utils/lava_job.py b/.gitlab-ci/lava/utils/lava_job.py index a1f0abaa00f..f7b0464735a 100644 --- a/.gitlab-ci/lava/utils/lava_job.py +++ b/.gitlab-ci/lava/utils/lava_job.py @@ -183,6 +183,9 @@ class LAVAJob: self.cancel() self.exception = exception + # Set the exit code to nonzero value + self.exit_code = 1 + # Give more accurate status depending on exception if isinstance(exception, MesaCIKnownIssueException): self.status = "canceled"