mirror of
https://github.com/cozystack/cozystack.git
synced 2026-12-02 21:30:46 +09:00
test(backups): give the restore stale-cache test a Completed Velero Backup
A Velero RestoreJob is about to require its Velero Backup to exist and
be Completed before it halts the application. Without one in the
fixture, the first pass of this test fails the RestoreJob before it
suspends the HelmRelease, so the test would stop exercising the stale
cache it is about.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit 06e72b26dd)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
c7dc372580
commit
c9973a3755
1 file changed
+5
-1
@@ -152,7 +152,11 @@ func TestReconcileRestore_DoesNotRetryAJobItAlreadyFailed(t *testing.T) {
|
||||
Status: backupsv1alpha1.RestoreJobStatus{StartedAt: &started, Phase: backupsv1alpha1.RestoreJobPhaseRunning},
|
||||
}
|
||||
strategy := &strategyv1alpha1.Velero{ObjectMeta: metav1.ObjectMeta{Name: "velero"}}
|
||||
c := clientfake.NewClientBuilder().WithScheme(s).WithObjects(rj, backup, strategy).
|
||||
veleroBackup := &velerov1.Backup{
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "vb", Namespace: veleroNamespace},
|
||||
Status: velerov1.BackupStatus{Phase: velerov1.BackupPhaseCompleted},
|
||||
}
|
||||
c := clientfake.NewClientBuilder().WithScheme(s).WithObjects(rj, backup, strategy, veleroBackup).
|
||||
WithStatusSubresource(&backupsv1alpha1.RestoreJob{}).Build()
|
||||
dyn := dynamicfake.NewSimpleDynamicClient(testCNPGScheme(t), makeUnstructuredHelmRelease(hrName, ns, nil))
|
||||
r := &RestoreJobReconciler{
|
||||
|
||||
Reference in new issue
Block a user