Skip to content

Commit

Permalink
Merge pull request #7171 from kaovilai/tests-explicit-enableCSI
Browse files Browse the repository at this point in the history
Add explicit enableCSI to TestProcessBackupCompletions
  • Loading branch information
reasonerjt authored Dec 11, 2023
2 parents c0613f1 + 2132506 commit 804b9a8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/controller/backup_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ func TestProcessBackupCompletions(t *testing.T) {
backupLocation *velerov1api.BackupStorageLocation
defaultVolumesToFsBackup bool
defaultSnapshotMoveData bool
enableCSI bool
expectedResult *velerov1api.Backup
backupExists bool
existenceCheckError error
Expand Down Expand Up @@ -1025,6 +1026,7 @@ func TestProcessBackupCompletions(t *testing.T) {
backup: defaultBackup().SnapshotMoveData(true).Result(),
backupLocation: defaultBackupLocation,
defaultVolumesToFsBackup: false,
enableCSI: true,
expectedResult: &velerov1api.Backup{
TypeMeta: metav1.TypeMeta{
Kind: "Backup",
Expand Down Expand Up @@ -1065,6 +1067,7 @@ func TestProcessBackupCompletions(t *testing.T) {
backup: defaultBackup().SnapshotMoveData(false).Result(),
backupLocation: defaultBackupLocation,
defaultVolumesToFsBackup: false,
enableCSI: true,
expectedResult: &velerov1api.Backup{
TypeMeta: metav1.TypeMeta{
Kind: "Backup",
Expand Down Expand Up @@ -1105,6 +1108,7 @@ func TestProcessBackupCompletions(t *testing.T) {
backup: defaultBackup().Result(),
backupLocation: defaultBackupLocation,
defaultVolumesToFsBackup: false,
enableCSI: true,
expectedResult: &velerov1api.Backup{
TypeMeta: metav1.TypeMeta{
Kind: "Backup",
Expand Down Expand Up @@ -1187,6 +1191,7 @@ func TestProcessBackupCompletions(t *testing.T) {
backupLocation: defaultBackupLocation,
defaultVolumesToFsBackup: false,
defaultSnapshotMoveData: true,
enableCSI: true,
expectedResult: &velerov1api.Backup{
TypeMeta: metav1.TypeMeta{
Kind: "Backup",
Expand Down Expand Up @@ -1362,7 +1367,7 @@ func TestProcessBackupCompletions(t *testing.T) {
require.NoError(t, fakeClient.Create(context.Background(), defaultBackupLocation))

// Enable CSI feature flag for SnapshotDataMovement test.
if strings.Contains(test.name, "backup with snapshot data movement") {
if test.enableCSI {
features.Enable(velerov1api.CSIFeatureFlag)
}

Expand All @@ -1371,7 +1376,7 @@ func TestProcessBackupCompletions(t *testing.T) {
assert.Nil(t, err)

// Disable CSI feature to not impact other test cases.
if strings.Contains(test.name, "backup with snapshot data movement") {
if test.enableCSI {
features.Disable(velerov1api.CSIFeatureFlag)
}

Expand Down

0 comments on commit 804b9a8

Please sign in to comment.