Skip to content

Commit 06d96d6

Browse files
authored
Merge pull request #2584 from tonistiigi/bake-test-fix
bake: fix testing json formatted output
2 parents dc83501 + 0f74f9a commit 06d96d6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/bake.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -1074,15 +1074,16 @@ target "another" {
10741074
require.Contains(t, out, "another")
10751075
require.Contains(t, out, "UndefinedVar")
10761076

1077-
out, err = bakeCmd(
1077+
cmd := buildxCmd(
10781078
sb,
10791079
withDir(dir),
1080-
withArgs("build", "another", "--call", "check,format=json"),
1080+
withArgs("bake", "--progress=quiet", "build", "another", "--call", "check,format=json"),
10811081
)
1082-
require.Error(t, err, out)
1082+
outB, err := cmd.Output()
1083+
require.Error(t, err, string(outB))
10831084

10841085
var res map[string]any
1085-
err = json.Unmarshal([]byte(out), &res)
1086+
err = json.Unmarshal(outB, &res)
10861087
require.NoError(t, err, out)
10871088

10881089
targets, ok := res["target"].(map[string]any)

0 commit comments

Comments
 (0)