adds test coverage for events in exchange incrementals (#3661)

We still have events excluded from the exchange
incrementals integration tests.  For future safety, these need to be part of the testing group.

However, there's a hitch.  Our primary test user is broken again, and cannot retrieve any calendars
except for the well-known set: calendars, birthdays, holidays.  We'll have to fix that before merging.

---

#### 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:
Keepers 2023-06-27 14:05:25 -06:00 committed by GitHub
parent f68fe90793
commit 10c8fd9d12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 20 deletions

View File

@ -407,8 +407,8 @@ func EventWithAttendeesBytes(subject string) []byte {
// Body must contain a well-formatted string, consumable in a json payload. IE: no unescaped newlines. // Body must contain a well-formatted string, consumable in a json payload. IE: no unescaped newlines.
func EventWith( func EventWith(
organizer, subject, body, bodyPreview, organizer, subject, body, bodyPreview,
originalStartDate, startDateTime, endDateTime, recurrence, attendees string, originalStartDate, startDateTime, endDateTime, recurrence, attendees,
attachments string, cancelledOccurrences, exceptionOccurrences string, attachments, cancelledOccurrences, exceptionOccurrences string,
) []byte { ) []byte {
hasAttachments := len(attachments) > 0 hasAttachments := len(attachments) > 0
startDateTime = strings.TrimSuffix(startDateTime, "Z") startDateTime = strings.TrimSuffix(startDateTime, "Z")

View File

@ -749,8 +749,7 @@ func testExchangeContinuousBackups(suite *BackupOpIntegrationSuite, toggles cont
categories = map[path.CategoryType][]string{ categories = map[path.CategoryType][]string{
path.EmailCategory: exchange.MetadataFileNames(path.EmailCategory), path.EmailCategory: exchange.MetadataFileNames(path.EmailCategory),
path.ContactsCategory: exchange.MetadataFileNames(path.ContactsCategory), path.ContactsCategory: exchange.MetadataFileNames(path.ContactsCategory),
// TODO: not currently functioning; cannot retrieve generated calendars path.EventsCategory: exchange.MetadataFileNames(path.EventsCategory),
// path.EventsCategory: exchange.MetadataFileNames(path.EventsCategory),
} }
container1 = fmt.Sprintf("%s%d_%s", incrementalsDestContainerPrefix, 1, now) container1 = fmt.Sprintf("%s%d_%s", incrementalsDestContainerPrefix, 1, now)
container2 = fmt.Sprintf("%s%d_%s", incrementalsDestContainerPrefix, 2, now) container2 = fmt.Sprintf("%s%d_%s", incrementalsDestContainerPrefix, 2, now)
@ -773,7 +772,8 @@ func testExchangeContinuousBackups(suite *BackupOpIntegrationSuite, toggles cont
sel.Include( sel.Include(
sel.MailFolders(containers, selectors.PrefixMatch()), sel.MailFolders(containers, selectors.PrefixMatch()),
sel.ContactFolders(containers, selectors.PrefixMatch())) sel.ContactFolders(containers, selectors.PrefixMatch()),
sel.EventCalendars(containers, selectors.PrefixMatch()))
creds, err := acct.M365Config() creds, err := acct.M365Config()
require.NoError(t, err, clues.ToCore(err)) require.NoError(t, err, clues.ToCore(err))
@ -838,22 +838,18 @@ func testExchangeContinuousBackups(suite *BackupOpIntegrationSuite, toggles cont
container2: {}, container2: {},
}, },
}, },
// TODO: not currently functioning; cannot retrieve generated calendars path.EventsCategory: {
// path.EventsCategory: { dbf: eventDBF,
// dbf: eventDBF, dests: map[string]contDeets{
// dests: map[string]contDeets{ container1: {},
// container1: {}, container2: {},
// container2: {}, },
// }, },
// },
} }
// populate initial test data // populate initial test data
for category, gen := range dataset { for category, gen := range dataset {
for destName := range gen.dests { for destName := range gen.dests {
// TODO: the details.Builder returned by restore can contain entries with
// incorrect information. non-representative repo-refs and the like. Until
// that gets fixed, we can't consume that info for testing.
deets := generateContainerOfItems( deets := generateContainerOfItems(
t, t,
ctx, ctx,
@ -861,7 +857,10 @@ func testExchangeContinuousBackups(suite *BackupOpIntegrationSuite, toggles cont
service, service,
category, category,
selectors.NewExchangeRestore([]string{uidn.ID()}).Selector, selectors.NewExchangeRestore([]string{uidn.ID()}).Selector,
creds.AzureTenantID, uidn.ID(), "", destName, creds.AzureTenantID,
uidn.ID(),
"",
destName,
2, 2,
version.Backup, version.Backup,
gen.dbf) gen.dbf)
@ -926,7 +925,12 @@ func testExchangeContinuousBackups(suite *BackupOpIntegrationSuite, toggles cont
} }
} }
require.NotEmptyf(t, longestLR, "must find an expected details entry matching the generated folder: %s", destName) require.NotEmptyf(
t,
longestLR,
"must find a details entry matching the generated %s container: %s",
category,
destName)
cd.locRef = longestLR cd.locRef = longestLR
@ -1274,8 +1278,9 @@ func testExchangeContinuousBackups(suite *BackupOpIntegrationSuite, toggles cont
checkMetadataFilesExist(t, ctx, bupID, kw, ms, atid, uidn.ID(), service, categories) checkMetadataFilesExist(t, ctx, bupID, kw, ms, atid, uidn.ID(), service, categories)
deeTD.CheckBackupDetails(t, ctx, bupID, whatSet, ms, ss, expectDeets, true) deeTD.CheckBackupDetails(t, ctx, bupID, whatSet, ms, ss, expectDeets, true)
// FIXME: commented tests are flaky due to interference with other tests // FIXME: commented tests are flaky due to delta calls retaining data that is
// we need to find a better way to make good assertions here. // out of scope of the test data.
// we need to find a better way to make isolated assertions here.
// The addition of the deeTD package gives us enough coverage to comment // The addition of the deeTD package gives us enough coverage to comment
// out the tests for now and look to their improvemeng later. // out the tests for now and look to their improvemeng later.