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: Add edge case tests for matchesDockerIgnoredPrefix function
rcourtmana3dec60dc65d
diff --git a/internal/alerts/alerts_test.go b/internal/alerts/alerts_test.goindex 9bafd94bcf..202ce81fde 100644--- a/internal/alerts/alerts_test.go+++ b/internal/alerts/alerts_test.go@@ -1454,6 +1454,11 @@ func TestMatchesDockerIgnoredPrefix(t *testing.T) {{name: "trimmed comparison", containerName: "runner-job", containerID: "abc", prefixes: []string{" runner- "}, want: true},{name: "case insensitive", containerName: "Runner-Job", containerID: "abc", prefixes: []string{"runner-"}, want: true},{name: "no match", containerName: "service", containerID: "xyz", prefixes: []string{"runner-"}, want: false},+ {name: "skips empty prefix in list", containerName: "runner-job", containerID: "abc", prefixes: []string{"", "runner-"}, want: true},+ {name: "all empty prefixes returns false", containerName: "runner-job", containerID: "abc", prefixes: []string{"", " ", ""}, want: false},+ {name: "empty name matches id", containerName: "", containerID: "runner-123", prefixes: []string{"runner-"}, want: true},+ {name: "empty id matches name", containerName: "runner-job", containerID: "", prefixes: []string{"runner-"}, want: true},+ {name: "both empty no match", containerName: "", containerID: "", prefixes: []string{"runner-"}, want: false},}for _, tc := range tests {