Enhance snapshot handling by backfilling provisioned disk data and updating backfill logic
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -104,3 +104,19 @@ func TestBackfillSnapshotRowFromHourlyCacheNoMatch(t *testing.T) {
|
||||
t.Fatal("expected no backfill change for missing VM")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNeedsSnapshotBackfillIgnoresDiskOnlyGap(t *testing.T) {
|
||||
row := InventorySnapshotRow{
|
||||
CreationTime: sql.NullInt64{Int64: 100, Valid: true},
|
||||
VcpuCount: sql.NullInt64{Int64: 2, Valid: true},
|
||||
RamGB: sql.NullInt64{Int64: 8, Valid: true},
|
||||
Cluster: sql.NullString{String: "cluster-a", Valid: true},
|
||||
Datacenter: sql.NullString{String: "dc-a", Valid: true},
|
||||
SrmPlaceholder: "FALSE",
|
||||
VmUuid: sql.NullString{String: "uuid-1", Valid: true},
|
||||
// ProvisionedDisk intentionally missing.
|
||||
}
|
||||
if needsSnapshotBackfill(row) {
|
||||
t.Fatal("expected disk-only gap to be non-critical for sparse-row detection")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user