Consolidate groups version bump tests (#4572)
#### Does this PR need a docs update or release note? - [ ] ✅ Yes, it's included - [ ] 🕐 Yes, but in a later PR - [x] ⛔ No #### Type of change - [ ] 🌻 Feature - [ ] 🐛 Bugfix - [ ] 🗺️ Documentation - [x] 🤖 Supportability/Tests - [ ] 💻 CI/Deployment - [ ] 🧹 Tech Debt/Cleanup #### Issue(s) * #4569 #### Test Plan - [x] 💪 Manual - [ ] ⚡ Unit test - [ ] 💚 E2E
This commit is contained in:
parent
bb27b8e44d
commit
15418d0dda
@ -904,115 +904,14 @@ func (suite *ExchangeBackupNightlyIntgSuite) SetupSuite() {
|
|||||||
suite.its = newIntegrationTesterSetup(suite.T())
|
suite.its = newIntegrationTesterSetup(suite.T())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *ExchangeBackupNightlyIntgSuite) TestBackup_Run_exchangeBasic_groups9VersionBump() {
|
func (suite *ExchangeBackupNightlyIntgSuite) TestBackup_Run_exchangeVersion9MergeBase() {
|
||||||
t := suite.T()
|
sel := selectors.NewExchangeBackup([]string{suite.its.user.ID})
|
||||||
|
|
||||||
ctx, flush := tester.NewContext(t)
|
|
||||||
defer flush()
|
|
||||||
|
|
||||||
var (
|
|
||||||
mb = evmock.NewBus()
|
|
||||||
counter = count.New()
|
|
||||||
sel = selectors.NewExchangeBackup([]string{suite.its.user.ID})
|
|
||||||
opts = control.DefaultOptions()
|
|
||||||
ws = deeTD.DriveIDFromRepoRef
|
|
||||||
)
|
|
||||||
|
|
||||||
sel.Include(
|
sel.Include(
|
||||||
sel.ContactFolders([]string{api.DefaultContacts}, selectors.PrefixMatch()),
|
sel.ContactFolders([]string{api.DefaultContacts}, selectors.PrefixMatch()),
|
||||||
// sel.EventCalendars([]string{api.DefaultCalendar}, selectors.PrefixMatch()),
|
// sel.EventCalendars([]string{api.DefaultCalendar}, selectors.PrefixMatch()),
|
||||||
sel.MailFolders([]string{api.MailInbox}, selectors.PrefixMatch()))
|
sel.MailFolders([]string{api.MailInbox}, selectors.PrefixMatch()))
|
||||||
|
|
||||||
bo, bod := prepNewTestBackupOp(
|
runMergeBaseGroupsUpdate(suite, sel.Selector, true)
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
mb,
|
|
||||||
sel.Selector,
|
|
||||||
opts,
|
|
||||||
version.All8MigrateUserPNToID,
|
|
||||||
counter)
|
|
||||||
defer bod.close(t, ctx)
|
|
||||||
|
|
||||||
runAndCheckBackup(t, ctx, &bo, mb, false)
|
|
||||||
checkBackupIsInManifests(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
bod.kw,
|
|
||||||
bod.sw,
|
|
||||||
&bo,
|
|
||||||
bod.sel,
|
|
||||||
bod.sel.ID(),
|
|
||||||
path.EmailCategory)
|
|
||||||
|
|
||||||
_, expectDeets := deeTD.GetDeetsInBackup(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
bo.Results.BackupID,
|
|
||||||
bod.acct.ID(),
|
|
||||||
bod.sel.ID(),
|
|
||||||
path.ExchangeService,
|
|
||||||
ws,
|
|
||||||
bod.kms,
|
|
||||||
bod.sss)
|
|
||||||
deeTD.CheckBackupDetails(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
bo.Results.BackupID,
|
|
||||||
ws,
|
|
||||||
bod.kms,
|
|
||||||
bod.sss,
|
|
||||||
expectDeets,
|
|
||||||
false)
|
|
||||||
|
|
||||||
mb = evmock.NewBus()
|
|
||||||
counter = count.New()
|
|
||||||
notForcedFull := newTestBackupOp(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
bod,
|
|
||||||
mb,
|
|
||||||
opts,
|
|
||||||
counter)
|
|
||||||
notForcedFull.BackupVersion = version.Groups9Update
|
|
||||||
|
|
||||||
runAndCheckBackup(t, ctx, ¬ForcedFull, mb, false)
|
|
||||||
checkBackupIsInManifests(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
bod.kw,
|
|
||||||
bod.sw,
|
|
||||||
¬ForcedFull,
|
|
||||||
bod.sel,
|
|
||||||
bod.sel.ID(),
|
|
||||||
path.EmailCategory)
|
|
||||||
|
|
||||||
_, expectDeets = deeTD.GetDeetsInBackup(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
notForcedFull.Results.BackupID,
|
|
||||||
bod.acct.ID(),
|
|
||||||
bod.sel.ID(),
|
|
||||||
path.ExchangeService,
|
|
||||||
ws,
|
|
||||||
bod.kms,
|
|
||||||
bod.sss)
|
|
||||||
deeTD.CheckBackupDetails(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
notForcedFull.Results.BackupID,
|
|
||||||
ws,
|
|
||||||
bod.kms,
|
|
||||||
bod.sss,
|
|
||||||
expectDeets,
|
|
||||||
false)
|
|
||||||
|
|
||||||
// The number of items backed up in the second backup should be less than the
|
|
||||||
// number of items in the original backup.
|
|
||||||
assert.Greater(
|
|
||||||
t,
|
|
||||||
bo.Results.Counts[string(count.PersistedNonCachedFiles)],
|
|
||||||
notForcedFull.Results.Counts[string(count.PersistedNonCachedFiles)],
|
|
||||||
"items written")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type ExchangeRestoreNightlyIntgSuite struct {
|
type ExchangeRestoreNightlyIntgSuite struct {
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
"github.com/stretchr/testify/suite"
|
"github.com/stretchr/testify/suite"
|
||||||
|
|
||||||
evmock "github.com/alcionai/corso/src/internal/events/mock"
|
evmock "github.com/alcionai/corso/src/internal/events/mock"
|
||||||
@ -215,114 +214,13 @@ func (suite *GroupsBackupNightlyIntgSuite) SetupSuite() {
|
|||||||
suite.its = newIntegrationTesterSetup(suite.T())
|
suite.its = newIntegrationTesterSetup(suite.T())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *GroupsBackupNightlyIntgSuite) TestBackup_Run_groupsBasic_groups9VersionBump() {
|
func (suite *GroupsBackupNightlyIntgSuite) TestBackup_Run_groupsVersion9MergeBase() {
|
||||||
t := suite.T()
|
sel := selectors.NewGroupsBackup([]string{suite.its.group.ID})
|
||||||
|
|
||||||
ctx, flush := tester.NewContext(t)
|
|
||||||
defer flush()
|
|
||||||
|
|
||||||
var (
|
|
||||||
mb = evmock.NewBus()
|
|
||||||
counter = count.New()
|
|
||||||
sel = selectors.NewGroupsBackup([]string{suite.its.group.ID})
|
|
||||||
opts = control.DefaultOptions()
|
|
||||||
whatSet = deeTD.CategoryFromRepoRef
|
|
||||||
)
|
|
||||||
|
|
||||||
sel.Include(
|
sel.Include(
|
||||||
selTD.GroupsBackupLibraryFolderScope(sel),
|
selTD.GroupsBackupLibraryFolderScope(sel),
|
||||||
selTD.GroupsBackupChannelScope(sel))
|
selTD.GroupsBackupChannelScope(sel))
|
||||||
|
|
||||||
bo, bod := prepNewTestBackupOp(
|
runMergeBaseGroupsUpdate(suite, sel.Selector, false)
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
mb,
|
|
||||||
sel.Selector,
|
|
||||||
opts,
|
|
||||||
version.All8MigrateUserPNToID,
|
|
||||||
counter)
|
|
||||||
defer bod.close(t, ctx)
|
|
||||||
|
|
||||||
runAndCheckBackup(t, ctx, &bo, mb, false)
|
|
||||||
checkBackupIsInManifests(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
bod.kw,
|
|
||||||
bod.sw,
|
|
||||||
&bo,
|
|
||||||
bod.sel,
|
|
||||||
bod.sel.ID(),
|
|
||||||
path.ChannelMessagesCategory)
|
|
||||||
|
|
||||||
_, expectDeets := deeTD.GetDeetsInBackup(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
bo.Results.BackupID,
|
|
||||||
bod.acct.ID(),
|
|
||||||
bod.sel.ID(),
|
|
||||||
path.GroupsService,
|
|
||||||
whatSet,
|
|
||||||
bod.kms,
|
|
||||||
bod.sss)
|
|
||||||
deeTD.CheckBackupDetails(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
bo.Results.BackupID,
|
|
||||||
whatSet,
|
|
||||||
bod.kms,
|
|
||||||
bod.sss,
|
|
||||||
expectDeets,
|
|
||||||
false)
|
|
||||||
|
|
||||||
mb = evmock.NewBus()
|
|
||||||
counter = count.New()
|
|
||||||
forcedFull := newTestBackupOp(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
bod,
|
|
||||||
mb,
|
|
||||||
opts,
|
|
||||||
counter)
|
|
||||||
forcedFull.BackupVersion = version.Groups9Update
|
|
||||||
|
|
||||||
runAndCheckBackup(t, ctx, &forcedFull, mb, false)
|
|
||||||
checkBackupIsInManifests(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
bod.kw,
|
|
||||||
bod.sw,
|
|
||||||
&forcedFull,
|
|
||||||
bod.sel,
|
|
||||||
bod.sel.ID(),
|
|
||||||
path.ChannelMessagesCategory)
|
|
||||||
|
|
||||||
_, expectDeets = deeTD.GetDeetsInBackup(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
forcedFull.Results.BackupID,
|
|
||||||
bod.acct.ID(),
|
|
||||||
bod.sel.ID(),
|
|
||||||
path.GroupsService,
|
|
||||||
whatSet,
|
|
||||||
bod.kms,
|
|
||||||
bod.sss)
|
|
||||||
deeTD.CheckBackupDetails(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
forcedFull.Results.BackupID,
|
|
||||||
whatSet,
|
|
||||||
bod.kms,
|
|
||||||
bod.sss,
|
|
||||||
expectDeets,
|
|
||||||
false)
|
|
||||||
|
|
||||||
// The number of items backed up in the forced full backup should be roughly
|
|
||||||
// the same as the number of items in the original backup.
|
|
||||||
assert.Equal(
|
|
||||||
t,
|
|
||||||
bo.Results.Counts[string(count.PersistedNonCachedFiles)],
|
|
||||||
forcedFull.Results.Counts[string(count.PersistedNonCachedFiles)],
|
|
||||||
"items written")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *GroupsBackupNightlyIntgSuite) TestBackup_Run_groupsVersion9AssistBases() {
|
func (suite *GroupsBackupNightlyIntgSuite) TestBackup_Run_groupsVersion9AssistBases() {
|
||||||
|
|||||||
@ -28,9 +28,11 @@ import (
|
|||||||
"github.com/alcionai/corso/src/internal/streamstore"
|
"github.com/alcionai/corso/src/internal/streamstore"
|
||||||
"github.com/alcionai/corso/src/internal/tester"
|
"github.com/alcionai/corso/src/internal/tester"
|
||||||
"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/pkg/account"
|
"github.com/alcionai/corso/src/pkg/account"
|
||||||
"github.com/alcionai/corso/src/pkg/backup"
|
"github.com/alcionai/corso/src/pkg/backup"
|
||||||
"github.com/alcionai/corso/src/pkg/backup/details"
|
"github.com/alcionai/corso/src/pkg/backup/details"
|
||||||
|
deeTD "github.com/alcionai/corso/src/pkg/backup/details/testdata"
|
||||||
"github.com/alcionai/corso/src/pkg/backup/identity"
|
"github.com/alcionai/corso/src/pkg/backup/identity"
|
||||||
"github.com/alcionai/corso/src/pkg/control"
|
"github.com/alcionai/corso/src/pkg/control"
|
||||||
"github.com/alcionai/corso/src/pkg/control/repository"
|
"github.com/alcionai/corso/src/pkg/control/repository"
|
||||||
@ -374,6 +376,147 @@ func checkMetadataFilesExist(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func runMergeBaseGroupsUpdate(
|
||||||
|
suite tester.Suite,
|
||||||
|
sel selectors.Selector,
|
||||||
|
expectCached bool,
|
||||||
|
) {
|
||||||
|
t := suite.T()
|
||||||
|
|
||||||
|
ctx, flush := tester.NewContext(t)
|
||||||
|
defer flush()
|
||||||
|
|
||||||
|
var (
|
||||||
|
mb = evmock.NewBus()
|
||||||
|
opts = control.DefaultOptions()
|
||||||
|
whatSet = deeTD.CategoryFromRepoRef
|
||||||
|
)
|
||||||
|
|
||||||
|
// Need outside the inner test case so bod lasts for the entire test.
|
||||||
|
bo, bod := prepNewTestBackupOp(
|
||||||
|
t,
|
||||||
|
ctx,
|
||||||
|
mb,
|
||||||
|
sel,
|
||||||
|
opts,
|
||||||
|
version.All8MigrateUserPNToID,
|
||||||
|
count.New())
|
||||||
|
defer bod.close(t, ctx)
|
||||||
|
|
||||||
|
suite.Run("makeMergeBackup", func() {
|
||||||
|
t := suite.T()
|
||||||
|
|
||||||
|
ctx, flush := tester.NewContext(t)
|
||||||
|
defer flush()
|
||||||
|
|
||||||
|
runAndCheckBackup(t, ctx, &bo, mb, false)
|
||||||
|
|
||||||
|
reasons, err := bod.sel.Reasons(bod.acct.ID(), false)
|
||||||
|
require.NoError(t, err, clues.ToCore(err))
|
||||||
|
|
||||||
|
for _, reason := range reasons {
|
||||||
|
checkBackupIsInManifests(
|
||||||
|
t,
|
||||||
|
ctx,
|
||||||
|
bod.kw,
|
||||||
|
bod.sw,
|
||||||
|
&bo,
|
||||||
|
bod.sel,
|
||||||
|
bod.sel.ID(),
|
||||||
|
reason.Category())
|
||||||
|
}
|
||||||
|
|
||||||
|
_, expectDeets := deeTD.GetDeetsInBackup(
|
||||||
|
t,
|
||||||
|
ctx,
|
||||||
|
bo.Results.BackupID,
|
||||||
|
bod.acct.ID(),
|
||||||
|
bod.sel.ID(),
|
||||||
|
bod.sel.PathService(),
|
||||||
|
whatSet,
|
||||||
|
bod.kms,
|
||||||
|
bod.sss)
|
||||||
|
deeTD.CheckBackupDetails(
|
||||||
|
t,
|
||||||
|
ctx,
|
||||||
|
bo.Results.BackupID,
|
||||||
|
whatSet,
|
||||||
|
bod.kms,
|
||||||
|
bod.sss,
|
||||||
|
expectDeets,
|
||||||
|
false)
|
||||||
|
})
|
||||||
|
|
||||||
|
suite.Run("makeIncrementalBackup", func() {
|
||||||
|
t := suite.T()
|
||||||
|
|
||||||
|
ctx, flush := tester.NewContext(t)
|
||||||
|
defer flush()
|
||||||
|
|
||||||
|
var (
|
||||||
|
mb = evmock.NewBus()
|
||||||
|
opts = control.DefaultOptions()
|
||||||
|
)
|
||||||
|
|
||||||
|
forcedFull := newTestBackupOp(
|
||||||
|
t,
|
||||||
|
ctx,
|
||||||
|
bod,
|
||||||
|
mb,
|
||||||
|
opts,
|
||||||
|
count.New())
|
||||||
|
forcedFull.BackupVersion = version.Groups9Update
|
||||||
|
|
||||||
|
runAndCheckBackup(t, ctx, &forcedFull, mb, false)
|
||||||
|
|
||||||
|
reasons, err := bod.sel.Reasons(bod.acct.ID(), false)
|
||||||
|
require.NoError(t, err, clues.ToCore(err))
|
||||||
|
|
||||||
|
for _, reason := range reasons {
|
||||||
|
checkBackupIsInManifests(
|
||||||
|
t,
|
||||||
|
ctx,
|
||||||
|
bod.kw,
|
||||||
|
bod.sw,
|
||||||
|
&forcedFull,
|
||||||
|
bod.sel,
|
||||||
|
bod.sel.ID(),
|
||||||
|
reason.Category())
|
||||||
|
}
|
||||||
|
|
||||||
|
_, expectDeets := deeTD.GetDeetsInBackup(
|
||||||
|
t,
|
||||||
|
ctx,
|
||||||
|
forcedFull.Results.BackupID,
|
||||||
|
bod.acct.ID(),
|
||||||
|
bod.sel.ID(),
|
||||||
|
bod.sel.PathService(),
|
||||||
|
whatSet,
|
||||||
|
bod.kms,
|
||||||
|
bod.sss)
|
||||||
|
deeTD.CheckBackupDetails(
|
||||||
|
t,
|
||||||
|
ctx,
|
||||||
|
forcedFull.Results.BackupID,
|
||||||
|
whatSet,
|
||||||
|
bod.kms,
|
||||||
|
bod.sss,
|
||||||
|
expectDeets,
|
||||||
|
false)
|
||||||
|
|
||||||
|
check := assert.Zero
|
||||||
|
|
||||||
|
if expectCached {
|
||||||
|
check = assert.NotZero
|
||||||
|
}
|
||||||
|
|
||||||
|
check(
|
||||||
|
t,
|
||||||
|
forcedFull.Results.Counts[string(count.PersistedCachedFiles)],
|
||||||
|
"cached items")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// Incremental Item Generators
|
// Incremental Item Generators
|
||||||
// TODO: this is ripped from factory.go, which is ripped from other tests.
|
// TODO: this is ripped from factory.go, which is ripped from other tests.
|
||||||
|
|||||||
@ -1189,7 +1189,7 @@ type OneDriveBackupNightlyIntgSuite struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestOneDriveBackupNightlyIntgSuite(t *testing.T) {
|
func TestOneDriveBackupNightlyIntgSuite(t *testing.T) {
|
||||||
suite.Run(t, &OneDriveBackupIntgSuite{
|
suite.Run(t, &OneDriveBackupNightlyIntgSuite{
|
||||||
Suite: tester.NewNightlySuite(
|
Suite: tester.NewNightlySuite(
|
||||||
t,
|
t,
|
||||||
[][]string{tconfig.M365AcctCredEnvs, storeTD.AWSStorageCredEnvs}),
|
[][]string{tconfig.M365AcctCredEnvs, storeTD.AWSStorageCredEnvs}),
|
||||||
@ -1200,113 +1200,11 @@ func (suite *OneDriveBackupNightlyIntgSuite) SetupSuite() {
|
|||||||
suite.its = newIntegrationTesterSetup(suite.T())
|
suite.its = newIntegrationTesterSetup(suite.T())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *OneDriveBackupNightlyIntgSuite) TestBackup_Run_oneDriveBasic_groups9VersionBump() {
|
func (suite *OneDriveBackupNightlyIntgSuite) TestBackup_Run_oneDriveVersion9MergeBase() {
|
||||||
t := suite.T()
|
sel := selectors.NewOneDriveBackup([]string{suite.its.user.ID})
|
||||||
|
sel.Include(selTD.OneDriveBackupFolderScope(sel))
|
||||||
|
|
||||||
ctx, flush := tester.NewContext(t)
|
runMergeBaseGroupsUpdate(suite, sel.Selector, true)
|
||||||
defer flush()
|
|
||||||
|
|
||||||
var (
|
|
||||||
mb = evmock.NewBus()
|
|
||||||
counter = count.New()
|
|
||||||
userID = tconfig.SecondaryM365UserID(t)
|
|
||||||
osel = selectors.NewOneDriveBackup([]string{userID})
|
|
||||||
ws = deeTD.DriveIDFromRepoRef
|
|
||||||
opts = control.DefaultOptions()
|
|
||||||
)
|
|
||||||
|
|
||||||
osel.Include(selTD.OneDriveBackupFolderScope(osel))
|
|
||||||
|
|
||||||
bo, bod := prepNewTestBackupOp(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
mb,
|
|
||||||
osel.Selector,
|
|
||||||
opts,
|
|
||||||
version.All8MigrateUserPNToID,
|
|
||||||
counter)
|
|
||||||
defer bod.close(t, ctx)
|
|
||||||
|
|
||||||
runAndCheckBackup(t, ctx, &bo, mb, false)
|
|
||||||
checkBackupIsInManifests(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
bod.kw,
|
|
||||||
bod.sw,
|
|
||||||
&bo,
|
|
||||||
bod.sel,
|
|
||||||
bod.sel.ID(),
|
|
||||||
path.FilesCategory)
|
|
||||||
|
|
||||||
_, expectDeets := deeTD.GetDeetsInBackup(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
bo.Results.BackupID,
|
|
||||||
bod.acct.ID(),
|
|
||||||
bod.sel.ID(),
|
|
||||||
path.OneDriveService,
|
|
||||||
ws,
|
|
||||||
bod.kms,
|
|
||||||
bod.sss)
|
|
||||||
deeTD.CheckBackupDetails(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
bo.Results.BackupID,
|
|
||||||
ws,
|
|
||||||
bod.kms,
|
|
||||||
bod.sss,
|
|
||||||
expectDeets,
|
|
||||||
false)
|
|
||||||
|
|
||||||
mb = evmock.NewBus()
|
|
||||||
counter = count.New()
|
|
||||||
notForcedFull := newTestBackupOp(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
bod,
|
|
||||||
mb,
|
|
||||||
opts,
|
|
||||||
counter)
|
|
||||||
notForcedFull.BackupVersion = version.Groups9Update
|
|
||||||
|
|
||||||
runAndCheckBackup(t, ctx, ¬ForcedFull, mb, false)
|
|
||||||
checkBackupIsInManifests(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
bod.kw,
|
|
||||||
bod.sw,
|
|
||||||
¬ForcedFull,
|
|
||||||
bod.sel,
|
|
||||||
bod.sel.ID(),
|
|
||||||
path.FilesCategory)
|
|
||||||
|
|
||||||
_, expectDeets = deeTD.GetDeetsInBackup(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
notForcedFull.Results.BackupID,
|
|
||||||
bod.acct.ID(),
|
|
||||||
bod.sel.ID(),
|
|
||||||
path.OneDriveService,
|
|
||||||
ws,
|
|
||||||
bod.kms,
|
|
||||||
bod.sss)
|
|
||||||
deeTD.CheckBackupDetails(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
notForcedFull.Results.BackupID,
|
|
||||||
ws,
|
|
||||||
bod.kms,
|
|
||||||
bod.sss,
|
|
||||||
expectDeets,
|
|
||||||
false)
|
|
||||||
|
|
||||||
// The number of items backed up in the second backup should be less than the
|
|
||||||
// number of items in the original backup.
|
|
||||||
assert.Greater(
|
|
||||||
t,
|
|
||||||
bo.Results.Counts[string(count.PersistedNonCachedFiles)],
|
|
||||||
notForcedFull.Results.Counts[string(count.PersistedNonCachedFiles)],
|
|
||||||
"items written")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//func (suite *OneDriveBackupNightlyIntgSuite) TestBackup_Run_oneDriveVersion9AssistBases() {
|
//func (suite *OneDriveBackupNightlyIntgSuite) TestBackup_Run_oneDriveVersion9AssistBases() {
|
||||||
|
|||||||
@ -200,112 +200,11 @@ func (suite *SharePointBackupNightlyIntgSuite) SetupSuite() {
|
|||||||
suite.its = newIntegrationTesterSetup(suite.T())
|
suite.its = newIntegrationTesterSetup(suite.T())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *SharePointBackupNightlyIntgSuite) TestBackup_Run_sharePointBasic_groups9VersionBump() {
|
func (suite *SharePointBackupNightlyIntgSuite) TestBackup_Run_sharePointVersion9MergeBase() {
|
||||||
t := suite.T()
|
sel := selectors.NewSharePointBackup([]string{suite.its.site.ID})
|
||||||
|
|
||||||
ctx, flush := tester.NewContext(t)
|
|
||||||
defer flush()
|
|
||||||
|
|
||||||
var (
|
|
||||||
mb = evmock.NewBus()
|
|
||||||
counter = count.New()
|
|
||||||
sel = selectors.NewSharePointBackup([]string{suite.its.site.ID})
|
|
||||||
opts = control.DefaultOptions()
|
|
||||||
ws = deeTD.DriveIDFromRepoRef
|
|
||||||
)
|
|
||||||
|
|
||||||
sel.Include(selTD.SharePointBackupFolderScope(sel))
|
sel.Include(selTD.SharePointBackupFolderScope(sel))
|
||||||
|
|
||||||
bo, bod := prepNewTestBackupOp(
|
runMergeBaseGroupsUpdate(suite, sel.Selector, true)
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
mb,
|
|
||||||
sel.Selector,
|
|
||||||
opts,
|
|
||||||
version.All8MigrateUserPNToID,
|
|
||||||
counter)
|
|
||||||
defer bod.close(t, ctx)
|
|
||||||
|
|
||||||
runAndCheckBackup(t, ctx, &bo, mb, false)
|
|
||||||
checkBackupIsInManifests(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
bod.kw,
|
|
||||||
bod.sw,
|
|
||||||
&bo,
|
|
||||||
bod.sel,
|
|
||||||
bod.sel.ID(),
|
|
||||||
path.LibrariesCategory)
|
|
||||||
|
|
||||||
_, expectDeets := deeTD.GetDeetsInBackup(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
bo.Results.BackupID,
|
|
||||||
bod.acct.ID(),
|
|
||||||
bod.sel.ID(),
|
|
||||||
path.SharePointService,
|
|
||||||
ws,
|
|
||||||
bod.kms,
|
|
||||||
bod.sss)
|
|
||||||
deeTD.CheckBackupDetails(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
bo.Results.BackupID,
|
|
||||||
ws,
|
|
||||||
bod.kms,
|
|
||||||
bod.sss,
|
|
||||||
expectDeets,
|
|
||||||
false)
|
|
||||||
|
|
||||||
mb = evmock.NewBus()
|
|
||||||
counter = count.New()
|
|
||||||
notForcedFull := newTestBackupOp(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
bod,
|
|
||||||
mb,
|
|
||||||
opts,
|
|
||||||
counter)
|
|
||||||
notForcedFull.BackupVersion = version.Groups9Update
|
|
||||||
|
|
||||||
runAndCheckBackup(t, ctx, ¬ForcedFull, mb, false)
|
|
||||||
checkBackupIsInManifests(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
bod.kw,
|
|
||||||
bod.sw,
|
|
||||||
¬ForcedFull,
|
|
||||||
bod.sel,
|
|
||||||
bod.sel.ID(),
|
|
||||||
path.LibrariesCategory)
|
|
||||||
|
|
||||||
_, expectDeets = deeTD.GetDeetsInBackup(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
notForcedFull.Results.BackupID,
|
|
||||||
bod.acct.ID(),
|
|
||||||
bod.sel.ID(),
|
|
||||||
path.SharePointService,
|
|
||||||
ws,
|
|
||||||
bod.kms,
|
|
||||||
bod.sss)
|
|
||||||
deeTD.CheckBackupDetails(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
notForcedFull.Results.BackupID,
|
|
||||||
ws,
|
|
||||||
bod.kms,
|
|
||||||
bod.sss,
|
|
||||||
expectDeets,
|
|
||||||
false)
|
|
||||||
|
|
||||||
// The number of items backed up in the second backup should be less than the
|
|
||||||
// number of items in the original backup.
|
|
||||||
assert.Greater(
|
|
||||||
t,
|
|
||||||
bo.Results.Counts[string(count.PersistedNonCachedFiles)],
|
|
||||||
notForcedFull.Results.Counts[string(count.PersistedNonCachedFiles)],
|
|
||||||
"items written")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite *SharePointBackupNightlyIntgSuite) TestBackup_Run_sharePointVersion9AssistBases() {
|
func (suite *SharePointBackupNightlyIntgSuite) TestBackup_Run_sharePointVersion9AssistBases() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user