(t *testing.T)
| 459 | } |
| 460 | |
| 461 | func getManifests(t *testing.T) map[string]*snapshot.Manifest { |
| 462 | t.Helper() |
| 463 | |
| 464 | // manifests store snapshot manifests based on start-time |
| 465 | manifests := make(map[string]*snapshot.Manifest, 3) |
| 466 | |
| 467 | src := getSnapshotSource() |
| 468 | snapshotTime := time.Date(2025, 1, 1, 0, 0, 0, 0, time.UTC) |
| 469 | |
| 470 | rootEntry1 := snapshot.DirEntry{ |
| 471 | ObjectID: oidForString(t, "", "indexID1"), |
| 472 | } |
| 473 | |
| 474 | rootEntry2 := snapshot.DirEntry{ |
| 475 | ObjectID: oidForString(t, "", "indexID2"), |
| 476 | } |
| 477 | |
| 478 | manifests["initial_snapshot"] = &snapshot.Manifest{ |
| 479 | ID: "manifest_1_id", |
| 480 | Source: src, |
| 481 | StartTime: fs.UTCTimestamp(snapshotTime.Add((-24) * time.Hour).UnixNano()), |
| 482 | Description: "snapshot captured a day ago", |
| 483 | RootEntry: &rootEntry2, |
| 484 | } |
| 485 | |
| 486 | manifests["intermediate_snapshot"] = &snapshot.Manifest{ |
| 487 | ID: "manifest_2_id", |
| 488 | Source: src, |
| 489 | StartTime: fs.UTCTimestamp(snapshotTime.Add(-time.Hour).UnixNano()), |
| 490 | Description: "snapshot taken an hour ago", |
| 491 | RootEntry: &rootEntry2, |
| 492 | } |
| 493 | |
| 494 | manifests["latest_snapshot"] = &snapshot.Manifest{ |
| 495 | ID: "manifest_3_id", |
| 496 | Source: src, |
| 497 | StartTime: fs.UTCTimestamp(snapshotTime.UnixNano()), |
| 498 | Description: "latest snapshot", |
| 499 | RootEntry: &rootEntry1, |
| 500 | } |
| 501 | |
| 502 | return manifests |
| 503 | } |
| 504 | |
| 505 | // Tests GetPrecedingSnapshot function |
| 506 | // - GetPrecedingSnapshot with an invalid snapshot id and expect an error; |
no test coverage detected