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
fix(tests): resolve flaky ID generation and symlink resolution on macOS
[email protected]c86ce1629da3
diff --git a/internal/agentupdate/update_test.go b/internal/agentupdate/update_test.goindex b9ff4495b7..078a28529c 100644--- a/internal/agentupdate/update_test.go+++ b/internal/agentupdate/update_test.go@@ -369,8 +369,14 @@ func TestSymlinkResolution(t *testing.T) {t.Fatalf("EvalSymlinks failed: %v", err)}- if resolved != realFile {- t.Errorf("EvalSymlinks(%q) = %q, want %q", linkFile, resolved, realFile)+ // Normalize realFile in case tmpDir itself contains symlinks (e.g. /var -> /private/var on macOS)+ realFileResolved, err := filepath.EvalSymlinks(realFile)+ if err != nil {+ t.Fatalf("EvalSymlinks on realFile failed: %v", err)+ }++ if resolved != realFileResolved {+ t.Errorf("EvalSymlinks(%q) = %q, want %q", linkFile, resolved, realFileResolved)}// Verify temp file in same dir as resolved path allows renamediff --git a/internal/utils/helpers.go b/internal/utils/helpers.goindex 5dcb45dd56..f35136fad9 100644--- a/internal/utils/helpers.go+++ b/internal/utils/helpers.go@@ -6,12 +6,13 @@ import ("net/http""os""strings"- "time"++ "github.com/google/uuid")// GenerateID generates a unique ID with the given prefixfunc GenerateID(prefix string) string {- return fmt.Sprintf("%s-%d", prefix, time.Now().UnixNano())+ return fmt.Sprintf("%s-%s", prefix, uuid.NewString())}// WriteJSONResponse writes a JSON response to the http.ResponseWriter