fix(reboot): load runtime slo scorecard artifact
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 1m5s
CD Pipeline / post-deploy-checks (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 1m5s
CD Pipeline / post-deploy-checks (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
This commit is contained in:
@@ -71,6 +71,14 @@ PUBLIC_MAINTENANCE_RUNTIME_READY = {
|
||||
],
|
||||
}
|
||||
|
||||
_REPO_ROOT = Path(__file__).resolve().parents[3]
|
||||
_SOURCE_SCORECARD = (
|
||||
_REPO_ROOT
|
||||
/ "docs"
|
||||
/ "operations"
|
||||
/ "awoooi-reboot-auto-recovery-slo-scorecard.snapshot.json"
|
||||
)
|
||||
|
||||
|
||||
def test_reboot_auto_recovery_slo_scorecard_loader_exposes_stockplatform_gate():
|
||||
payload = load_latest_reboot_auto_recovery_slo_scorecard()
|
||||
@@ -155,6 +163,69 @@ def test_reboot_auto_recovery_slo_scorecard_overlays_runtime_scorecard_artifact(
|
||||
assert payload["rollups"]["runtime_scorecard_readback_present"] is True
|
||||
|
||||
|
||||
def test_reboot_auto_recovery_slo_scorecard_uses_latest_runtime_scorecard_from_dir(
|
||||
tmp_path,
|
||||
):
|
||||
runtime_dir = tmp_path / "reboot-recovery"
|
||||
artifact_dir = runtime_dir / "reboot-auto-recovery-slo-20260703-002055"
|
||||
artifact_dir.mkdir(parents=True)
|
||||
runtime_scorecard = json.loads(_SOURCE_SCORECARD.read_text(encoding="utf-8"))
|
||||
runtime_scorecard["generated_at"] = "2026-07-03T00:20:55+08:00"
|
||||
runtime_scorecard["active_blockers"] = [
|
||||
"all_required_hosts_not_in_10_minute_reboot_window",
|
||||
"conversation_event_hot_path_index_migration_source_missing",
|
||||
"host_boot_observation_older_than_target_window",
|
||||
"host_unreachable_after_reboot",
|
||||
"host_uptime_unknown",
|
||||
"public_maintenance_fallback_runtime_readback_missing",
|
||||
"reboot_event_required_host_unreachable",
|
||||
"windows99_vmware_autostart_readback_missing",
|
||||
]
|
||||
runtime_scorecard["windows99_management_channel"]["ssh_users"] = [
|
||||
"administrator",
|
||||
"wooo",
|
||||
]
|
||||
runtime_scorecard["windows99_management_channel"]["ssh_batch_candidates"] = [
|
||||
{
|
||||
"user": "administrator",
|
||||
"checked": True,
|
||||
"ready": False,
|
||||
"status": "permission_denied",
|
||||
},
|
||||
{
|
||||
"user": "wooo",
|
||||
"checked": True,
|
||||
"ready": False,
|
||||
"status": "permission_denied",
|
||||
},
|
||||
]
|
||||
(artifact_dir / "scorecard.json").write_text(
|
||||
json.dumps(runtime_scorecard),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
payload = load_latest_reboot_auto_recovery_slo_scorecard(
|
||||
runtime_scorecard_dir=runtime_dir,
|
||||
public_maintenance_runtime_dir=runtime_dir,
|
||||
)
|
||||
|
||||
assert payload["runtime_scorecard_readback_present"] is True
|
||||
assert payload["runtime_scorecard_generated_at"] == (
|
||||
"2026-07-03T00:20:55+08:00"
|
||||
)
|
||||
assert payload["snapshot_generated_at"] == "2026-07-02T15:08:44+08:00"
|
||||
assert payload["active_blocker_count"] == 8
|
||||
assert payload["readback"]["runtime_scorecard_source_ref"].endswith(
|
||||
"reboot-auto-recovery-slo-20260703-002055/scorecard.json"
|
||||
)
|
||||
assert (
|
||||
payload["windows99_management_channel"]["ssh_batch_candidates"][1][
|
||||
"user"
|
||||
]
|
||||
== "wooo"
|
||||
)
|
||||
|
||||
|
||||
def test_reboot_auto_recovery_slo_scorecard_endpoint_returns_readback(monkeypatch):
|
||||
monkeypatch.setattr(
|
||||
agents,
|
||||
|
||||
Reference in New Issue
Block a user