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 service container labels on run
Browse files Browse the repository at this point in the history
  • Loading branch information
rumpl committed Oct 25, 2019
1 parent b1d4b76 commit 62abf81
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions e2e/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,31 @@ func TestRunOnlyOne(t *testing.T) {
})
}

func TestRunWithLabels(t *testing.T) {
runWithDindSwarmAndRegistry(t, func(info dindSwarmAndRegistryInfo) {
cmd := info.configuredCmd

contextPath := filepath.Join("testdata", "simple")
cmd.Command = dockerCli.Command("app", "build", "--tag", "myapp", contextPath)
icmd.RunCmd(cmd).Assert(t, icmd.Success)

cmd.Command = dockerCli.Command("app", "run", "myapp", "--name", "myapp", "--label", "label.key=labelValue")
icmd.RunCmd(cmd).Assert(t, icmd.Success)

services := []string{
"myapp_db", "myapp_web", "myapp_api",
}
for _, service := range services {
fmt.Printf("%q", service)
cmd.Command = dockerCli.Command("inspect", service)
icmd.RunCmd(cmd).Assert(t, icmd.Expected{
ExitCode: 0,
Out: `"label.key": "labelValue"`,
})
}
})
}

func TestDockerAppLifecycle(t *testing.T) {
t.Run("withBindMounts", func(t *testing.T) {
testDockerAppLifecycle(t, true)
Expand Down

0 comments on commit 62abf81

Please sign in to comment.