fix: the backup package checks or explicitly drops every error the linter flags
release / govulncheck (push) Successful in 24s
release / web (push) Successful in 1m25s
release / go (push) Failing after 1m42s
release / android (push) Successful in 4m52s
release / Build signed APK (push) Successful in 5m1s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / integration (push) Canceled after 5m17s
release / govulncheck (push) Successful in 24s
release / web (push) Successful in 1m25s
release / go (push) Failing after 1m42s
release / android (push) Successful in 4m52s
release / Build signed APK (push) Successful in 5m1s
release / Attach APK to the Release (tag releases only) (push) Canceled after 0s
release / Build + push container image (push) Canceled after 0s
release / Verify release artifacts (tag releases only) (push) Canceled after 0s
release / integration (push) Canceled after 5m17s
Closing a refused S3 response and a test file, and the fake bucket's writes, now say they ignore the error on purpose; handler parameters the tests don't use are named _. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -154,7 +154,7 @@ func TestWriteFileLandsUnderTheDatedNameOnly(t *testing.T) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
defer f.Close()
|
defer func() { _ = f.Close() }()
|
||||||
if _, _, err := Read(f); err != nil {
|
if _, _, err := Read(f); err != nil {
|
||||||
t.Errorf("the written file doesn't read: %v", err)
|
t.Errorf("the written file doesn't read: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ func (b Bucket) do(req *http.Request, payloadSHA256 string) (*http.Response, err
|
|||||||
return nil, fmt.Errorf("%w: %s is unreachable: %v", ErrS3, req.URL.Host, err)
|
return nil, fmt.Errorf("%w: %s is unreachable: %v", ErrS3, req.URL.Host, err)
|
||||||
}
|
}
|
||||||
if resp.StatusCode/100 != 2 {
|
if resp.StatusCode/100 != 2 {
|
||||||
defer resp.Body.Close()
|
defer func() { _ = resp.Body.Close() }()
|
||||||
return nil, refusal(resp)
|
return nil, refusal(resp)
|
||||||
}
|
}
|
||||||
return resp, nil
|
return resp, nil
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ func testBucket(url string) Bucket {
|
|||||||
func TestPutSendsTheBodyToItsPathStyleKey(t *testing.T) {
|
func TestPutSendsTheBodyToItsPathStyleKey(t *testing.T) {
|
||||||
var gotPath, gotSHA, gotBody, gotAuth string
|
var gotPath, gotSHA, gotBody, gotAuth string
|
||||||
var gotLen int64
|
var gotLen int64
|
||||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
srv := httptest.NewServer(http.HandlerFunc(func(_ http.ResponseWriter, r *http.Request) {
|
||||||
gotPath, gotSHA, gotAuth, gotLen = r.URL.EscapedPath(), r.Header.Get("X-Amz-Content-Sha256"), r.Header.Get("Authorization"), r.ContentLength
|
gotPath, gotSHA, gotAuth, gotLen = r.URL.EscapedPath(), r.Header.Get("X-Amz-Content-Sha256"), r.Header.Get("Authorization"), r.ContentLength
|
||||||
b, _ := io.ReadAll(r.Body)
|
b, _ := io.ReadAll(r.Body)
|
||||||
gotBody = string(b)
|
gotBody = string(b)
|
||||||
@@ -108,13 +108,13 @@ func TestListFollowsContinuationTokens(t *testing.T) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if q.Get("continuation-token") == "" {
|
if q.Get("continuation-token") == "" {
|
||||||
fmt.Fprint(w, `<ListBucketResult><IsTruncated>true</IsTruncated><NextContinuationToken>next</NextContinuationToken>
|
_, _ = fmt.Fprint(w, `<ListBucketResult><IsTruncated>true</IsTruncated><NextContinuationToken>next</NextContinuationToken>
|
||||||
<Contents><Key>database/minstrel-20261101T030000Z.tar</Key><Size>10</Size><LastModified>2026-11-01T03:00:05.000Z</LastModified></Contents>
|
<Contents><Key>database/minstrel-20261101T030000Z.tar</Key><Size>10</Size><LastModified>2026-11-01T03:00:05.000Z</LastModified></Contents>
|
||||||
<Contents><Key>database/minstrel-20261102T030000Z.tar</Key><Size>11</Size><LastModified>2026-11-02T03:00:05.000Z</LastModified></Contents>
|
<Contents><Key>database/minstrel-20261102T030000Z.tar</Key><Size>11</Size><LastModified>2026-11-02T03:00:05.000Z</LastModified></Contents>
|
||||||
</ListBucketResult>`)
|
</ListBucketResult>`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
fmt.Fprint(w, `<ListBucketResult><IsTruncated>false</IsTruncated>
|
_, _ = fmt.Fprint(w, `<ListBucketResult><IsTruncated>false</IsTruncated>
|
||||||
<Contents><Key>database/minstrel-20261103T030000Z.tar</Key><Size>12</Size><LastModified>2026-11-03T03:00:05.000Z</LastModified></Contents>
|
<Contents><Key>database/minstrel-20261103T030000Z.tar</Key><Size>12</Size><LastModified>2026-11-03T03:00:05.000Z</LastModified></Contents>
|
||||||
</ListBucketResult>`)
|
</ListBucketResult>`)
|
||||||
}))
|
}))
|
||||||
@@ -131,9 +131,9 @@ func TestListFollowsContinuationTokens(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestARefusalSaysWhatIsWrong(t *testing.T) {
|
func TestARefusalSaysWhatIsWrong(t *testing.T) {
|
||||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
|
||||||
w.WriteHeader(http.StatusForbidden)
|
w.WriteHeader(http.StatusForbidden)
|
||||||
fmt.Fprint(w, `<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match</Message></Error>`)
|
_, _ = fmt.Fprint(w, `<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match</Message></Error>`)
|
||||||
}))
|
}))
|
||||||
defer srv.Close()
|
defer srv.Close()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user