Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Commit

Permalink
Add e2e test for random name generation on run
Browse files Browse the repository at this point in the history
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
  • Loading branch information
rumpl committed Nov 13, 2019
1 parent 642f8bc commit 4541a81
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions e2e/run_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package e2e

import (
"path/filepath"
"testing"

"gotest.tools/icmd"
)

func TestRunTwice(t *testing.T) {
// Test that we are indeed generating random app names
// We had a problem where the second run would fail with an error
// "Installation "gallant_poitras" already exists, use 'docker app update' instead"
runWithDindSwarmAndRegistry(t, func(info dindSwarmAndRegistryInfo) {
cmd := info.configuredCmd
contextPath := filepath.Join("testdata", "simple")

cmd.Command = dockerCli.Command("app", "build", "--tag", "myapp1", contextPath)
icmd.RunCmd(cmd).Assert(t, icmd.Success)

cmd.Command = dockerCli.Command("app", "build", "--tag", "myapp2", contextPath)
icmd.RunCmd(cmd).Assert(t, icmd.Success)

cmd.Command = dockerCli.Command("app", "run", "myapp1", "--set", "web_port=8080")
icmd.RunCmd(cmd).Assert(t, icmd.Success)

cmd.Command = dockerCli.Command("app", "run", "myapp2", "--set", "web_port=8081")
icmd.RunCmd(cmd).Assert(t, icmd.Success)
})
}

0 comments on commit 4541a81

Please sign in to comment.