ci/lava: Fix Gitlab section rendering
authorGuilherme Gallo <guilherme.gallo@collabora.com>
Thu, 24 Nov 2022 06:06:58 +0000 (03:06 -0300)
committerMarge Bot <emma+marge@anholt.net>
Wed, 21 Dec 2022 12:44:49 +0000 (12:44 +0000)
commit584762c216894a8cba804af9d79a12bb21ceb282
treeb0a6b237bceeb52d1d5e34bb42058be7f7352f64
parentf040122bedb64bb6f4c26d7e272da874ae7f9a05
ci/lava: Fix Gitlab section rendering

LAVA splits the DUT log lines with `\r` in them. Unfortunately, it
breaks the Gitlab section line syntax when the HWCI script calls it
since it is a oneliner.

This commit changes the` fix_lava_gitlab_section_log` function to a
stateful generator that can merge lines that respects two consecutive
patterns.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7703

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20051>
.gitlab-ci/lava/utils/log_follower.py
.gitlab-ci/tests/utils/test_lava_log.py