Remove duplicated integration tests for groups (#4929)

<!-- PR description-->

* We had a few duplicated tests. Removing them.
* Adding conversations selector for group v9 bump tests. Although technically it's not needed, since we didn't have conversations support prior to v9.

---

#### 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

<!--- Please check the type of change your PR introduces: --->
- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Supportability/Tests
- [ ] 💻 CI/Deployment
- [x] 🧹 Tech Debt/Cleanup

#### Issue(s)

<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
* #<issue>

#### Test Plan

<!-- How will this be tested prior to merging.-->
- [ ] 💪 Manual
- [ ]  Unit test
- [x] 💚 E2E
This commit is contained in:
Abhishek Pandey 2023-12-27 12:11:09 -08:00 committed by GitHub
parent 1b04b7500e
commit 2be9b3f301
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,6 +68,7 @@ func (suite *GroupsBackupIntgSuite) TestBackup_Run_extensionsGroups() {
sel = selectors.NewGroupsBackup([]string{resourceID}) sel = selectors.NewGroupsBackup([]string{resourceID})
) )
// This test does not apply to channel messages or conversations.
sel.Include(selTD.GroupsBackupLibraryFolderScope(sel)) sel.Include(selTD.GroupsBackupLibraryFolderScope(sel))
RunDriveishBackupWithExtensionsTests( RunDriveishBackupWithExtensionsTests(
@ -189,115 +190,6 @@ func runGroupsIncrementalBackupTests(
true) true)
} }
func (suite *GroupsBackupIntgSuite) TestBackup_Run_groups9VersionBumpBackup() {
t := suite.T()
ctx, flush := tester.NewContext(t)
defer flush()
var (
mb = evmock.NewBus()
sel = selectors.NewGroupsBackup([]string{suite.its.Group.ID})
opts = control.DefaultOptions()
whatSet = deeTD.CategoryFromRepoRef
)
sel.Include(
selTD.GroupsBackupLibraryFolderScope(sel),
selTD.GroupsBackupChannelScope(sel),
sel.Conversation(selectors.Any()))
bo, bod := PrepNewTestBackupOp(
t,
ctx,
mb,
sel.Selector,
opts,
version.All8MigrateUserPNToID,
count.New())
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()
forcedFull := NewTestBackupOp(
t,
ctx,
bod,
mb,
opts,
count.New())
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 *GroupsBackupIntgSuite) TestBackup_Run_groupsBasic() { func (suite *GroupsBackupIntgSuite) TestBackup_Run_groupsBasic() {
t := suite.T() t := suite.T()
@ -418,71 +310,6 @@ func (suite *GroupsBackupIntgSuite) TestBackup_Run_groupsBasic() {
assert.Equal(t, 1, incMB.TimesCalled[events.BackupEnd], "incremental backup-end events") assert.Equal(t, 1, incMB.TimesCalled[events.BackupEnd], "incremental backup-end events")
} }
func (suite *GroupsBackupIntgSuite) TestBackup_Run_groupsExtensions() {
t := suite.T()
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()
tenID = tconfig.M365TenantID(t)
svc = path.GroupsService
ws = deeTD.DriveIDFromRepoRef
)
opts.ItemExtensionFactory = GetTestExtensionFactories()
// does not apply to channel messages
sel.Include(selTD.GroupsBackupLibraryFolderScope(sel))
bo, bod := PrepNewTestBackupOp(t, ctx, mb, sel.Selector, opts, version.Backup, 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)
bID := bo.Results.BackupID
deets, expectDeets := deeTD.GetDeetsInBackup(
t,
ctx,
bID,
tenID,
bod.Sel.ID(),
svc,
ws,
bod.KMS,
bod.SSS)
deeTD.CheckBackupDetails(
t,
ctx,
bID,
ws,
bod.KMS,
bod.SSS,
expectDeets,
false)
// Check that the extensions are in the backup
for _, ent := range deets.Entries {
if ent.Folder == nil {
VerifyExtensionData(t, ent.ItemInfo, path.GroupsService)
}
}
}
type GroupsBackupNightlyIntgSuite struct { type GroupsBackupNightlyIntgSuite struct {
tester.Suite tester.Suite
its IntgTesterSetup its IntgTesterSetup
@ -504,7 +331,8 @@ func (suite *GroupsBackupNightlyIntgSuite) TestBackup_Run_groupsVersion9MergeBas
sel := selectors.NewGroupsBackup([]string{suite.its.Group.ID}) sel := selectors.NewGroupsBackup([]string{suite.its.Group.ID})
sel.Include( sel.Include(
selTD.GroupsBackupLibraryFolderScope(sel), selTD.GroupsBackupLibraryFolderScope(sel),
selTD.GroupsBackupChannelScope(sel)) selTD.GroupsBackupChannelScope(sel),
selTD.GroupsBackupConversationScope(sel))
RunMergeBaseGroupsUpdate(suite, sel.Selector, false) RunMergeBaseGroupsUpdate(suite, sel.Selector, false)
} }
@ -513,7 +341,8 @@ func (suite *GroupsBackupNightlyIntgSuite) TestBackup_Run_groupsVersion9AssistBa
sel := selectors.NewGroupsBackup([]string{suite.its.Group.ID}) sel := selectors.NewGroupsBackup([]string{suite.its.Group.ID})
sel.Include( sel.Include(
selTD.GroupsBackupLibraryFolderScope(sel), selTD.GroupsBackupLibraryFolderScope(sel),
selTD.GroupsBackupChannelScope(sel)) selTD.GroupsBackupChannelScope(sel),
selTD.GroupsBackupConversationScope(sel))
RunDriveAssistBaseGroupsUpdate(suite, sel.Selector, false) RunDriveAssistBaseGroupsUpdate(suite, sel.Selector, false)
} }