Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 2fe538c

Browse files
committed
fix: test docker image tag
Improve tests by checking the error message. Signed-off-by: Yves Brissaud <[email protected]>
1 parent 0665684 commit 2fe538c

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

e2e/images_test.go

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,19 +110,31 @@ a-simple-app:latest simple
110110

111111
// with no argument
112112
cmd.Command = dockerCli.Command("app", "bundle", "tag")
113-
icmd.RunCmd(cmd).Assert(t, icmd.Expected{ExitCode: 1})
113+
icmd.RunCmd(cmd).Assert(t, icmd.Expected{
114+
ExitCode: 1,
115+
Err: `"docker app image tag" requires exactly 2 arguments.`,
116+
})
114117

115118
// with one argument
116-
cmd.Command = dockerCli.Command("app", "bundle", "tag", "a-simple-app")
117-
icmd.RunCmd(cmd).Assert(t, icmd.Expected{ExitCode: 1})
119+
cmd.Command = dockerCli.Command("app", "image", "tag", "a-simple-app")
120+
icmd.RunCmd(cmd).Assert(t, icmd.Expected{
121+
ExitCode: 1,
122+
Err: `"docker app image tag" requires exactly 2 arguments.`,
123+
})
118124

119125
// with invalid src reference
120-
cmd.Command = dockerCli.Command("app", "bundle", "tag", "a-simple-app$2", "b-simple-app")
121-
icmd.RunCmd(cmd).Assert(t, icmd.Expected{ExitCode: 1})
126+
cmd.Command = dockerCli.Command("app", "image", "tag", "a-simple-app$2", "b-simple-app")
127+
icmd.RunCmd(cmd).Assert(t, icmd.Expected{
128+
ExitCode: 1,
129+
Err: `could not parse 'a-simple-app$2' as a valid reference: invalid reference format`,
130+
})
122131

123132
// with invalid target reference
124-
cmd.Command = dockerCli.Command("app", "bundle", "tag", "a-simple-app", "b@simple-app")
125-
icmd.RunCmd(cmd).Assert(t, icmd.Expected{ExitCode: 1})
133+
cmd.Command = dockerCli.Command("app", "image", "tag", "a-simple-app", "b@simple-app")
134+
icmd.RunCmd(cmd).Assert(t, icmd.Expected{
135+
ExitCode: 1,
136+
Err: `could not parse 'b@simple-app' as a valid reference: invalid reference format`,
137+
})
126138

127139
// tag image with only names
128140
cmd.Command = dockerCli.Command("app", "image", "tag", "a-simple-app", "b-simple-app")

0 commit comments

Comments
 (0)