Move MetadataFileNames to test file (#4279)

This is not used in live code and so moving to tests.
Ref: https://github.com/alcionai/corso/pull/4248/files#r1326490460

<!-- PR description-->

---

#### 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
- [ ] 💚 E2E
This commit is contained in:
Abin Simon 2023-09-18 19:21:43 +05:30 committed by GitHub
parent fb6398ea41
commit eb357e1051
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 16 deletions

View File

@ -13,18 +13,6 @@ import (
"github.com/alcionai/corso/src/pkg/path" "github.com/alcionai/corso/src/pkg/path"
) )
// MetadataFileNames produces the category-specific set of filenames used to
// store graph metadata such as delta tokens and folderID->path references.
func MetadataFileNames(cat path.CategoryType) [][]string {
switch cat {
// TODO: should this include events?
case path.EmailCategory, path.ContactsCategory:
return [][]string{{metadata.DeltaURLsFileName}, {metadata.PreviousPathFileName}}
default:
return [][]string{{metadata.PreviousPathFileName}}
}
}
// ParseMetadataCollections produces a map of structs holding delta // ParseMetadataCollections produces a map of structs holding delta
// and path lookup maps. // and path lookup maps.
func ParseMetadataCollections( func ParseMetadataCollections(

View File

@ -18,7 +18,6 @@ import (
"github.com/alcionai/corso/src/internal/common/ptr" "github.com/alcionai/corso/src/internal/common/ptr"
"github.com/alcionai/corso/src/internal/events" "github.com/alcionai/corso/src/internal/events"
evmock "github.com/alcionai/corso/src/internal/events/mock" evmock "github.com/alcionai/corso/src/internal/events/mock"
"github.com/alcionai/corso/src/internal/m365/collection/exchange"
"github.com/alcionai/corso/src/internal/m365/graph" "github.com/alcionai/corso/src/internal/m365/graph"
exchMock "github.com/alcionai/corso/src/internal/m365/service/exchange/mock" exchMock "github.com/alcionai/corso/src/internal/m365/service/exchange/mock"
exchTD "github.com/alcionai/corso/src/internal/m365/service/exchange/testdata" exchTD "github.com/alcionai/corso/src/internal/m365/service/exchange/testdata"
@ -27,6 +26,7 @@ import (
"github.com/alcionai/corso/src/internal/version" "github.com/alcionai/corso/src/internal/version"
"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" deeTD "github.com/alcionai/corso/src/pkg/backup/details/testdata"
"github.com/alcionai/corso/src/pkg/backup/metadata"
"github.com/alcionai/corso/src/pkg/control" "github.com/alcionai/corso/src/pkg/control"
ctrlTD "github.com/alcionai/corso/src/pkg/control/testdata" ctrlTD "github.com/alcionai/corso/src/pkg/control/testdata"
"github.com/alcionai/corso/src/pkg/count" "github.com/alcionai/corso/src/pkg/count"
@ -54,6 +54,18 @@ func (suite *ExchangeBackupIntgSuite) SetupSuite() {
suite.its = newIntegrationTesterSetup(suite.T()) suite.its = newIntegrationTesterSetup(suite.T())
} }
// MetadataFileNames produces the category-specific set of filenames used to
// store graph metadata such as delta tokens and folderID->path references.
func MetadataFileNames(cat path.CategoryType) [][]string {
switch cat {
// TODO: should this include events?
case path.EmailCategory, path.ContactsCategory:
return [][]string{{metadata.DeltaURLsFileName}, {metadata.PreviousPathFileName}}
default:
return [][]string{{metadata.PreviousPathFileName}}
}
}
// TestBackup_Run ensures that Integration Testing works // TestBackup_Run ensures that Integration Testing works
// for the following scopes: Contacts, Events, and Mail // for the following scopes: Contacts, Events, and Mail
func (suite *ExchangeBackupIntgSuite) TestBackup_Run_exchange() { func (suite *ExchangeBackupIntgSuite) TestBackup_Run_exchange() {
@ -93,7 +105,7 @@ func (suite *ExchangeBackupIntgSuite) TestBackup_Run_exchange() {
return sel return sel
}, },
category: path.EventsCategory, category: path.EventsCategory,
metadataFiles: exchange.MetadataFileNames(path.EventsCategory), metadataFiles: MetadataFileNames(path.EventsCategory),
}, },
} }
for _, test := range tests { for _, test := range tests {
@ -244,8 +256,8 @@ func testExchangeContinuousBackups(suite *ExchangeBackupIntgSuite, toggles contr
now = dttm.Now() now = dttm.Now()
service = path.ExchangeService service = path.ExchangeService
categories = map[path.CategoryType][][]string{ categories = map[path.CategoryType][][]string{
path.EmailCategory: exchange.MetadataFileNames(path.EmailCategory), path.EmailCategory: MetadataFileNames(path.EmailCategory),
path.ContactsCategory: exchange.MetadataFileNames(path.ContactsCategory), path.ContactsCategory: MetadataFileNames(path.ContactsCategory),
// 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)