Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
test(monitoring): verify firing and recovery webhook identity
pulse-triage[bot]acc1f43aafbb
diff --git a/internal/monitoring/monitor_alert_handling_test.go b/internal/monitoring/monitor_alert_handling_test.goindex de717819ed..7c61f51464 100644--- a/internal/monitoring/monitor_alert_handling_test.go+++ b/internal/monitoring/monitor_alert_handling_test.go@@ -684,8 +684,21 @@ func TestMonitor_HandleAlertResolved_SendsRecoveryForGuestPoweredOffState(t *tesalertMgr.CheckGuest(vm, vm.Instance)alertMgr.CheckGuest(vm, vm.Instance)+ // Firing uses the grouped envelope even with a zero grouping window.+ var firingPayload struct {+ Grouped bool `json:"grouped"`+ Alerts []struct {+ ID string `json:"id"`+ } `json:"alerts"`+ }select {- case <-received:+ case body := <-received:+ if err := json.Unmarshal(body, &firingPayload); err != nil {+ t.Fatalf("failed to parse firing webhook payload: %v", err)+ }+ if !firingPayload.Grouped || len(firingPayload.Alerts) != 1 {+ t.Fatalf("expected one grouped firing alert, got %+v", firingPayload)+ }case <-time.After(5 * time.Second):t.Fatalf("timed out waiting for initial powered-off notification webhook")}@@ -695,6 +708,9 @@ func TestMonitor_HandleAlertResolved_SendsRecoveryForGuestPoweredOffState(t *test.Fatalf("expected one active powered-off alert, got %#v", activeAlerts)}alertID := activeAlerts[0].ID+ if firingPayload.Alerts[0].ID != alertID {+ t.Fatalf("expected firing webhook alert ID=%q, got %q", alertID, firingPayload.Alerts[0].ID)+ }if activeAlerts[0].LastNotified == nil {t.Fatalf("expected powered-off alert %q to record firing notification time", alertID)}