check if w/o file creation test gets cached
This commit is contained in:
parent
0144eebb55
commit
9a6edab353
@ -114,122 +114,124 @@ func (suite *ExchangeBackupIntgSuite) TestBackup_Run_exchange() {
|
|||||||
suite.Run(test.name, func() {
|
suite.Run(test.name, func() {
|
||||||
t := suite.T()
|
t := suite.T()
|
||||||
|
|
||||||
ctx, flush := tester.NewContext(t)
|
assert.NotEmpty(t, test.name)
|
||||||
defer flush()
|
|
||||||
|
|
||||||
var (
|
// ctx, flush := tester.NewContext(t)
|
||||||
mb = evmock.NewBus()
|
// defer flush()
|
||||||
counter = count.New()
|
|
||||||
sel = test.selector().Selector
|
|
||||||
opts = control.DefaultOptions()
|
|
||||||
whatSet = deeTD.CategoryFromRepoRef
|
|
||||||
)
|
|
||||||
|
|
||||||
bo, bod := PrepNewTestBackupOp(t, ctx, mb, sel, opts, version.Backup, counter)
|
// var (
|
||||||
defer bod.Close(t, ctx)
|
// mb = evmock.NewBus()
|
||||||
|
// counter = count.New()
|
||||||
|
// sel = test.selector().Selector
|
||||||
|
// opts = control.DefaultOptions()
|
||||||
|
// whatSet = deeTD.CategoryFromRepoRef
|
||||||
|
// )
|
||||||
|
|
||||||
sel = bod.Sel
|
// bo, bod := PrepNewTestBackupOp(t, ctx, mb, sel, opts, version.Backup, counter)
|
||||||
|
// defer bod.Close(t, ctx)
|
||||||
|
|
||||||
userID := sel.ID()
|
// sel = bod.Sel
|
||||||
|
|
||||||
m365, err := bod.Acct.M365Config()
|
// userID := sel.ID()
|
||||||
require.NoError(t, err, clues.ToCore(err))
|
|
||||||
|
|
||||||
// run the tests
|
// m365, err := bod.Acct.M365Config()
|
||||||
RunAndCheckBackup(t, ctx, &bo, mb, false)
|
// require.NoError(t, err, clues.ToCore(err))
|
||||||
CheckBackupIsInManifests(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
bod.KW,
|
|
||||||
bod.SW,
|
|
||||||
&bo,
|
|
||||||
sel,
|
|
||||||
userID,
|
|
||||||
test.category)
|
|
||||||
CheckMetadataFilesExist(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
bo.Results.BackupID,
|
|
||||||
bod.KW,
|
|
||||||
bod.KMS,
|
|
||||||
m365.AzureTenantID,
|
|
||||||
userID,
|
|
||||||
path.ExchangeService,
|
|
||||||
map[path.CategoryType][][]string{test.category: test.metadataFiles})
|
|
||||||
|
|
||||||
_, expectDeets := deeTD.GetDeetsInBackup(
|
// // run the tests
|
||||||
t,
|
// RunAndCheckBackup(t, ctx, &bo, mb, false)
|
||||||
ctx,
|
// CheckBackupIsInManifests(
|
||||||
bo.Results.BackupID,
|
// t,
|
||||||
bod.Acct.ID(),
|
// ctx,
|
||||||
userID,
|
// bod.KW,
|
||||||
path.ExchangeService,
|
// bod.SW,
|
||||||
whatSet,
|
// &bo,
|
||||||
bod.KMS,
|
// sel,
|
||||||
bod.SSS)
|
// userID,
|
||||||
deeTD.CheckBackupDetails(
|
// test.category)
|
||||||
t,
|
// CheckMetadataFilesExist(
|
||||||
ctx,
|
// t,
|
||||||
bo.Results.BackupID,
|
// ctx,
|
||||||
whatSet,
|
// bo.Results.BackupID,
|
||||||
bod.KMS,
|
// bod.KW,
|
||||||
bod.SSS,
|
// bod.KMS,
|
||||||
expectDeets,
|
// m365.AzureTenantID,
|
||||||
false)
|
// userID,
|
||||||
|
// path.ExchangeService,
|
||||||
|
// map[path.CategoryType][][]string{test.category: test.metadataFiles})
|
||||||
|
|
||||||
// Basic, happy path incremental test. No changes are dictated or expected.
|
// _, expectDeets := deeTD.GetDeetsInBackup(
|
||||||
// This only tests that an incremental backup is runnable at all, and that it
|
// t,
|
||||||
// produces fewer results than the last backup.
|
// ctx,
|
||||||
var (
|
// bo.Results.BackupID,
|
||||||
incMB = evmock.NewBus()
|
// bod.Acct.ID(),
|
||||||
incBO = NewTestBackupOp(
|
// userID,
|
||||||
t,
|
// path.ExchangeService,
|
||||||
ctx,
|
// whatSet,
|
||||||
bod,
|
// bod.KMS,
|
||||||
incMB,
|
// bod.SSS)
|
||||||
opts,
|
// deeTD.CheckBackupDetails(
|
||||||
counter)
|
// t,
|
||||||
)
|
// ctx,
|
||||||
|
// bo.Results.BackupID,
|
||||||
|
// whatSet,
|
||||||
|
// bod.KMS,
|
||||||
|
// bod.SSS,
|
||||||
|
// expectDeets,
|
||||||
|
// false)
|
||||||
|
|
||||||
RunAndCheckBackup(t, ctx, &incBO, incMB, true)
|
// // Basic, happy path incremental test. No changes are dictated or expected.
|
||||||
CheckBackupIsInManifests(
|
// // This only tests that an incremental backup is runnable at all, and that it
|
||||||
t,
|
// // produces fewer results than the last backup.
|
||||||
ctx,
|
// var (
|
||||||
bod.KW,
|
// incMB = evmock.NewBus()
|
||||||
bod.SW,
|
// incBO = NewTestBackupOp(
|
||||||
&incBO,
|
// t,
|
||||||
sel,
|
// ctx,
|
||||||
userID,
|
// bod,
|
||||||
test.category)
|
// incMB,
|
||||||
CheckMetadataFilesExist(
|
// opts,
|
||||||
t,
|
// counter)
|
||||||
ctx,
|
// )
|
||||||
incBO.Results.BackupID,
|
|
||||||
bod.KW,
|
|
||||||
bod.KMS,
|
|
||||||
m365.AzureTenantID,
|
|
||||||
userID,
|
|
||||||
path.ExchangeService,
|
|
||||||
map[path.CategoryType][][]string{test.category: test.metadataFiles})
|
|
||||||
deeTD.CheckBackupDetails(
|
|
||||||
t,
|
|
||||||
ctx,
|
|
||||||
incBO.Results.BackupID,
|
|
||||||
whatSet,
|
|
||||||
bod.KMS,
|
|
||||||
bod.SSS,
|
|
||||||
expectDeets,
|
|
||||||
false)
|
|
||||||
|
|
||||||
// do some additional checks to ensure the incremental dealt with fewer items.
|
// RunAndCheckBackup(t, ctx, &incBO, incMB, true)
|
||||||
assert.Greater(t, bo.Results.ItemsWritten, incBO.Results.ItemsWritten, "incremental items written")
|
// CheckBackupIsInManifests(
|
||||||
assert.Greater(t, bo.Results.ItemsRead, incBO.Results.ItemsRead, "incremental items read")
|
// t,
|
||||||
assert.Greater(t, bo.Results.BytesRead, incBO.Results.BytesRead, "incremental bytes read")
|
// ctx,
|
||||||
assert.Greater(t, bo.Results.BytesUploaded, incBO.Results.BytesUploaded, "incremental bytes uploaded")
|
// bod.KW,
|
||||||
assert.Equal(t, bo.Results.ResourceOwners, incBO.Results.ResourceOwners, "incremental backup resource owner")
|
// bod.SW,
|
||||||
assert.NoError(t, incBO.Errors.Failure(), "incremental non-recoverable error", clues.ToCore(bo.Errors.Failure()))
|
// &incBO,
|
||||||
assert.Empty(t, incBO.Errors.Recovered(), "count incremental recoverable/iteration errors")
|
// sel,
|
||||||
assert.Equal(t, 1, incMB.TimesCalled[events.BackupEnd], "incremental backup-end events")
|
// userID,
|
||||||
|
// test.category)
|
||||||
|
// CheckMetadataFilesExist(
|
||||||
|
// t,
|
||||||
|
// ctx,
|
||||||
|
// incBO.Results.BackupID,
|
||||||
|
// bod.KW,
|
||||||
|
// bod.KMS,
|
||||||
|
// m365.AzureTenantID,
|
||||||
|
// userID,
|
||||||
|
// path.ExchangeService,
|
||||||
|
// map[path.CategoryType][][]string{test.category: test.metadataFiles})
|
||||||
|
// deeTD.CheckBackupDetails(
|
||||||
|
// t,
|
||||||
|
// ctx,
|
||||||
|
// incBO.Results.BackupID,
|
||||||
|
// whatSet,
|
||||||
|
// bod.KMS,
|
||||||
|
// bod.SSS,
|
||||||
|
// expectDeets,
|
||||||
|
// false)
|
||||||
|
|
||||||
|
// // do some additional checks to ensure the incremental dealt with fewer items.
|
||||||
|
// assert.Greater(t, bo.Results.ItemsWritten, incBO.Results.ItemsWritten, "incremental items written")
|
||||||
|
// assert.Greater(t, bo.Results.ItemsRead, incBO.Results.ItemsRead, "incremental items read")
|
||||||
|
// assert.Greater(t, bo.Results.BytesRead, incBO.Results.BytesRead, "incremental bytes read")
|
||||||
|
// assert.Greater(t, bo.Results.BytesUploaded, incBO.Results.BytesUploaded, "incremental bytes uploaded")
|
||||||
|
// assert.Equal(t, bo.Results.ResourceOwners, incBO.Results.ResourceOwners, "incremental backup resource owner")
|
||||||
|
// assert.NoError(t, incBO.Errors.Failure(), "incremental non-recoverable error", clues.ToCore(bo.Errors.Failure()))
|
||||||
|
// assert.Empty(t, incBO.Errors.Recovered(), "count incremental recoverable/iteration errors")
|
||||||
|
// assert.Equal(t, 1, incMB.TimesCalled[events.BackupEnd], "incremental backup-end events")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user