specify sharepoint restore libraries (#3801)
#### Does this PR need a docs update or release note? - [x] ⛔ No #### Type of change - [x] 🤖 Supportability/Tests #### Test Plan - [x] 💚 E2E
This commit is contained in:
parent
4d4f5dc934
commit
e60610193c
@ -1180,7 +1180,10 @@ func getSelectorWith(
|
||||
|
||||
case path.SharePointService:
|
||||
if forRestore {
|
||||
return selectors.NewSharePointRestore(resourceOwners).Selector
|
||||
sel := selectors.NewSharePointRestore(resourceOwners)
|
||||
sel.Include(sel.Library(tconfig.LibraryDocuments), sel.Library(tconfig.LibraryMoreDocuments))
|
||||
|
||||
return sel.Selector
|
||||
}
|
||||
|
||||
return selectors.NewSharePointBackup(resourceOwners).Selector
|
||||
|
||||
@ -350,11 +350,6 @@ func setupSharePointBackup(
|
||||
evmock.NewBus())
|
||||
require.NoError(t, err, clues.ToCore(err))
|
||||
|
||||
spPgr := ctrl.AC.Drives().NewSiteDrivePager(owner, []string{"id", "name"})
|
||||
|
||||
drives, err := api.GetAllDrives(ctx, spPgr, true, 3)
|
||||
require.NoError(t, err, clues.ToCore(err))
|
||||
|
||||
err = bo.Run(ctx)
|
||||
require.NoError(t, err, clues.ToCore(err))
|
||||
require.NotEmpty(t, bo.Results.BackupID)
|
||||
@ -362,12 +357,14 @@ func setupSharePointBackup(
|
||||
return bupResults{
|
||||
selectorResourceOwners: sites,
|
||||
backupID: bo.Results.BackupID,
|
||||
// Discount metadata files (1 delta, 1 prev path)
|
||||
// Discount metadata files (2: 1 delta, 1 prev path)
|
||||
// assume only one folder, and therefore 1 dirmeta per drive
|
||||
// assume only one file in each folder, and therefore 1 meta per drive.
|
||||
// These meta files are used to aid restore, but are not themselves
|
||||
// (2 drives: documents and more documents)
|
||||
// assume only one file in each folder, and therefore 1 meta per drive
|
||||
// (2 drives: documents and more documents)
|
||||
// Meta files are used to aid restore, but are not themselves
|
||||
// restored (ie: counted as writes).
|
||||
items: bo.Results.ItemsWritten - 2 - len(drives) - len(drives),
|
||||
items: bo.Results.ItemsWritten - 6,
|
||||
ctrl: ctrl,
|
||||
}
|
||||
}
|
||||
@ -398,7 +395,7 @@ func (suite *RestoreOpIntegrationSuite) TestRestore_Run() {
|
||||
restoreCfg: control.DefaultRestoreConfig(dttm.SafeForTesting),
|
||||
getSelector: func(t *testing.T, owners []string) selectors.Selector {
|
||||
rsel := selectors.NewSharePointRestore(owners)
|
||||
rsel.Include(rsel.AllData())
|
||||
rsel.Include(rsel.Library(tconfig.LibraryDocuments), rsel.Library(tconfig.LibraryMoreDocuments))
|
||||
|
||||
return rsel.Selector
|
||||
},
|
||||
|
||||
8
src/internal/tester/tconfig/consts.go
Normal file
8
src/internal/tester/tconfig/consts.go
Normal file
@ -0,0 +1,8 @@
|
||||
package tconfig
|
||||
|
||||
// SharePoint
|
||||
const (
|
||||
// commonly used drive names
|
||||
LibraryDocuments = "Documents"
|
||||
LibraryMoreDocuments = "More Documents"
|
||||
)
|
||||
6
src/pkg/backup/details/testdata/in_deets.go
vendored
6
src/pkg/backup/details/testdata/in_deets.go
vendored
@ -329,18 +329,20 @@ func CheckBackupDetails(
|
||||
}
|
||||
|
||||
// Compare folders.
|
||||
// Have result first since it may be a Subset call.
|
||||
check(
|
||||
t,
|
||||
maps.Keys(expect.Sets[set].Locations),
|
||||
maps.Keys(result.Sets[set].Locations),
|
||||
maps.Keys(expect.Sets[set].Locations),
|
||||
"results in %s missing expected location", set)
|
||||
|
||||
// Compare items in folders.
|
||||
for lr, items := range expect.Sets[set].Locations {
|
||||
// Have result first since it may be a Subset call.
|
||||
check(
|
||||
t,
|
||||
maps.Keys(items),
|
||||
maps.Keys(result.Sets[set].Locations[lr]),
|
||||
maps.Keys(items),
|
||||
"results in set %s location %s missing expected item",
|
||||
set,
|
||||
lr)
|
||||
|
||||
4
src/pkg/selectors/testdata/sharepoint.go
vendored
4
src/pkg/selectors/testdata/sharepoint.go
vendored
@ -1,6 +1,8 @@
|
||||
package testdata
|
||||
|
||||
import "github.com/alcionai/corso/src/pkg/selectors"
|
||||
import (
|
||||
"github.com/alcionai/corso/src/pkg/selectors"
|
||||
)
|
||||
|
||||
// SharePointBackupFolderScope is the standard folder scope that should be used
|
||||
// in integration backups with sharepoint.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user