Skip to content

Commit 1784864

Browse files
committed
Remove deprecated info parameter in tigron funcs
Signed-off-by: apostasie <spam_blackhole@farcloser.world>
1 parent 4c0dd00 commit 1784864

File tree

57 files changed

+389
-399
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+389
-399
lines changed

cmd/nerdctl/builder/builder_build_oci_layout_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,13 @@ CMD ["echo", "test-nerdctl-build-context-oci-layout"]`
100100
},
101101
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
102102
return &test.Expected{
103-
Output: func(stdout string, info string, t *testing.T) {
103+
Output: func(stdout string, t *testing.T) {
104104
assert.Assert(
105105
t,
106106
strings.Contains(
107107
helpers.Capture("run", "--rm", data.Identifier("child")),
108108
"test-nerdctl-build-context-oci-layout",
109109
),
110-
info,
111110
)
112111
},
113112
}

cmd/nerdctl/builder/builder_build_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ COPY %s /`, testFileName)
342342
},
343343
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
344344
return &test.Expected{
345-
Output: func(stdout, info string, t *testing.T) {
345+
Output: func(stdout string, t *testing.T) {
346346
// Expecting testFileName to exist inside the output target directory
347347
assert.Equal(t, data.Temp().Load(testFileName), testContent, "file content is identical")
348348
},
@@ -356,7 +356,7 @@ COPY %s /`, testFileName)
356356
},
357357
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
358358
return &test.Expected{
359-
Output: func(stdout, info string, t *testing.T) {
359+
Output: func(stdout string, t *testing.T) {
360360
assert.Equal(t, data.Temp().Load(testFileName), testContent, "file content is identical")
361361
},
362362
}
@@ -894,7 +894,7 @@ func TestBuildAttestation(t *testing.T) {
894894
},
895895
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
896896
return &test.Expected{
897-
Output: func(stdout, info string, t *testing.T) {
897+
Output: func(stdout string, t *testing.T) {
898898
files, err := os.ReadDir(data.Temp().Path("dir-for-bom"))
899899
assert.NilError(t, err, "failed to read directory")
900900

@@ -926,7 +926,7 @@ func TestBuildAttestation(t *testing.T) {
926926
},
927927
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
928928
return &test.Expected{
929-
Output: func(stdout, info string, t *testing.T) {
929+
Output: func(stdout string, t *testing.T) {
930930
files, err := os.ReadDir(data.Temp().Path("dir-for-prov"))
931931
assert.NilError(t, err, "failed to read directory")
932932

@@ -959,7 +959,7 @@ func TestBuildAttestation(t *testing.T) {
959959
},
960960
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
961961
return &test.Expected{
962-
Output: func(stdout, info string, t *testing.T) {
962+
Output: func(stdout string, t *testing.T) {
963963
// Check if any file in the directory matches the SBOM file pattern
964964
files, err := os.ReadDir(data.Temp().Path("dir-for-attest"))
965965
assert.NilError(t, err, "failed to read directory")

cmd/nerdctl/compose/compose_config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ services:
113113
testCase.Expected = func(data test.Data, helpers test.Helpers) *test.Expected {
114114
return &test.Expected{
115115
ExitCode: 0,
116-
Output: func(stdout, info string, t *testing.T) {
116+
Output: func(stdout string, t *testing.T) {
117117
assert.Assert(t, data.Labels().Get("hash") != stdout, "hash should be different")
118118
},
119119
}

cmd/nerdctl/compose/compose_cp_linux_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ services:
7777
},
7878
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
7979
return &test.Expected{
80-
Output: func(stdout, info string, t *testing.T) {
80+
Output: func(stdout string, t *testing.T) {
8181
copied := data.Temp().Load("test-file2")
8282
assert.Equal(t, copied, testFileContent)
8383
},

cmd/nerdctl/compose/compose_create_linux_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ services:
6464
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
6565
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "ps", "svc0", "-a")
6666
},
67-
Expected: test.Expects(expect.ExitCodeSuccess, nil, func(stdout, info string, t *testing.T) {
67+
Expected: test.Expects(expect.ExitCodeSuccess, nil, func(stdout string, t *testing.T) {
6868
assert.Assert(t,
6969
strings.Contains(stdout, "created") || strings.Contains(stdout, "Created"),
7070
"stdout should contain `created`")
@@ -121,7 +121,7 @@ services:
121121
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
122122
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "ps", "svc0", "-a")
123123
},
124-
Expected: test.Expects(expect.ExitCodeSuccess, nil, func(stdout, info string, t *testing.T) {
124+
Expected: test.Expects(expect.ExitCodeSuccess, nil, func(stdout string, t *testing.T) {
125125
assert.Assert(t,
126126
strings.Contains(stdout, "created") || strings.Contains(stdout, "Created"),
127127
"stdout should contain `created`")
@@ -133,7 +133,7 @@ services:
133133
Command: func(data test.Data, helpers test.Helpers) test.TestableCommand {
134134
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "ps", "svc1", "-a")
135135
},
136-
Expected: test.Expects(expect.ExitCodeSuccess, nil, func(stdout, info string, t *testing.T) {
136+
Expected: test.Expects(expect.ExitCodeSuccess, nil, func(stdout string, t *testing.T) {
137137
assert.Assert(t,
138138
strings.Contains(stdout, "created") || strings.Contains(stdout, "Created"),
139139
"stdout should contain `created`")

cmd/nerdctl/compose/compose_images_linux_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ volumes:
106106
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "images", "--format", "json")
107107
},
108108
Expected: test.Expects(expect.ExitCodeSuccess, nil, expect.All(
109-
expect.JSON([]composeContainerPrintable{}, func(printables []composeContainerPrintable, s string, t tig.T) {
109+
expect.JSON([]composeContainerPrintable{}, func(printables []composeContainerPrintable, t tig.T) {
110110
assert.Equal(t, len(printables), 2)
111111
}),
112112
expect.Contains(`"ContainerName":"wordpress"`, `"ContainerName":"db"`),
@@ -118,7 +118,7 @@ volumes:
118118
return helpers.Command("compose", "-f", data.Labels().Get("composeYaml"), "images", "--format", "json", "wordpress")
119119
},
120120
Expected: test.Expects(expect.ExitCodeSuccess, nil, expect.All(
121-
expect.JSON([]composeContainerPrintable{}, func(printables []composeContainerPrintable, s string, t tig.T) {
121+
expect.JSON([]composeContainerPrintable{}, func(printables []composeContainerPrintable, t tig.T) {
122122
assert.Equal(t, len(printables), 1)
123123
}),
124124
expect.Contains(`"ContainerName":"wordpress"`),

cmd/nerdctl/compose/compose_rm_linux_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ volumes:
7878
},
7979
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
8080
return &test.Expected{
81-
Output: func(stdout, info string, t *testing.T) {
81+
Output: func(stdout string, t *testing.T) {
8282
wp := helpers.Capture("compose", "-f", data.Labels().Get("yamlPath"), "ps", "wordpress")
8383
db := helpers.Capture("compose", "-f", data.Labels().Get("yamlPath"), "ps", "db")
8484
comp := expect.Match(regexp.MustCompile("Up|running"))
85-
comp(wp, "", t)
86-
comp(db, "", t)
85+
comp(wp, t)
86+
comp(db, t)
8787
},
8888
}
8989
},
@@ -97,11 +97,11 @@ volumes:
9797
},
9898
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
9999
return &test.Expected{
100-
Output: func(stdout, info string, t *testing.T) {
100+
Output: func(stdout string, t *testing.T) {
101101
wp := helpers.Capture("compose", "-f", data.Labels().Get("yamlPath"), "ps", "wordpress")
102102
db := helpers.Capture("compose", "-f", data.Labels().Get("yamlPath"), "ps", "db")
103-
expect.DoesNotContain("wordpress")(wp, "", t)
104-
expect.Match(regexp.MustCompile("Up|running"))(db, "", t)
103+
expect.DoesNotContain("wordpress")(wp, t)
104+
expect.Match(regexp.MustCompile("Up|running"))(db, t)
105105
},
106106
}
107107
},
@@ -114,9 +114,9 @@ volumes:
114114
},
115115
Expected: func(data test.Data, helpers test.Helpers) *test.Expected {
116116
return &test.Expected{
117-
Output: func(stdout, info string, t *testing.T) {
117+
Output: func(stdout string, t *testing.T) {
118118
db := helpers.Capture("compose", "-f", data.Labels().Get("yamlPath"), "ps", "db")
119-
expect.DoesNotContain("db")(db, "", t)
119+
expect.DoesNotContain("db")(db, t)
120120
},
121121
}
122122
},

cmd/nerdctl/compose/compose_start_linux_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ services:
6161
return &test.Expected{
6262
ExitCode: 0,
6363
Errors: nil,
64-
Output: func(stdout, info string, t *testing.T) {
64+
Output: func(stdout string, t *testing.T) {
6565
svc0 := helpers.Capture("compose", "-f", data.Temp().Path("compose.yaml"), "ps", "svc0")
6666
svc1 := helpers.Capture("compose", "-f", data.Temp().Path("compose.yaml"), "ps", "svc1")
6767
comp := expect.Match(regexp.MustCompile("Up|running"))
68-
comp(svc0, "", t)
69-
comp(svc1, "", t)
68+
comp(svc0, t)
69+
comp(svc1, t)
7070
},
7171
}
7272
}

cmd/nerdctl/compose/compose_up_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ services:
9494
return &test.Expected{
9595
ExitCode: 0,
9696
Errors: nil,
97-
Output: func(stdout, info string, t *testing.T) {
97+
Output: func(stdout string, t *testing.T) {
9898
assert.Equal(t, data.Temp().Load("foo", "test"), "hi\n")
9999
},
100100
}

cmd/nerdctl/container/container_attach_linux_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func TestAttach(t *testing.T) {
6464
cmd.Run(&test.Expected{
6565
ExitCode: 0,
6666
Errors: []error{errors.New("read detach keys")},
67-
Output: func(stdout string, info string, t *testing.T) {
67+
Output: func(stdout string, t *testing.T) {
6868
assert.Assert(t, strings.Contains(helpers.Capture("inspect", "--format", "json", data.Identifier()), "\"Running\":true"))
6969
},
7070
})
@@ -93,7 +93,7 @@ func TestAttach(t *testing.T) {
9393
Errors: []error{errors.New("read detach keys")},
9494
Output: expect.All(
9595
expect.Contains("markmark"),
96-
func(stdout string, info string, t *testing.T) {
96+
func(stdout string, t *testing.T) {
9797
assert.Assert(t, strings.Contains(helpers.Capture("inspect", "--format", "json", data.Identifier()), "\"Running\":true"))
9898
},
9999
),
@@ -125,7 +125,7 @@ func TestAttachDetachKeys(t *testing.T) {
125125
cmd.Run(&test.Expected{
126126
ExitCode: 0,
127127
Errors: []error{errors.New("read detach keys")},
128-
Output: func(stdout string, info string, t *testing.T) {
128+
Output: func(stdout string, t *testing.T) {
129129
assert.Assert(t, strings.Contains(helpers.Capture("inspect", "--format", "json", data.Identifier()), "\"Running\":true"))
130130
},
131131
})
@@ -153,7 +153,7 @@ func TestAttachDetachKeys(t *testing.T) {
153153
Errors: []error{errors.New("read detach keys")},
154154
Output: expect.All(
155155
expect.Contains("markmark"),
156-
func(stdout string, info string, t *testing.T) {
156+
func(stdout string, t *testing.T) {
157157
assert.Assert(t, strings.Contains(helpers.Capture("inspect", "--format", "json", data.Identifier()), "\"Running\":true"))
158158
},
159159
),
@@ -182,8 +182,8 @@ func TestAttachForAutoRemovedContainer(t *testing.T) {
182182
cmd.Run(&test.Expected{
183183
ExitCode: 0,
184184
Errors: []error{errors.New("read detach keys")},
185-
Output: func(stdout string, info string, t *testing.T) {
186-
assert.Assert(t, strings.Contains(helpers.Capture("inspect", "--format", "json", data.Identifier()), "\"Running\":true"), info)
185+
Output: func(stdout string, t *testing.T) {
186+
assert.Assert(t, strings.Contains(helpers.Capture("inspect", "--format", "json", data.Identifier()), "\"Running\":true"))
187187
},
188188
})
189189
}
@@ -202,7 +202,7 @@ func TestAttachForAutoRemovedContainer(t *testing.T) {
202202
ExitCode: 42,
203203
Output: expect.All(
204204
expect.Contains("markmark"),
205-
func(stdout string, info string, t *testing.T) {
205+
func(stdout string, t *testing.T) {
206206
assert.Assert(t, !strings.Contains(helpers.Capture("ps", "-a"), data.Identifier()))
207207
},
208208
),
@@ -226,7 +226,7 @@ func TestAttachNoStdin(t *testing.T) {
226226
cmd.Feed(bytes.NewReader([]byte{16, 17})) // Ctrl-p, Ctrl-q to detach (https://en.wikipedia.org/wiki/C0_and_C1_control_codes)
227227
cmd.Run(&test.Expected{
228228
ExitCode: 0,
229-
Output: func(stdout string, info string, t *testing.T) {
229+
Output: func(stdout string, t *testing.T) {
230230
assert.Assert(t, strings.Contains(helpers.Capture("inspect", "--format", "{{.State.Running}}", data.Identifier()), "true"))
231231
},
232232
})
@@ -243,7 +243,7 @@ func TestAttachNoStdin(t *testing.T) {
243243
testCase.Expected = func(data test.Data, helpers test.Helpers) *test.Expected {
244244
return &test.Expected{
245245
ExitCode: 0, // Since it's a normal exit and not detach.
246-
Output: func(stdout string, info string, t *testing.T) {
246+
Output: func(stdout string, t *testing.T) {
247247
logs := helpers.Capture("logs", data.Identifier())
248248
assert.Assert(t, !strings.Contains(logs, "should-not-appear"))
249249
},

0 commit comments

Comments
 (0)