Skip to content

Commit 3abc048

Browse files
committed
style: wrap long lines in tests to satisfy lll linter
Signed-off-by: cainydev <wajo432@gmail.com>
1 parent d241b08 commit 3abc048

4 files changed

Lines changed: 32 additions & 20 deletions

File tree

pkg/api/routes_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,9 @@ func TestRoutes(t *testing.T) {
10301030
"Content-Length": "100",
10311031
},
10321032
&mocks.MockedImageStore{
1033-
FullBlobUploadFn: func(ctx context.Context, repo string, body io.Reader, digest godigest.Digest) (string, int64, error) {
1033+
FullBlobUploadFn: func(ctx context.Context, repo string, body io.Reader,
1034+
digest godigest.Digest,
1035+
) (string, int64, error) {
10341036
return sessionStr, 0, zerr.ErrBadBlobDigest
10351037
},
10361038
})
@@ -1046,7 +1048,9 @@ func TestRoutes(t *testing.T) {
10461048
"Content-Length": "100",
10471049
},
10481050
&mocks.MockedImageStore{
1049-
FullBlobUploadFn: func(ctx context.Context, repo string, body io.Reader, digest godigest.Digest) (string, int64, error) {
1051+
FullBlobUploadFn: func(ctx context.Context, repo string, body io.Reader,
1052+
digest godigest.Digest,
1053+
) (string, int64, error) {
10501054
return sessionStr, 20, nil
10511055
},
10521056
})

pkg/storage/gcs/gcs_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1167,7 +1167,8 @@ func TestGCSStorageAPIs(t *testing.T) {
11671167
So(err, ShouldBeNil)
11681168
So(bupload, ShouldEqual, int64(firstChunkLen))
11691169

1170-
bupload, err = imgStore.PutBlobChunk(context.Background(), "test", upload, int64(firstChunkLen), int64(buflen), secondChunkBuf)
1170+
bupload, err = imgStore.PutBlobChunk(context.Background(), "test", upload,
1171+
int64(firstChunkLen), int64(buflen), secondChunkBuf)
11711172
So(err, ShouldBeNil)
11721173
So(bupload, ShouldEqual, int64(firstChunkLen+secondChunkLen))
11731174

pkg/storage/s3/s3_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,8 @@ func TestNegativeCasesObjectsStorage(t *testing.T) {
822822
}, errS3
823823
},
824824
})
825-
_, err := imgStore.PutBlobChunk(context.Background(), testImage, "uuid", 12, 100, io.NopCloser(strings.NewReader("")))
825+
_, err := imgStore.PutBlobChunk(context.Background(), testImage, "uuid", 12, 100,
826+
io.NopCloser(strings.NewReader("")))
826827
So(err, ShouldNotBeNil)
827828
})
828829

pkg/storage/storage_test.go

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,8 @@ func TestStorageAPIs(t *testing.T) {
11421142
So(err, ShouldBeNil)
11431143
So(bupload, ShouldEqual, int64(firstChunkLen))
11441144

1145-
bupload, err = imgStore.PutBlobChunk(context.Background(), "test", upload, int64(firstChunkLen), int64(buflen), secondChunkBuf)
1145+
bupload, err = imgStore.PutBlobChunk(context.Background(), "test", upload,
1146+
int64(firstChunkLen), int64(buflen), secondChunkBuf)
11461147
So(err, ShouldBeNil)
11471148
So(bupload, ShouldEqual, int64(firstChunkLen+secondChunkLen))
11481149

@@ -2620,12 +2621,13 @@ func TestGarbageCollectImageManifest(t *testing.T) {
26202621
artifactBlobDigest := godigest.FromBytes(artifactBlob)
26212622

26222623
// push layer
2623-
_, _, err = imgStore.FullBlobUpload(context.Background(), repoName, bytes.NewReader(artifactBlob), artifactBlobDigest)
2624+
_, _, err = imgStore.FullBlobUpload(context.Background(), repoName,
2625+
bytes.NewReader(artifactBlob), artifactBlobDigest)
26242626
So(err, ShouldBeNil)
26252627

26262628
// push config
2627-
_, _, err = imgStore.FullBlobUpload(context.Background(), repoName, bytes.NewReader(ispec.DescriptorEmptyJSON.Data),
2628-
ispec.DescriptorEmptyJSON.Digest)
2629+
_, _, err = imgStore.FullBlobUpload(context.Background(), repoName,
2630+
bytes.NewReader(ispec.DescriptorEmptyJSON.Data), ispec.DescriptorEmptyJSON.Digest)
26292631
So(err, ShouldBeNil)
26302632

26312633
artifactManifest := ispec.Manifest{
@@ -2802,12 +2804,13 @@ func TestGarbageCollectImageManifest(t *testing.T) {
28022804
artifactBlobDigest := godigest.FromBytes(artifactBlob)
28032805

28042806
// push layer
2805-
_, _, err = imgStore.FullBlobUpload(context.Background(), repoName, bytes.NewReader(artifactBlob), artifactBlobDigest)
2807+
_, _, err = imgStore.FullBlobUpload(context.Background(), repoName,
2808+
bytes.NewReader(artifactBlob), artifactBlobDigest)
28062809
So(err, ShouldBeNil)
28072810

28082811
// push config
2809-
_, _, err = imgStore.FullBlobUpload(context.Background(), repoName, bytes.NewReader(ispec.DescriptorEmptyJSON.Data),
2810-
ispec.DescriptorEmptyJSON.Digest)
2812+
_, _, err = imgStore.FullBlobUpload(context.Background(), repoName,
2813+
bytes.NewReader(ispec.DescriptorEmptyJSON.Data), ispec.DescriptorEmptyJSON.Digest)
28112814
So(err, ShouldBeNil)
28122815

28132816
artifactManifest := ispec.Manifest{
@@ -3256,12 +3259,13 @@ func TestGarbageCollectImageIndex(t *testing.T) {
32563259
artifactBlobDigest := godigest.FromBytes(artifactBlob)
32573260

32583261
// push layer
3259-
_, _, err := imgStore.FullBlobUpload(context.Background(), repoName, bytes.NewReader(artifactBlob), artifactBlobDigest)
3262+
_, _, err := imgStore.FullBlobUpload(context.Background(), repoName,
3263+
bytes.NewReader(artifactBlob), artifactBlobDigest)
32603264
So(err, ShouldBeNil)
32613265

32623266
// push config
3263-
_, _, err = imgStore.FullBlobUpload(context.Background(), repoName, bytes.NewReader(ispec.DescriptorEmptyJSON.Data),
3264-
ispec.DescriptorEmptyJSON.Digest)
3267+
_, _, err = imgStore.FullBlobUpload(context.Background(), repoName,
3268+
bytes.NewReader(ispec.DescriptorEmptyJSON.Data), ispec.DescriptorEmptyJSON.Digest)
32653269
So(err, ShouldBeNil)
32663270

32673271
artifactManifest := ispec.Manifest{
@@ -3403,12 +3407,13 @@ func TestGarbageCollectImageIndex(t *testing.T) {
34033407
artifactBlobDigest := godigest.FromBytes(artifactBlob)
34043408

34053409
// push layer
3406-
_, _, err = imgStore.FullBlobUpload(context.Background(), repoName, bytes.NewReader(artifactBlob), artifactBlobDigest)
3410+
_, _, err = imgStore.FullBlobUpload(context.Background(), repoName,
3411+
bytes.NewReader(artifactBlob), artifactBlobDigest)
34073412
So(err, ShouldBeNil)
34083413

34093414
// push config
3410-
_, _, err = imgStore.FullBlobUpload(context.Background(), repoName, bytes.NewReader(ispec.DescriptorEmptyJSON.Data),
3411-
ispec.DescriptorEmptyJSON.Digest)
3415+
_, _, err = imgStore.FullBlobUpload(context.Background(), repoName,
3416+
bytes.NewReader(ispec.DescriptorEmptyJSON.Data), ispec.DescriptorEmptyJSON.Digest)
34123417
So(err, ShouldBeNil)
34133418

34143419
// push artifact manifest pointing to index
@@ -3704,12 +3709,13 @@ func TestGarbageCollectChainedImageIndexes(t *testing.T) {
37043709
artifactBlobDigest := godigest.FromBytes(artifactBlob)
37053710

37063711
// push layer
3707-
_, _, err = imgStore.FullBlobUpload(context.Background(), repoName, bytes.NewReader(artifactBlob), artifactBlobDigest)
3712+
_, _, err = imgStore.FullBlobUpload(context.Background(), repoName,
3713+
bytes.NewReader(artifactBlob), artifactBlobDigest)
37083714
So(err, ShouldBeNil)
37093715

37103716
// push config
3711-
_, _, err = imgStore.FullBlobUpload(context.Background(), repoName, bytes.NewReader(ispec.DescriptorEmptyJSON.Data),
3712-
ispec.DescriptorEmptyJSON.Digest)
3717+
_, _, err = imgStore.FullBlobUpload(context.Background(), repoName,
3718+
bytes.NewReader(ispec.DescriptorEmptyJSON.Data), ispec.DescriptorEmptyJSON.Digest)
37133719
So(err, ShouldBeNil)
37143720

37153721
var index ispec.Index

0 commit comments

Comments
 (0)