Add backup diagnostics snapshots tasks and homelab map
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user