@@ -240,6 +240,55 @@ func TestDescribePodVolumeBackupsInSF(t *testing.T) {
240240 PodNamespace ("pod-ns-1" ).
241241 SnapshotID ("snap-2" ).Result ()
242242
243+ pvb3 := builder .ForPodVolumeBackup ("test-ns1" , "test-pvb3" ).
244+ UploaderType ("kopia" ).
245+ Phase (velerov1api .PodVolumeBackupPhaseFailed ).
246+ BackupStorageLocation ("bsl-1" ).
247+ Volume ("vol-3" ).
248+ PodName ("pod-3" ).
249+ PodNamespace ("pod-ns-1" ).
250+ SnapshotID ("snap-3" ).Result ()
251+ pvb4 := builder .ForPodVolumeBackup ("test-ns1" , "test-pvb4" ).
252+ UploaderType ("kopia" ).
253+ Phase (velerov1api .PodVolumeBackupPhaseCanceled ).
254+ BackupStorageLocation ("bsl-1" ).
255+ Volume ("vol-4" ).
256+ PodName ("pod-4" ).
257+ PodNamespace ("pod-ns-1" ).
258+ SnapshotID ("snap-4" ).Result ()
259+ pvb5 := builder .ForPodVolumeBackup ("test-ns1" , "test-pvb5" ).
260+ UploaderType ("kopia" ).
261+ Phase (velerov1api .PodVolumeBackupPhaseInProgress ).
262+ BackupStorageLocation ("bsl-1" ).
263+ Volume ("vol-5" ).
264+ PodName ("pod-5" ).
265+ PodNamespace ("pod-ns-1" ).
266+ SnapshotID ("snap-5" ).Result ()
267+ pvb6 := builder .ForPodVolumeBackup ("test-ns1" , "test-pvb6" ).
268+ UploaderType ("kopia" ).
269+ Phase (velerov1api .PodVolumeBackupPhaseCanceling ).
270+ BackupStorageLocation ("bsl-1" ).
271+ Volume ("vol-6" ).
272+ PodName ("pod-6" ).
273+ PodNamespace ("pod-ns-1" ).
274+ SnapshotID ("snap-6" ).Result ()
275+ pvb7 := builder .ForPodVolumeBackup ("test-ns1" , "test-pvb7" ).
276+ UploaderType ("kopia" ).
277+ Phase (velerov1api .PodVolumeBackupPhasePrepared ).
278+ BackupStorageLocation ("bsl-1" ).
279+ Volume ("vol-7" ).
280+ PodName ("pod-7" ).
281+ PodNamespace ("pod-ns-1" ).
282+ SnapshotID ("snap-7" ).Result ()
283+ pvb8 := builder .ForPodVolumeBackup ("test-ns1" , "test-pvb6" ).
284+ UploaderType ("kopia" ).
285+ Phase (velerov1api .PodVolumeBackupPhaseAccepted ).
286+ BackupStorageLocation ("bsl-1" ).
287+ Volume ("vol-8" ).
288+ PodName ("pod-8" ).
289+ PodNamespace ("pod-ns-1" ).
290+ SnapshotID ("snap-8" ).Result ()
291+
243292 testcases := []struct {
244293 name string
245294 inputPVBList []velerov1api.PodVolumeBackup
@@ -268,6 +317,40 @@ func TestDescribePodVolumeBackupsInSF(t *testing.T) {
268317 },
269318 },
270319 },
320+ {
321+ name : "all phases" ,
322+ inputPVBList : []velerov1api.PodVolumeBackup {* pvb1 , * pvb2 , * pvb3 , * pvb4 , * pvb5 , * pvb6 , * pvb7 , * pvb8 },
323+ inputDetails : true ,
324+ expect : map [string ]any {
325+ "podVolumeBackups" : map [string ]any {
326+ "podVolumeBackupsDetails" : map [string ]any {
327+ "Completed" : []map [string ]string {
328+ {"pod-ns-1/pod-1" : "vol-1" },
329+ {"pod-ns-1/pod-2" : "vol-2" },
330+ },
331+ "Failed" : []map [string ]string {
332+ {"pod-ns-1/pod-3" : "vol-3" },
333+ },
334+ "Canceled" : []map [string ]string {
335+ {"pod-ns-1/pod-4" : "vol-4" },
336+ },
337+ "In Progress" : []map [string ]string {
338+ {"pod-ns-1/pod-5" : "vol-5" },
339+ },
340+ "Canceling" : []map [string ]string {
341+ {"pod-ns-1/pod-6" : "vol-6" },
342+ },
343+ "Prepared" : []map [string ]string {
344+ {"pod-ns-1/pod-7" : "vol-7" },
345+ },
346+ "Accepted" : []map [string ]string {
347+ {"pod-ns-1/pod-8" : "vol-8" },
348+ },
349+ },
350+ "uploderType" : "kopia" ,
351+ },
352+ },
353+ },
271354 }
272355 for _ , tc := range testcases {
273356 t .Run (tc .name , func (tt * testing.T ) {
0 commit comments