ci/lava: Fix LAVA lima jobs

lima uses a different version from other farms, where some log output
patches were not delivery yet, so let's use a temporary fix to make
those job traces look as nice as the other ones.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33994>
This commit is contained in:
Guilherme Gallo
2025-03-09 19:02:53 -03:00
committed by Marge Bot
parent ad90dbabe4
commit 0330522e99
+20
View File
@@ -262,6 +262,8 @@ class LogFollower:
prefix = "$ "
suffix = ""
elif line["lvl"] == "target" and self.lava_farm != "collabora":
if self.lava_farm == "lima":
fix_lava_color_log(line)
# gl_section_fix_gen will output the stored line if it can't find a
# match for the first split line
# So we can recover it and put it back to the buffer
@@ -270,6 +272,24 @@ class LogFollower:
return f'{prefix}{line["msg"]}{suffix}'
def fix_lava_color_log(line):
"""This function is a temporary solution for the color escape codes mangling
problem. There is some problem in message passing between the LAVA
dispatcher and the device under test (DUT). Here \x1b character is missing
before `[:digit::digit:?m` ANSI TTY color codes. When this problem is fixed
on the LAVA side, one should remove this function.
Note: most LAVA farms don't have this problem, except for Lima, which uses
an older version of LAVA.
"""
line["msg"] = re.sub(r"(\[\d{1,2}m)", "\x1b" + r"\1", line["msg"])
# Also fix ANSI escape codes mangling
line["msg"] = re.sub(r"(\[0K)", "\x1b" + r"\1", line["msg"])
# Also fix ANSI color codes mangling
line["msg"] = re.sub(r"(\[0;3\d{1,2}m)", "\r\x1b" + r"\1", line["msg"])
def fix_lava_gitlab_section_log():
"""This function is a temporary solution for the Gitlab section markers
splitting problem. Gitlab parses the following lines to define a collapsible