Mesa (main): ci/lava: Fix LAVA job validation
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Apr 28 07:34:16 UTC 2022
Module: Mesa
Branch: main
Commit: 75410c3d76f0e39d32f8c05fe094c14b0023dfbd
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=75410c3d76f0e39d32f8c05fe094c14b0023dfbd
Author: Guilherme Gallo <guilherme.gallo at collabora.com>
Date: Wed Mar 23 19:26:47 2022 -0300
ci/lava: Fix LAVA job validation
When jobs.validate returns something, it means that there is a dict
filled with the error message, so we were running the job with some
validation errors for a quite while
Signed-off-by: Guilherme Gallo <guilherme.gallo at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15938>
---
.gitlab-ci/lava/lava_job_submitter.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/.gitlab-ci/lava/lava_job_submitter.py b/.gitlab-ci/lava/lava_job_submitter.py
index 11ee4650887..ba4c2cef795 100755
--- a/.gitlab-ci/lava/lava_job_submitter.py
+++ b/.gitlab-ci/lava/lava_job_submitter.py
@@ -33,6 +33,7 @@ import urllib.parse
import xmlrpc
from datetime import datetime, timedelta
from os import getenv
+from typing import Optional
import lavacli
import yaml
@@ -226,7 +227,7 @@ class LAVAJob():
def heartbeat(self):
self.last_log_time = datetime.now()
- def validate(self):
+ def validate(self) -> Optional[dict]:
try:
return _call_proxy(
self.proxy.scheduler.jobs.validate, self.definition, True
@@ -386,7 +387,7 @@ def main(args):
if args.validate_only:
job = LAVAJob(proxy, job_definition)
ret = job.validate()
- if not ret:
+ if ret:
fatal_err("Error in LAVA job definition")
print("LAVA job definition validated successfully")
return
More information about the mesa-commit
mailing list