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

Commit 1fd4785

Browse files
committed
Add e2e tests for push
Making sure that the errors are well defined. Signed-off-by: Djordje Lukic <[email protected]>
1 parent 68accf3 commit 1fd4785

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

e2e/pushpull_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,27 @@ import (
1111
"gotest.tools/icmd"
1212
)
1313

14+
func TestPushUnknown(t *testing.T) {
15+
cmd, cleanup := dockerCli.createTestCmd()
16+
defer cleanup()
17+
18+
t.Run("push unknown reference", func(t *testing.T) {
19+
cmd.Command = dockerCli.Command("app", "push", "unknown")
20+
icmd.RunCmd(cmd).Assert(t, icmd.Expected{
21+
ExitCode: 1,
22+
Err: `could not push "unknown:latest": no such App image: failed to read bundle "docker.io/library/unknown:latest": unknown:latest: reference not found`,
23+
})
24+
})
25+
26+
t.Run("push invalid reference", func(t *testing.T) {
27+
cmd.Command = dockerCli.Command("app", "push", "@")
28+
icmd.RunCmd(cmd).Assert(t, icmd.Expected{
29+
ExitCode: 1,
30+
Err: `could not push "@": invalid reference format`,
31+
})
32+
})
33+
}
34+
1435
func TestPushInsecureRegistry(t *testing.T) {
1536
runWithDindSwarmAndRegistry(t, func(info dindSwarmAndRegistryInfo) {
1637
path := filepath.Join("testdata", "local")

0 commit comments

Comments
 (0)