From 4e97729f14d1cfb4d53c2a0bb4cbbf488f865ccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Tue, 18 Feb 2025 12:23:47 +0100 Subject: [PATCH] c8d/list: Test with SharedSize = true MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For additional coverage Signed-off-by: Paweł Gronowski --- daemon/containerd/image_list_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/daemon/containerd/image_list_test.go b/daemon/containerd/image_list_test.go index 0242536ad5..7da51a4bcc 100644 --- a/daemon/containerd/image_list_test.go +++ b/daemon/containerd/image_list_test.go @@ -104,7 +104,7 @@ func BenchmarkImageList(b *testing.B) { b.Run(strconv.Itoa(count)+"-images", func(b *testing.B) { for i := 0; i < b.N; i++ { - _, err := imgSvc.Images(ctx, imagetypes.ListOptions{All: true}) + _, err := imgSvc.Images(ctx, imagetypes.ListOptions{All: true, SharedSize: true}) assert.NilError(b, err) } }) @@ -129,7 +129,7 @@ func TestImageListCheckTotalSize(t *testing.T) { _, err = service.images.Create(ctx, imagesFromIndex(twoplatform)[0]) assert.NilError(t, err) - all, err := service.Images(ctx, imagetypes.ListOptions{Manifests: true}) + all, err := service.Images(ctx, imagetypes.ListOptions{Manifests: true, SharedSize: true}) assert.NilError(t, err) assert.Check(t, is.Len(all, 1)) @@ -204,7 +204,6 @@ func TestImageList(t *testing.T) { for _, tc := range []struct { name string images []c8dimages.Image - opts imagetypes.ListOptions check func(*testing.T, []*imagetypes.Summary) }{ @@ -334,8 +333,10 @@ func TestImageList(t *testing.T) { assert.NilError(t, err) } - opts := tc.opts - opts.Manifests = true + opts := imagetypes.ListOptions{ + Manifests: true, + SharedSize: true, + } all, err := service.Images(ctx, opts) assert.NilError(t, err)