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

Commit 2aacb5d

Browse files
committed
Add e2e test for random name generation on run
Signed-off-by: Djordje Lukic <[email protected]>
1 parent 642f8bc commit 2aacb5d

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

e2e/run_test.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package e2e
2+
3+
import (
4+
"path/filepath"
5+
"testing"
6+
7+
"gotest.tools/icmd"
8+
)
9+
10+
func TestRunTwice(t *testing.T) {
11+
// Test that we are indeed generating random app names
12+
// We had a problem where the second run would fail with an error
13+
// "Installation "gallant_poitras" already exists, use 'docker app update' instead"
14+
runWithDindSwarmAndRegistry(t, func(info dindSwarmAndRegistryInfo) {
15+
cmd := info.configuredCmd
16+
contextPath := filepath.Join("testdata", "simple")
17+
18+
cmd.Command = dockerCli.Command("app", "build", "--tag", "myapp", contextPath)
19+
icmd.RunCmd(cmd).Assert(t, icmd.Success)
20+
21+
cmd.Command = dockerCli.Command("app", "run", "myapp", "--set", "web_port=8080")
22+
icmd.RunCmd(cmd).Assert(t, icmd.Success)
23+
24+
cmd.Command = dockerCli.Command("app", "run", "myapp", "--set", "web_port=8081")
25+
icmd.RunCmd(cmd).Assert(t, icmd.Success)
26+
})
27+
}

0 commit comments

Comments
 (0)