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

Commit

Permalink
use 'build' in e2e test to replace 'bundle'
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
  • Loading branch information
ndeloof committed Oct 7, 2019
1 parent 2766cd7 commit 29be196
Showing 1 changed file with 20 additions and 22 deletions.
42 changes: 20 additions & 22 deletions e2e/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,32 +149,30 @@ maintainers:
}

func TestInspectApp(t *testing.T) {
cmd, cleanup := dockerCli.createTestCmd()
defer cleanup()

// cwd = e2e
dir := fs.NewDir(t, "detect-app-binary",
fs.WithDir("attachments.dockerapp", fs.FromDir("testdata/attachments.dockerapp")))
defer dir.Remove()
runWithDindSwarmAndRegistry(t, func(info dindSwarmAndRegistryInfo) {
cmd := info.configuredCmd

tmpDir := fs.NewDir(t, t.Name())
defer tmpDir.Remove()
// cwd = e2e
dir := fs.NewDir(t, "detect-app-binary",
fs.WithDir("attachments.dockerapp", fs.FromDir("testdata/attachments.dockerapp")))
defer dir.Remove()

cmd.Command = dockerCli.Command("app", "inspect")
cmd.Dir = dir.Path()
icmd.RunCmd(cmd).Assert(t, icmd.Expected{
ExitCode: 1,
Err: "invalid reference format",
})
cmd.Command = dockerCli.Command("app", "inspect")
cmd.Dir = dir.Path()
icmd.RunCmd(cmd).Assert(t, icmd.Expected{
ExitCode: 1,
Err: "invalid reference format",
})

cmd.Command = dockerCli.Command("app", "bundle", filepath.Join("testdata", "simple", "simple.dockerapp"), "--output", tmpDir.Join("simple-bundle.json"), "--tag", "simple-app:1.0.0")
cmd.Dir = ""
icmd.RunCmd(cmd).Assert(t, icmd.Success)
cmd.Command = dockerCli.Command("app", "build", filepath.Join("testdata", "simple", "simple.dockerapp"), "simple-app:1.0.0")
cmd.Dir = ""
icmd.RunCmd(cmd).Assert(t, icmd.Success)

cmd.Command = dockerCli.Command("app", "inspect", "simple-app:1.0.0")
cmd.Dir = dir.Path()
output := icmd.RunCmd(cmd).Assert(t, icmd.Success).Combined()
golden.Assert(t, output, "app-inspect.golden")
cmd.Command = dockerCli.Command("app", "inspect", "simple-app:1.0.0")
cmd.Dir = dir.Path()
output := icmd.RunCmd(cmd).Assert(t, icmd.Success).Combined()
golden.Assert(t, output, "app-inspect.golden")
}
}

func TestDockerAppLifecycle(t *testing.T) {
Expand Down

0 comments on commit 29be196

Please sign in to comment.