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

Commit

Permalink
Update e2e tests
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Christophe Sirot <[email protected]>
  • Loading branch information
Jean-Christophe Sirot committed Oct 31, 2019
1 parent 154c45c commit bce6701
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 7 additions & 1 deletion e2e/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,17 @@ func testRenderApp(appPath string, env ...string) func(*testing.T) {
dir := fs.NewDir(t, "")
defer dir.Remove()

// Build the App
cmd.Command = dockerCli.Command("app", "build", ".", "--folder", filepath.Join(appPath, "my.dockerapp"), "--tag", "a-simple-tag", "--no-resolve-image")
res := icmd.RunCmd(cmd).Assert(t, icmd.Success)
fmt.Println(res.Combined())

// Render the App
envParameters := map[string]string{}
data, err := ioutil.ReadFile(filepath.Join(appPath, "env.yml"))
assert.NilError(t, err)
assert.NilError(t, yaml.Unmarshal(data, &envParameters))
args := dockerCli.Command("app", "render", filepath.Join(appPath, "my.dockerapp"), "--parameters-file", filepath.Join(appPath, "parameters-0.yml"))
args := dockerCli.Command("app", "render", "a-simple-tag", "--parameters-file", filepath.Join(appPath, "parameters-0.yml"))
for k, v := range envParameters {
args = append(args, "--set", fmt.Sprintf("%s=%s", k, v))
}
Expand Down
5 changes: 4 additions & 1 deletion e2e/envfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ func TestRenderWithEnvFile(t *testing.T) {
defer cleanup()
appPath := filepath.Join("testdata", "envfile", "envfile.dockerapp")

cmd.Command = dockerCli.Command("app", "render", appPath)
cmd.Command = dockerCli.Command("app", "build", "-f", appPath, "--tag", "a-simple-tag", "--no-resolve-image", ".")
icmd.RunCmd(cmd).Assert(t, icmd.Success)

cmd.Command = dockerCli.Command("app", "render", "a-simple-tag")
icmd.RunCmd(cmd).Assert(t, icmd.Expected{Out: `version: "3.7"
services:
db:
Expand Down

0 comments on commit bce6701

Please sign in to comment.