summaryrefslogtreecommitdiff
path: root/.gitlab-ci/lava/lava_job_submitter.py
diff options
context:
space:
mode:
authorGuilherme Gallo <guilherme.gallo@collabora.com>2022-03-24 20:32:06 -0300
committerMarge Bot <emma+marge@anholt.net>2022-07-07 00:28:53 +0000
commitc86ba3640f225cf7bf36230402b801eef15fc495 (patch)
tree79e2526d26528580756acd8a90a4db7af76c2d30 /.gitlab-ci/lava/lava_job_submitter.py
parent3831079fdf2801f862a4a5eaf4a8692398f7651e (diff)
downloadmesa-c86ba3640f225cf7bf36230402b801eef15fc495.tar.gz
ci/lava: Create Gitlab log sections handler
Gitlab has support for collapsible sections, so it would be good to create collapsed log sections for the LAVA setup logs. This way, the Mesa developers to see only the execution of the scripts, instead of LAVA messages clutter. Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16323>
Diffstat (limited to '.gitlab-ci/lava/lava_job_submitter.py')
-rwxr-xr-x.gitlab-ci/lava/lava_job_submitter.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/.gitlab-ci/lava/lava_job_submitter.py b/.gitlab-ci/lava/lava_job_submitter.py
index 9eba34c8820..3f5a7f3a816 100755
--- a/.gitlab-ci/lava/lava_job_submitter.py
+++ b/.gitlab-ci/lava/lava_job_submitter.py
@@ -46,6 +46,7 @@ from lava.exceptions import (
MesaCIRetryError,
MesaCITimeoutError,
)
+from lava.utils.lava_log import GitlabSection
from lavacli.utils import loader
# Timeout in seconds to decide if the device from the dispatched LAVA job has
@@ -140,7 +141,10 @@ def generate_lava_yaml(args):
# skeleton test definition: only declaring each job as a single 'test'
# since LAVA's test parsing is not useful to us
- run_steps = []
+ setup_section = GitlabSection(
+ id="lava_setup", header="LAVA setup log", start_collapsed=True
+ )
+ run_steps = [f"printf '{setup_section.start()}'"]
test = {
'timeout': { 'minutes': args.job_timeout },
'failure_retry': 1,
@@ -191,6 +195,8 @@ def generate_lava_yaml(args):
'mkdir -p {}'.format(args.ci_project_dir),
'wget -S --progress=dot:giga -O- {} | tar -xz -C {}'.format(args.build_url, args.ci_project_dir),
'wget -S --progress=dot:giga -O- {} | tar -xz -C /'.format(args.job_rootfs_overlay_url),
+ f"printf '{setup_section.end()}'",
+
# Putting CI_JOB name as the testcase name, it may help LAVA farm
# maintainers with monitoring
f"lava-test-case 'mesa-ci_{args.mesa_job_name}' --shell /init-stage2.sh",