remove stats.Errs (#2591)
## Description Now that fault errors is in place, we don't need the operation stats errs. ## Does this PR need a docs update or release note? - [x] ⛔ No ## Type of change - [x] 🧹 Tech Debt/Cleanup ## Issue(s) * #1970 ## Test Plan - [x] ⚡ Unit test - [x] 💚 E2E
This commit is contained in:
parent
21a5729947
commit
07b4900f58
@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Known Issues
|
### Known Issues
|
||||||
- Folders and Calendars containing zero items or subfolders are not included in the backup.
|
- Folders and Calendars containing zero items or subfolders are not included in the backup.
|
||||||
- OneDrive files ending in `.meta` or `.dirmeta` are omitted from details and restores.
|
- OneDrive files ending in `.meta` or `.dirmeta` are omitted from details and restores.
|
||||||
|
- Backups generated prior to this version will show `0 errors` when listed, even if error count was originally non-zero.
|
||||||
|
|
||||||
## [v0.4.0] (beta) - 2023-2-20
|
## [v0.4.0] (beta) - 2023-2-20
|
||||||
|
|
||||||
|
|||||||
@ -48,7 +48,6 @@ type BackupOperation struct {
|
|||||||
|
|
||||||
// BackupResults aggregate the details of the result of the operation.
|
// BackupResults aggregate the details of the result of the operation.
|
||||||
type BackupResults struct {
|
type BackupResults struct {
|
||||||
stats.Errs // deprecated in place of fault.Errors in the base operation.
|
|
||||||
stats.ReadWrites
|
stats.ReadWrites
|
||||||
stats.StartAndEndTime
|
stats.StartAndEndTime
|
||||||
BackupID model.StableID `json:"backupID"`
|
BackupID model.StableID `json:"backupID"`
|
||||||
|
|||||||
@ -156,8 +156,6 @@ func runAndCheckBackup(
|
|||||||
assert.Equal(t, 1, bo.Results.ResourceOwners, "count of resource owners")
|
assert.Equal(t, 1, bo.Results.ResourceOwners, "count of resource owners")
|
||||||
assert.NoError(t, bo.Errors.Failure(), "incremental non-recoverable error")
|
assert.NoError(t, bo.Errors.Failure(), "incremental non-recoverable error")
|
||||||
assert.Empty(t, bo.Errors.Recovered(), "incremental recoverable/iteration errors")
|
assert.Empty(t, bo.Errors.Recovered(), "incremental recoverable/iteration errors")
|
||||||
assert.NoError(t, bo.Results.ReadErrors, "errors reading data")
|
|
||||||
assert.NoError(t, bo.Results.WriteErrors, "errors writing data")
|
|
||||||
assert.Equal(t, 1, mb.TimesCalled[events.BackupStart], "backup-start events")
|
assert.Equal(t, 1, mb.TimesCalled[events.BackupStart], "backup-start events")
|
||||||
assert.Equal(t, 1, mb.TimesCalled[events.BackupEnd], "backup-end events")
|
assert.Equal(t, 1, mb.TimesCalled[events.BackupEnd], "backup-end events")
|
||||||
assert.Equal(t,
|
assert.Equal(t,
|
||||||
@ -628,8 +626,6 @@ func (suite *BackupOpIntegrationSuite) TestBackup_Run_exchange() {
|
|||||||
assert.Equal(t, bo.Results.ResourceOwners, incBO.Results.ResourceOwners, "incremental backup resource owner")
|
assert.Equal(t, bo.Results.ResourceOwners, incBO.Results.ResourceOwners, "incremental backup resource owner")
|
||||||
assert.NoError(t, incBO.Errors.Failure(), "incremental non-recoverable error")
|
assert.NoError(t, incBO.Errors.Failure(), "incremental non-recoverable error")
|
||||||
assert.Empty(t, incBO.Errors.Recovered(), "count incremental recoverable/iteration errors")
|
assert.Empty(t, incBO.Errors.Recovered(), "count incremental recoverable/iteration errors")
|
||||||
assert.NoError(t, incBO.Results.ReadErrors, "incremental read errors")
|
|
||||||
assert.NoError(t, incBO.Results.WriteErrors, "incremental write errors")
|
|
||||||
assert.Equal(t, 1, incMB.TimesCalled[events.BackupStart], "incremental backup-start events")
|
assert.Equal(t, 1, incMB.TimesCalled[events.BackupStart], "incremental backup-start events")
|
||||||
assert.Equal(t, 1, incMB.TimesCalled[events.BackupEnd], "incremental backup-end events")
|
assert.Equal(t, 1, incMB.TimesCalled[events.BackupEnd], "incremental backup-end events")
|
||||||
assert.Equal(t,
|
assert.Equal(t,
|
||||||
@ -1059,8 +1055,6 @@ func (suite *BackupOpIntegrationSuite) TestBackup_Run_exchangeIncrementals() {
|
|||||||
assert.Equal(t, test.itemsRead+4, incBO.Results.ItemsRead, "incremental items read")
|
assert.Equal(t, test.itemsRead+4, incBO.Results.ItemsRead, "incremental items read")
|
||||||
assert.NoError(t, incBO.Errors.Failure(), "incremental non-recoverable error")
|
assert.NoError(t, incBO.Errors.Failure(), "incremental non-recoverable error")
|
||||||
assert.Empty(t, incBO.Errors.Recovered(), "incremental recoverable/iteration errors")
|
assert.Empty(t, incBO.Errors.Recovered(), "incremental recoverable/iteration errors")
|
||||||
assert.NoError(t, incBO.Results.ReadErrors, "incremental read errors")
|
|
||||||
assert.NoError(t, incBO.Results.WriteErrors, "incremental write errors")
|
|
||||||
assert.Equal(t, 1, incMB.TimesCalled[events.BackupStart], "incremental backup-start events")
|
assert.Equal(t, 1, incMB.TimesCalled[events.BackupStart], "incremental backup-start events")
|
||||||
assert.Equal(t, 1, incMB.TimesCalled[events.BackupEnd], "incremental backup-end events")
|
assert.Equal(t, 1, incMB.TimesCalled[events.BackupEnd], "incremental backup-end events")
|
||||||
assert.Equal(t,
|
assert.Equal(t,
|
||||||
|
|||||||
@ -46,7 +46,6 @@ type RestoreOperation struct {
|
|||||||
|
|
||||||
// RestoreResults aggregate the details of the results of the operation.
|
// RestoreResults aggregate the details of the results of the operation.
|
||||||
type RestoreResults struct {
|
type RestoreResults struct {
|
||||||
stats.Errs // deprecated in place of fault.Errors in the base operation.
|
|
||||||
stats.ReadWrites
|
stats.ReadWrites
|
||||||
stats.StartAndEndTime
|
stats.StartAndEndTime
|
||||||
}
|
}
|
||||||
|
|||||||
@ -379,13 +379,10 @@ func (suite *RestoreOpIntegrationSuite) TestRestore_Run() {
|
|||||||
assert.Equal(t, ro.Status, Completed, "restoreOp status")
|
assert.Equal(t, ro.Status, Completed, "restoreOp status")
|
||||||
assert.Equal(t, ro.Results.ItemsWritten, len(ds.Entries), "count of items written matches restored entries in details")
|
assert.Equal(t, ro.Results.ItemsWritten, len(ds.Entries), "count of items written matches restored entries in details")
|
||||||
assert.Less(t, 0, ro.Results.ItemsRead, "restore items read")
|
assert.Less(t, 0, ro.Results.ItemsRead, "restore items read")
|
||||||
assert.Less(t, 0, ro.Results.ItemsWritten, "restored items written")
|
|
||||||
assert.Less(t, int64(0), ro.Results.BytesRead, "bytes read")
|
assert.Less(t, int64(0), ro.Results.BytesRead, "bytes read")
|
||||||
assert.Equal(t, 1, ro.Results.ResourceOwners, "resource Owners")
|
assert.Equal(t, 1, ro.Results.ResourceOwners, "resource Owners")
|
||||||
assert.NoError(t, ro.Errors.Failure(), "non-recoverable error")
|
assert.NoError(t, ro.Errors.Failure(), "non-recoverable error")
|
||||||
assert.Empty(t, ro.Errors.Recovered(), "recoverable errors")
|
assert.Empty(t, ro.Errors.Recovered(), "recoverable errors")
|
||||||
assert.NoError(t, ro.Results.ReadErrors, "errors while reading restore data")
|
|
||||||
assert.NoError(t, ro.Results.WriteErrors, "errors while writing restore data")
|
|
||||||
assert.Equal(t, test.expectedItems, ro.Results.ItemsWritten, "backup and restore wrote the same num of items")
|
assert.Equal(t, test.expectedItems, ro.Results.ItemsWritten, "backup and restore wrote the same num of items")
|
||||||
assert.Equal(t, 1, mb.TimesCalled[events.RestoreStart], "restore-start events")
|
assert.Equal(t, 1, mb.TimesCalled[events.RestoreStart], "restore-start events")
|
||||||
assert.Equal(t, 1, mb.TimesCalled[events.RestoreEnd], "restore-end events")
|
assert.Equal(t, 1, mb.TimesCalled[events.RestoreEnd], "restore-end events")
|
||||||
|
|||||||
@ -15,12 +15,6 @@ type ReadWrites struct {
|
|||||||
ResourceOwners int `json:"resourceOwners,omitempty"`
|
ResourceOwners int `json:"resourceOwners,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Errs tracks the aggregation of errors that occurred during a process.
|
|
||||||
type Errs struct {
|
|
||||||
ReadErrors error `json:"readErrors,omitempty"`
|
|
||||||
WriteErrors error `json:"writeErrors,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// StartAndEndTime tracks a paired starting time and ending time.
|
// StartAndEndTime tracks a paired starting time and ending time.
|
||||||
type StartAndEndTime struct {
|
type StartAndEndTime struct {
|
||||||
StartedAt time.Time `json:"startedAt"`
|
StartedAt time.Time `json:"startedAt"`
|
||||||
|
|||||||
@ -40,7 +40,6 @@ type Backup struct {
|
|||||||
ErrorCount int `json:"errorCount"`
|
ErrorCount int `json:"errorCount"`
|
||||||
|
|
||||||
// stats are embedded so that the values appear as top-level properties
|
// stats are embedded so that the values appear as top-level properties
|
||||||
stats.Errs // Deprecated, replaced with Errors.
|
|
||||||
stats.ReadWrites
|
stats.ReadWrites
|
||||||
stats.StartAndEndTime
|
stats.StartAndEndTime
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,10 +45,6 @@ func stubBackup(t time.Time) backup.Backup {
|
|||||||
Errors: fault.Errors{
|
Errors: fault.Errors{
|
||||||
Recovered: []error{errors.New("read"), errors.New("write")},
|
Recovered: []error{errors.New("read"), errors.New("write")},
|
||||||
},
|
},
|
||||||
Errs: stats.Errs{
|
|
||||||
ReadErrors: errors.New("1"),
|
|
||||||
WriteErrors: errors.New("1"),
|
|
||||||
},
|
|
||||||
ReadWrites: stats.ReadWrites{
|
ReadWrites: stats.ReadWrites{
|
||||||
BytesRead: 301,
|
BytesRead: 301,
|
||||||
BytesUploaded: 301,
|
BytesUploaded: 301,
|
||||||
|
|||||||
@ -187,8 +187,6 @@ func runBackupLoadTest(
|
|||||||
assert.Equal(t, len(users), b.Results.ResourceOwners, "resource owners")
|
assert.Equal(t, len(users), b.Results.ResourceOwners, "resource owners")
|
||||||
assert.NoError(t, b.Errors.Failure(), "non-recoverable error")
|
assert.NoError(t, b.Errors.Failure(), "non-recoverable error")
|
||||||
assert.Empty(t, b.Errors.Recovered(), "recoverable errors")
|
assert.Empty(t, b.Errors.Recovered(), "recoverable errors")
|
||||||
assert.NoError(t, b.Results.ReadErrors, "read errors")
|
|
||||||
assert.NoError(t, b.Results.WriteErrors, "write errors")
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -296,8 +294,6 @@ func doRestoreLoadTest(
|
|||||||
assert.Equal(t, len(users), r.Results.ResourceOwners, "resource owners")
|
assert.Equal(t, len(users), r.Results.ResourceOwners, "resource owners")
|
||||||
assert.NoError(t, r.Errors.Failure(), "non-recoverable error")
|
assert.NoError(t, r.Errors.Failure(), "non-recoverable error")
|
||||||
assert.Empty(t, r.Errors.Recovered(), "recoverable errors")
|
assert.Empty(t, r.Errors.Recovered(), "recoverable errors")
|
||||||
assert.NoError(t, r.Results.ReadErrors, "read errors")
|
|
||||||
assert.NoError(t, r.Results.WriteErrors, "write errors")
|
|
||||||
assert.Equal(t, expectItemCount, r.Results.ItemsWritten, "backup and restore wrote the same count of items")
|
assert.Equal(t, expectItemCount, r.Results.ItemsWritten, "backup and restore wrote the same count of items")
|
||||||
|
|
||||||
ensureAllUsersInDetails(t, users, ds, "restore", name)
|
ensureAllUsersInDetails(t, users, ds, "restore", name)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user