Report comparison cleanup recovery state

This commit is contained in:
2026-08-13 03:18:55 +00:00
parent 302f5aba2d
commit 79cba800ee
11 changed files with 228 additions and 51 deletions

View File

@@ -179,12 +179,36 @@ func TestSafeComparisonSummaryErrorClassifiesWrappedFailures(t *testing.T) {
message: "comparison destination preflight failed",
},
{
name: "publication cleanup",
name: "complete cleanup recovery",
err: fmt.Errorf("outer wrapper: %w", &comparison.PublicationCleanupError{
RetainedBackupPath: "/tmp/" + unsafeDetail, Err: fmt.Errorf("%w: %s", context.Canceled, unsafeDetail),
RecoveryState: comparison.BackupRecoveryComplete, RecoveryPath: "/tmp/" + unsafeDetail, Err: fmt.Errorf("%w: %s", context.Canceled, unsafeDetail),
}),
category: "publication_cleanup",
message: "comparison published but cleanup did not complete",
message: "comparison published but a complete prior bundle remains",
},
{
name: "partial cleanup remnants",
err: fmt.Errorf("outer wrapper: %w", &comparison.PublicationCleanupError{
RecoveryState: comparison.BackupRecoveryPartial, RecoveryPath: "/tmp/" + unsafeDetail, Err: fmt.Errorf("%w: %s", context.Canceled, unsafeDetail),
}),
category: "publication_cleanup",
message: "comparison published but partial cleanup remnants remain",
},
{
name: "absent cleanup recovery",
err: fmt.Errorf("outer wrapper: %w", &comparison.PublicationCleanupError{
RecoveryState: comparison.BackupRecoveryAbsent, Err: fmt.Errorf("%w: %s", context.Canceled, unsafeDetail),
}),
category: "publication_cleanup",
message: "comparison published but no prior bundle remains",
},
{
name: "unknown cleanup recovery",
err: fmt.Errorf("outer wrapper: %w", &comparison.PublicationCleanupError{
RecoveryState: comparison.BackupRecoveryUnknown, Err: fmt.Errorf("%w: %s", context.Canceled, unsafeDetail),
}),
category: "publication_cleanup",
message: "comparison published but cleanup recovery state is unknown",
},
{
name: "unknown",