github.com/docker/app@v0.9.1-beta3.0.20210611140623-a48f773ab002/e2e/run_test.go (about)

     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  }