Skip to content

Commit 47f1b9e

Browse files
authored
Merge pull request #3964 from apostasie/ci-kill-pull-noise
--quiet image pulls in tests
2 parents 2f9a4f6 + 678822a commit 47f1b9e

14 files changed

+48
-48
lines changed

cmd/nerdctl/container/container_list_linux_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type psTestContainer struct {
4343
func preparePsTestContainer(t *testing.T, identity string, keepAlive bool) (*testutil.Base, psTestContainer) {
4444
base := testutil.NewBase(t)
4545

46-
base.Cmd("pull", testutil.CommonImage).AssertOK()
46+
base.Cmd("pull", "--quiet", testutil.CommonImage).AssertOK()
4747

4848
testContainerName := testutil.Identifier(t) + identity
4949
rwVolName := testContainerName + "-rw"

cmd/nerdctl/container/container_list_windows_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ type psTestContainer struct {
3838
func preparePsTestContainer(t *testing.T, identity string, restart bool, hyperv bool) (*testutil.Base, psTestContainer) {
3939
base := testutil.NewBase(t)
4040

41-
base.Cmd("pull", testutil.NginxAlpineImage).AssertOK()
41+
base.Cmd("pull", "--quiet", testutil.NginxAlpineImage).AssertOK()
4242

4343
testContainerName := testutil.Identifier(t) + identity
4444
t.Cleanup(func() {

cmd/nerdctl/container/container_run_linux_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func TestRunCustomRootfs(t *testing.T) {
6666
}
6767

6868
func prepareCustomRootfs(base *testutil.Base, imageName string) string {
69-
base.Cmd("pull", imageName).AssertOK()
69+
base.Cmd("pull", "--quiet", imageName).AssertOK()
7070
tmpDir, err := os.MkdirTemp(base.T.TempDir(), "test-save")
7171
assert.NilError(base.T, err)
7272
defer os.RemoveAll(tmpDir)

cmd/nerdctl/container/container_run_log_driver_syslog_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func runSyslogTest(t *testing.T, networks []string, syslogFacilities map[string]
3939
}
4040

4141
base := testutil.NewBase(t)
42-
base.Cmd("pull", testutil.CommonImage).AssertOK()
42+
base.Cmd("pull", "--quiet", testutil.CommonImage).AssertOK()
4343
hostname, err := os.Hostname()
4444
if err != nil {
4545
t.Fatalf("Error retrieving hostname")

cmd/nerdctl/container/container_run_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ func TestRunAddHostRemainsWhenAnotherContainerCreated(t *testing.T) {
534534
// https://github.com/containerd/nerdctl/issues/2726
535535
func TestRunRmTime(t *testing.T) {
536536
base := testutil.NewBase(t)
537-
base.Cmd("pull", testutil.CommonImage)
537+
base.Cmd("pull", "--quiet", testutil.CommonImage)
538538
t0 := time.Now()
539539
base.Cmd("run", "--rm", testutil.CommonImage, "true").AssertOK()
540540
t1 := time.Now()

cmd/nerdctl/container/container_run_user_linux_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func TestRunAddGroup_CVE_2023_25173(t *testing.T) {
168168
},
169169
}
170170

171-
base.Cmd("pull", testutil.BusyboxImage).AssertOK()
171+
base.Cmd("pull", "--quiet", testutil.BusyboxImage).AssertOK()
172172
for _, testCase := range testCases {
173173
cmd := []string{"run", "--rm"}
174174
if testCase.user != "" {

cmd/nerdctl/container/multi_platform_linux_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func TestMultiPlatformPullPushAllPlatforms(t *testing.T) {
113113
pushImageName := fmt.Sprintf("localhost:%d/%s:latest", reg.Port, tID)
114114
defer base.Cmd("rmi", pushImageName).Run()
115115

116-
base.Cmd("pull", "--all-platforms", testutil.AlpineImage).AssertOK()
116+
base.Cmd("pull", "--quiet", "--all-platforms", testutil.AlpineImage).AssertOK()
117117
base.Cmd("tag", testutil.AlpineImage, pushImageName).AssertOK()
118118
base.Cmd("push", "--all-platforms", pushImageName).AssertOK()
119119
testMultiPlatformRun(base, pushImageName)

cmd/nerdctl/image/image_inspect_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func TestImageInspectSimpleCases(t *testing.T) {
3939

4040
testCase := &test.Case{
4141
Setup: func(data test.Data, helpers test.Helpers) {
42-
helpers.Ensure("pull", testutil.CommonImage)
42+
helpers.Ensure("pull", "--quiet", testutil.CommonImage)
4343
},
4444
SubTests: []*test.Case{
4545
{

cmd/nerdctl/image/image_load_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func TestLoadQuiet(t *testing.T) {
9292
Description: "TestLoadQuiet",
9393
Setup: func(data test.Data, helpers test.Helpers) {
9494
identifier := data.Identifier()
95-
helpers.Ensure("pull", testutil.CommonImage)
95+
helpers.Ensure("pull", "--quiet", testutil.CommonImage)
9696
helpers.Ensure("tag", testutil.CommonImage, identifier)
9797
helpers.Ensure("save", identifier, "-o", filepath.Join(data.TempDir(), "common.tar"))
9898
helpers.Ensure("rmi", "-f", identifier)

cmd/nerdctl/image/image_pull_linux_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ CMD ["echo", "nerdctl-build-test-string"]
8686
{
8787
Description: "Pull with the correct key",
8888
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
89-
return helpers.Command("pull", "--verify=cosign", "--cosign-key="+keyPair.PublicKey, data.Get("imageref")+":one")
89+
return helpers.Command("pull", "--quiet", "--verify=cosign", "--cosign-key="+keyPair.PublicKey, data.Get("imageref")+":one")
9090
},
9191
Expected: test.Expects(0, nil, nil),
9292
},
@@ -97,7 +97,7 @@ CMD ["echo", "nerdctl-build-test-string"]
9797
},
9898
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
9999
newKeyPair := testhelpers.NewCosignKeyPair(t, "cosign-key-pair-test", "2")
100-
return helpers.Command("pull", "--verify=cosign", "--cosign-key="+newKeyPair.PublicKey, data.Get("imageref")+":two")
100+
return helpers.Command("pull", "--quiet", "--verify=cosign", "--cosign-key="+newKeyPair.PublicKey, data.Get("imageref")+":two")
101101
},
102102
Expected: test.Expects(12, nil, nil),
103103
},

0 commit comments

Comments
 (0)