ci/lava: Color red for fatal and yellow for warning

Fatal errors now have red foreground color and retry messages yellow
one.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17389>
This commit is contained in:
Guilherme Gallo 2022-07-06 23:22:09 -03:00 committed by Marge Bot
parent daff21ef55
commit 84abb3df13
2 changed files with 8 additions and 9 deletions

View File

@ -357,17 +357,13 @@ def fetch_logs(job, max_idle_time, log_follower) -> None:
# silence means that the device has died and we should try it again
if datetime.now() - job.last_log_time > max_idle_time:
max_idle_time_min = max_idle_time.total_seconds() / 60
print_log(
f"{CONSOLE_LOG['BOLD']}"
f"{CONSOLE_LOG['FG_RED']}"
f"No log output for {max_idle_time_min} minutes; "
"assuming device has died, retrying"
f"{CONSOLE_LOG['RESET']}"
)
raise MesaCITimeoutError(
f"{CONSOLE_LOG['BOLD']}"
f"{CONSOLE_LOG['FG_YELLOW']}"
f"LAVA job {job.job_id} does not respond for {max_idle_time_min} "
"minutes. Retry.",
"minutes. Retry."
f"{CONSOLE_LOG['RESET']}",
timeout_duration=max_idle_time,
)

View File

@ -207,7 +207,10 @@ def print_log(msg):
def fatal_err(msg):
print_log(msg)
colored_msg = f"{CONSOLE_LOG['FG_RED']}"
f"{msg}"
f"{CONSOLE_LOG['RESET']}"
print_log(colored_msg)
sys.exit(1)