ci/ci_run_n_monitor: print stress test results per job

Since we can monitor multiple jobs, print the result of the stress test
per job name.

Signed-off-by: Helen Koike <helen.koike@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25473>
This commit is contained in:
Helen Koike
2023-09-29 10:17:29 -03:00
committed by Marge Bot
parent f93b11822a
commit f838499901

View File

@@ -17,6 +17,7 @@ import re
from subprocess import check_output from subprocess import check_output
import sys import sys
import time import time
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor from concurrent.futures import ThreadPoolExecutor
from functools import partial from functools import partial
from itertools import chain from itertools import chain
@@ -99,8 +100,7 @@ def monitor_pipeline(
"""Monitors pipeline and delegate canceling jobs""" """Monitors pipeline and delegate canceling jobs"""
statuses = {} statuses = {}
target_statuses = {} target_statuses = {}
stress_succ = 0 stress_status_counter = defaultdict(lambda: defaultdict(int))
stress_fail = 0
if target_job: if target_job:
target_jobs_regex = re.compile(target_job.strip()) target_jobs_regex = re.compile(target_job.strip())
@@ -114,10 +114,7 @@ def monitor_pipeline(
enable_job(project, job, True) enable_job(project, job, True)
if stress and job.status in ["success", "failed"]: if stress and job.status in ["success", "failed"]:
if job.status == "success": stress_status_counter[job.name][job.status] += 1
stress_succ += 1
if job.status == "failed":
stress_fail += 1
retry_job(project, job) retry_job(project, job)
if (job.id not in target_statuses) or ( if (job.id not in target_statuses) or (
@@ -152,10 +149,13 @@ def monitor_pipeline(
cancel_jobs(project, to_cancel) cancel_jobs(project, to_cancel)
if stress: if stress:
print( for job_name, status in stress_status_counter.items():
"∑ succ: " + str(stress_succ) + "; fail: " + str(stress_fail), print(
flush=False, f"{job_name}\tsucc: {status['success']}; "
) f"fail: {status['failed']}; "
f"total: {sum(status.values())}",
flush=False,
)
pretty_wait(REFRESH_WAIT_JOBS) pretty_wait(REFRESH_WAIT_JOBS)
continue continue