Name each prefix once in restore, verify and purge errors (closes #327)
check / check (push) Successful in 12m22s
check / check (push) Successful in 12m22s
A missing blob during restore, a failed shallow verify and an invalid purge duration each printed their prefix twice. FetchBlob now returns the storage error as is, since restore and deep verify name the blob themselves; purge returns the duration parser's error unchanged; and a failed shallow verify wraps "problems found in storage" instead of "verification failed", which the command already prints. Deep verify words a storage error other than not found as a blob it could not check, and its log line no longer says S3. Already fixed for #314: the deep verify size message naming S3 and other errors called missing; tests now check both. Not tested: the log line. Model: opus-5-5
This commit was merged in pull request #377.
This commit is contained in:
@@ -27,7 +27,7 @@ import (
|
||||
// then grows one stored blob so its size no longer matches the manifest.
|
||||
// Shallow verify must then fail, count the grown blob as a size mismatch,
|
||||
// and drop it from the verified count rather than continuing to report it
|
||||
// as checked.
|
||||
// as checked, and its error must not repeat the cli layer's prefix.
|
||||
func TestShallowVerifyDetectsWrongBlobSize(t *testing.T) {
|
||||
log.Initialize(log.Config{})
|
||||
t.Parallel()
|
||||
@@ -96,6 +96,12 @@ func TestShallowVerifyDetectsWrongBlobSize(t *testing.T) {
|
||||
require.Equal(t, 1, bad.Mismatched)
|
||||
require.Equal(t, healthy.BlobCount-1, bad.Verified,
|
||||
"the wrong-sized blob must not be counted as verified")
|
||||
|
||||
// The cli layer prints this error after its own "Verification failed:".
|
||||
err = newVerifier(io.Discard).VerifySnapshotWithOptions(
|
||||
snapshotID, &vaultik.VerifyOptions{})
|
||||
require.EqualError(t, err,
|
||||
"problems found in storage: 1 blobs have the wrong size")
|
||||
}
|
||||
|
||||
// TestShallowVerifyDetectsMissingDatabase backs up a real snapshot,
|
||||
|
||||
Reference in New Issue
Block a user