@@ -6,6 +6,8 @@ package postgrescluster
6
6
7
7
import (
8
8
"context"
9
+ "os"
10
+ "strings"
9
11
"testing"
10
12
"time"
11
13
@@ -180,6 +182,9 @@ func TestReconcileVolumeSnapshots(t *testing.T) {
180
182
})
181
183
182
184
t .Run ("SnapshotsEnabledReadySnapshotsExist" , func (t * testing.T ) {
185
+ if strings .EqualFold (os .Getenv ("USE_EXISTING_CLUSTER" ), "true" ) {
186
+ t .Skip ("requires mocking of Job conditions" )
187
+ }
183
188
// Create a volume snapshot class
184
189
volumeSnapshotClassName := "my-snapshotclass"
185
190
volumeSnapshotClass := & volumesnapshotv1.VolumeSnapshotClass {
@@ -454,6 +459,9 @@ func TestReconcileDedicatedSnapshotVolume(t *testing.T) {
454
459
})
455
460
456
461
t .Run ("SnapshotsEnabledBackupExistsCreateRestore" , func (t * testing.T ) {
462
+ if strings .EqualFold (os .Getenv ("USE_EXISTING_CLUSTER" ), "true" ) {
463
+ t .Skip ("requires mocking of Job conditions" )
464
+ }
457
465
// Create cluster with snapshots enabled
458
466
ns := setupNamespace (t , cc )
459
467
cluster := testCluster ()
@@ -499,6 +507,9 @@ func TestReconcileDedicatedSnapshotVolume(t *testing.T) {
499
507
})
500
508
501
509
t .Run ("SnapshotsEnabledSuccessfulRestoreExists" , func (t * testing.T ) {
510
+ if strings .EqualFold (os .Getenv ("USE_EXISTING_CLUSTER" ), "true" ) {
511
+ t .Skip ("requires mocking of Job conditions" )
512
+ }
502
513
// Create cluster with snapshots enabled
503
514
ns := setupNamespace (t , cc )
504
515
cluster := testCluster ()
@@ -561,6 +572,9 @@ func TestReconcileDedicatedSnapshotVolume(t *testing.T) {
561
572
})
562
573
563
574
t .Run ("SnapshotsEnabledFailedRestoreExists" , func (t * testing.T ) {
575
+ if strings .EqualFold (os .Getenv ("USE_EXISTING_CLUSTER" ), "true" ) {
576
+ t .Skip ("requires mocking of Job conditions" )
577
+ }
564
578
// Create cluster with snapshots enabled
565
579
ns := setupNamespace (t , cc )
566
580
cluster := testCluster ()
@@ -837,6 +851,9 @@ func TestGetLatestCompleteBackupJob(t *testing.T) {
837
851
})
838
852
839
853
t .Run ("OneCompleteBackupJob" , func (t * testing.T ) {
854
+ if strings .EqualFold (os .Getenv ("USE_EXISTING_CLUSTER" ), "true" ) {
855
+ t .Skip ("requires mocking of Job conditions" )
856
+ }
840
857
currentTime := metav1 .Now ()
841
858
currentStartTime := metav1 .NewTime (currentTime .AddDate (0 , 0 , - 1 ))
842
859
@@ -864,6 +881,9 @@ func TestGetLatestCompleteBackupJob(t *testing.T) {
864
881
})
865
882
866
883
t .Run ("TwoCompleteBackupJobs" , func (t * testing.T ) {
884
+ if strings .EqualFold (os .Getenv ("USE_EXISTING_CLUSTER" ), "true" ) {
885
+ t .Skip ("requires mocking of Job conditions" )
886
+ }
867
887
currentTime := metav1 .Now ()
868
888
currentStartTime := metav1 .NewTime (currentTime .AddDate (0 , 0 , - 1 ))
869
889
earlierTime := metav1 .NewTime (currentTime .AddDate (- 1 , 0 , 0 ))
0 commit comments