Align systemOS watcher output with template behavior

This commit is contained in:
2026-03-27 21:30:36 -04:00
parent 6c7ba5212b
commit d383b57ccc
4 changed files with 85 additions and 16 deletions

View File

@@ -64,6 +64,29 @@ TEMPLATE_TEST_FLOWS = {
"21. Clean up iSCSI targets",
"22. Power off",
],
"cmc-systemOS": [
"1. Verifying set up",
"2. Power on and obtain ip address and host name",
"3. Uninstall CMC if still exists",
"4. Attach destination disk on the host",
"5. Copy CMC install command from GUI",
"6. Install CMC on the host",
"7. Create migration session (Simple Migration)",
"8. Tracking Changes (Simple Migration)",
"9. Finalize cutover (Simple Migration)",
"10. Create migration report (Simple Migration)",
"11. Delete migration session (Simple Migration)",
"12. Power off the host",
"13. Detach original source OS disk",
"14. Reassign destination OS disk",
"15. Power on to verify destination disk",
"16. Power off the host",
"17. Detach destination OS disk",
"18. Attach original source OS disk back",
"19. Power on and obtain ip address and host name",
"20. Uninstall CMC on the host",
"21. Power off the host",
],
}
@@ -733,6 +756,24 @@ def get_test_flow(template_name: object) -> List[str]:
return TEMPLATE_TEST_FLOWS.get(template_name, DEFAULT_TEST_FLOW)
def coverage_lines(metadata: Dict[str, object]) -> List[str]:
lines = [
f"- template: `{metadata['template']}`",
f"- categorize mode: `{'enabled' if metadata.get('categorized') else 'disabled'}`",
f"- datastore/config family: `{metadata['config_family']}`",
f"- config file: `{metadata.get('config_file', 'unknown')}`",
f"- migration style: {metadata['migration_style']}",
]
integration_plugin = metadata.get("integration_plugin")
if isinstance(integration_plugin, str) and integration_plugin and integration_plugin != "unknown":
lines.append(f"- integration/plugin path: `{integration_plugin}`")
coverage_options = list(metadata.get("extra_options", [])) if isinstance(metadata.get("extra_options"), list) else []
if metadata.get("categorized"):
coverage_options = [value for value in coverage_options if value != "--categorize"]
lines.append(f"- run options: {', '.join(f'`{value}`' for value in coverage_options) or 'none'}")
return lines
def infer_missing_host_durations(ordered_hosts: List[HostResult], end_ts: Optional[datetime]) -> None:
timed_hosts = [host for host in ordered_hosts if host.timestamp]
if not timed_hosts:
@@ -790,9 +831,7 @@ def build_status_markdown(
notes_block = "\n".join(f"- {note}" for note in notes) if notes else "- none"
test_flow_lines = [f"- {step}" for step in get_test_flow(metadata.get("template"))]
coverage_options = list(metadata.get("extra_options", [])) if isinstance(metadata.get("extra_options"), list) else []
if metadata.get("categorized"):
coverage_options = [value for value in coverage_options if value != "--categorize"]
coverage_block = coverage_lines(metadata)
lines = [
"## ATVM Run Status",
@@ -823,13 +862,7 @@ def build_status_markdown(
f"| average | {format_duration(average) if average is not None else 'n/a'} |",
"",
"**COVERAGE:**",
f"- template: `{metadata['template']}`",
f"- categorize mode: `{'enabled' if metadata.get('categorized') else 'disabled'}`",
f"- datastore/config family: `{metadata['config_family']}`",
f"- config file: `{metadata.get('config_file', 'unknown')}`",
f"- migration style: {metadata['migration_style']}",
f"- integration/plugin path: `{metadata['integration_plugin']}`",
f"- run options: {', '.join(f'`{value}`' for value in coverage_options) or 'none'}",
*coverage_block,
"",
"**TEST FLOW:**",
*test_flow_lines,
@@ -1197,9 +1230,7 @@ def discover_categorized_subruns(
elif check_ts or raw_display_name != current_subrun_build or not parent_active:
state = "FAILED" if any(result.failures for result in host_results.values()) else "COMPLETED"
notes = [f"Categorized sub-run discovered from reporter file `{xml_path.name}`."]
if summary and host_results:
notes.append("Host result details were derived from the parent categorized run log summary.")
elif check_ts and not host_results and parent_active:
if check_ts and not host_results and parent_active:
notes.append("Grouped reporter XML arrived before the parent run log exposed the final host summary; waiting to post until host details are available.")
if display_name != raw_display_name:
notes.append(f"Child build id was reported as `{raw_display_name}`, but the actual grouped run was inferred from host execution as `{display_name}`.")