E2E test for backup reason tags

This commit is contained in:
Ashlie Martinez 2023-10-05 13:07:23 -07:00
parent 5c6d46a581
commit 2e69a97e86

View File

@ -182,6 +182,13 @@ func (suite *ExchangeBackupIntgSuite) TestBackup_Run_exchange() {
assert.Empty(t, bup.MergeBases, "base backup merge base lineage") assert.Empty(t, bup.MergeBases, "base backup merge base lineage")
assert.Empty(t, bup.AssistBases, "base backup assist base lineage") assert.Empty(t, bup.AssistBases, "base backup assist base lineage")
// Reason for backup should have Exchange and the category.
reasons, err := bup.Reasons()
require.NoError(t, err, clues.ToCore(err))
require.Len(t, reasons, 1, "number of reasons for backup")
assert.Equal(t, path.ExchangeService, reasons[0].Service())
assert.Equal(t, test.category, reasons[0].Category())
// Basic, happy path incremental test. No changes are dictated or expected. // Basic, happy path incremental test. No changes are dictated or expected.
// This only tests that an incremental backup is runnable at all, and that it // This only tests that an incremental backup is runnable at all, and that it
// produces fewer results than the last backup. // produces fewer results than the last backup.
@ -248,6 +255,13 @@ func (suite *ExchangeBackupIntgSuite) TestBackup_Run_exchange() {
test.category, test.category,
lineage.Merge[bo.Results.BackupID][0].Category()) lineage.Merge[bo.Results.BackupID][0].Category())
// Reason for backup should have Exchange and the category.
reasons, err = bup.Reasons()
require.NoError(t, err, clues.ToCore(err))
require.Len(t, reasons, 1, "number of reasons for backup")
assert.Equal(t, path.ExchangeService, reasons[0].Service())
assert.Equal(t, test.category, reasons[0].Category())
// do some additional checks to ensure the incremental dealt with fewer items. // 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.ItemsWritten, incBO.Results.ItemsWritten, "incremental items written")
assert.Greater(t, bo.Results.ItemsRead, incBO.Results.ItemsRead, "incremental items read") assert.Greater(t, bo.Results.ItemsRead, incBO.Results.ItemsRead, "incremental items read")