Add backup diagnostics snapshots tasks and homelab map

This commit is contained in:
Maxim
2026-08-01 13:50:58 +03:00
parent 92607f62d5
commit f1356fec37
7 changed files with 306 additions and 17 deletions

View File

@@ -12,4 +12,15 @@ func TestLatestBackups(t *testing.T) {
if len(latest) != 2 || latest[0].Storage != "new" {
t.Fatalf("неожиданный список последних копий: %+v", latest)
}
if latest[0].PreviousSizeBytes != 0 {
t.Fatalf("unexpected previous size: %+v", latest[0])
}
}
func TestLatestBackupsComparesSize(t *testing.T) {
items := []BackupItem{{VMID: 100, CreatedAt: 20, SizeBytes: 120}, {VMID: 100, CreatedAt: 10, SizeBytes: 100}}
latest := latestBackups(items)
if len(latest) != 1 || latest[0].SizeChangePercent == nil || *latest[0].SizeChangePercent != 20 {
t.Fatalf("unexpected comparison: %+v", latest)
}
}