Simplify ATVM host detail reporting
This commit is contained in:
@@ -711,6 +711,28 @@ def summarize_host_detail_with_mochawesome(detail: str, testcase: str, message:
|
||||
return f"{prefix} - {testcase_summary} - {message_summary}"
|
||||
|
||||
|
||||
def display_host_detail(host: HostResult) -> str:
|
||||
detail = (host.detail or "").strip()
|
||||
if host.status == "PASS":
|
||||
return "completed"
|
||||
if host.status in {"RUN", "NOT STARTED"}:
|
||||
return "in progress"
|
||||
if host.status == "FAIL":
|
||||
detail = re.sub(
|
||||
r"^\d+\s+tests?,\s+\d+\s+failures?(?:,\s+\d+\s+pending)?\s*-\s*",
|
||||
"",
|
||||
detail,
|
||||
flags=re.I,
|
||||
)
|
||||
detail = re.sub(r"^\d+\s+failures?\s*-\s*", "", detail, flags=re.I)
|
||||
if re.fullmatch(r"\d+\s+tests?,\s+\d+\s+failures?(?:,\s+\d+\s+pending)?", detail, flags=re.I):
|
||||
return "failed"
|
||||
if re.fullmatch(r"\d+\s+failures?", detail, flags=re.I):
|
||||
return "failed"
|
||||
return detail or "failed"
|
||||
return detail
|
||||
|
||||
|
||||
def extract_host_results_from_run_finished_segment(segment_text: str, inventory: Dict[str, str]) -> Dict[str, HostResult]:
|
||||
host_results: Dict[str, HostResult] = {}
|
||||
# Currents can wrap the trailing "s" in long duration cells onto its own table row.
|
||||
@@ -1536,7 +1558,7 @@ def build_status_markdown(
|
||||
"SKIP": "⏭️ SKIP",
|
||||
"NOT STARTED": "⏳ RUN",
|
||||
}.get(host.status, host.status)
|
||||
host_lines.append(f"| {host.host} | {host.kernel} | {icon} | {host.detail} |")
|
||||
host_lines.append(f"| {host.host} | {host.kernel} | {icon} | {display_host_detail(host)} |")
|
||||
|
||||
if currents_url:
|
||||
notes = notes + [f"Currents recorded run: `{currents_url}`"]
|
||||
|
||||
Reference in New Issue
Block a user