use replace collisions for nightly tests (#3882)

#### Does this PR need a docs update or release note?

- [x]  No

#### Type of change

- [x] 🤖 Supportability/Tests

#### Issue(s)

* #3562

#### Test Plan

- [x]  Unit test
- [x] 💚 E2E
This commit is contained in:
Keepers 2023-07-21 16:19:13 -06:00 committed by GitHub
parent 4ddbb1cc30
commit 7677299ace
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 6 deletions

View File

@ -24,6 +24,10 @@ inputs:
log-dir: log-dir:
description: Folder to store test log files description: Folder to store test log files
required: true required: true
on-collision:
description: Value for the --collisions flag
requried: false
default: "replace"
outputs: outputs:
backup-id: backup-id:
@ -57,6 +61,7 @@ runs:
./corso restore '${{ inputs.service }}' \ ./corso restore '${{ inputs.service }}' \
--no-stats \ --no-stats \
--hide-progress \ --hide-progress \
--collisions ${{ inputs.on-collision }} \
${{ inputs.restore-args }} \ ${{ inputs.restore-args }} \
--backup '${{ steps.backup.outputs.result }}' \ --backup '${{ steps.backup.outputs.result }}' \
2>&1 | 2>&1 |

View File

@ -692,6 +692,7 @@ func runRestoreBackupTestVersions(
tenant string, tenant string,
resourceOwners []string, resourceOwners []string,
opts control.Options, opts control.Options,
crc control.RestoreConfig,
) { ) {
ctx, flush := tester.NewContext(t) ctx, flush := tester.NewContext(t)
defer flush() defer flush()
@ -702,7 +703,7 @@ func runRestoreBackupTestVersions(
Service: test.service, Service: test.service,
Tenant: tenant, Tenant: tenant,
ResourceOwners: resourceOwners, ResourceOwners: resourceOwners,
RestoreCfg: testdata.DefaultRestoreConfig(""), RestoreCfg: crc,
} }
totalItems, _, collections, _, err := stub.GetCollectionsAndExpected( totalItems, _, collections, _, err := stub.GetCollectionsAndExpected(

View File

@ -22,6 +22,7 @@ import (
"github.com/alcionai/corso/src/internal/tester/tconfig" "github.com/alcionai/corso/src/internal/tester/tconfig"
"github.com/alcionai/corso/src/internal/version" "github.com/alcionai/corso/src/internal/version"
"github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/control"
"github.com/alcionai/corso/src/pkg/control/testdata"
"github.com/alcionai/corso/src/pkg/path" "github.com/alcionai/corso/src/pkg/path"
"github.com/alcionai/corso/src/pkg/services/m365/api" "github.com/alcionai/corso/src/pkg/services/m365/api"
) )
@ -516,6 +517,9 @@ func testRestoreAndBackupMultipleFilesAndFoldersNoPermissions(
collectionsLatest: expected, collectionsLatest: expected,
} }
rc := testdata.DefaultRestoreConfig("od_restore_and_backup_multi")
rc.OnCollision = control.Replace
runRestoreBackupTestVersions( runRestoreBackupTestVersions(
t, t,
testData, testData,
@ -524,7 +528,8 @@ func testRestoreAndBackupMultipleFilesAndFoldersNoPermissions(
control.Options{ control.Options{
RestorePermissions: true, RestorePermissions: true,
ToggleFeatures: control.Toggles{}, ToggleFeatures: control.Toggles{},
}) },
rc)
}) })
} }
} }
@ -763,6 +768,9 @@ func testPermissionsRestoreAndBackup(suite oneDriveSuite, startVersion int) {
collectionsLatest: expected, collectionsLatest: expected,
} }
rc := testdata.DefaultRestoreConfig("perms_restore_and_backup")
rc.OnCollision = control.Replace
runRestoreBackupTestVersions( runRestoreBackupTestVersions(
t, t,
testData, testData,
@ -771,7 +779,8 @@ func testPermissionsRestoreAndBackup(suite oneDriveSuite, startVersion int) {
control.Options{ control.Options{
RestorePermissions: true, RestorePermissions: true,
ToggleFeatures: control.Toggles{}, ToggleFeatures: control.Toggles{},
}) },
rc)
}) })
} }
} }
@ -851,6 +860,9 @@ func testPermissionsBackupAndNoRestore(suite oneDriveSuite, startVersion int) {
collectionsLatest: expected, collectionsLatest: expected,
} }
rc := testdata.DefaultRestoreConfig("perms_backup_no_restore")
rc.OnCollision = control.Replace
runRestoreBackupTestVersions( runRestoreBackupTestVersions(
t, t,
testData, testData,
@ -859,7 +871,8 @@ func testPermissionsBackupAndNoRestore(suite oneDriveSuite, startVersion int) {
control.Options{ control.Options{
RestorePermissions: false, RestorePermissions: false,
ToggleFeatures: control.Toggles{}, ToggleFeatures: control.Toggles{},
}) },
rc)
}) })
} }
} }
@ -1054,6 +1067,9 @@ func testPermissionsInheritanceRestoreAndBackup(suite oneDriveSuite, startVersio
collectionsLatest: expected, collectionsLatest: expected,
} }
rc := testdata.DefaultRestoreConfig("perms_inherit_restore_and_backup")
rc.OnCollision = control.Replace
runRestoreBackupTestVersions( runRestoreBackupTestVersions(
t, t,
testData, testData,
@ -1062,7 +1078,8 @@ func testPermissionsInheritanceRestoreAndBackup(suite oneDriveSuite, startVersio
control.Options{ control.Options{
RestorePermissions: true, RestorePermissions: true,
ToggleFeatures: control.Toggles{}, ToggleFeatures: control.Toggles{},
}) },
rc)
}) })
} }
} }
@ -1247,6 +1264,9 @@ func testLinkSharesInheritanceRestoreAndBackup(suite oneDriveSuite, startVersion
collectionsLatest: expected, collectionsLatest: expected,
} }
rc := testdata.DefaultRestoreConfig("linkshares_inherit_restore_and_backup")
rc.OnCollision = control.Replace
runRestoreBackupTestVersions( runRestoreBackupTestVersions(
t, t,
testData, testData,
@ -1255,7 +1275,8 @@ func testLinkSharesInheritanceRestoreAndBackup(suite oneDriveSuite, startVersion
control.Options{ control.Options{
RestorePermissions: true, RestorePermissions: true,
ToggleFeatures: control.Toggles{}, ToggleFeatures: control.Toggles{},
}) },
rc)
}) })
} }
} }