Skip to content

Commit 38f8a47

Browse files
committed
test(integration): add an app deploy test for deis pull
1 parent 01dc78a commit 38f8a47

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

tests/builds_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ package tests
44

55
import (
66
"bytes"
7+
"os"
78
"os/exec"
89
"strings"
910
"testing"
1011
"text/template"
12+
"time"
1113

1214
"github.com/deis/deis/tests/utils"
1315
)
@@ -20,7 +22,11 @@ var (
2022
func TestBuilds(t *testing.T) {
2123
params := buildSetup(t)
2224
buildsListTest(t, params)
25+
appsOpenTest(t, params)
26+
utils.AppsDestroyTest(t, params)
2327
buildsCreateTest(t, params)
28+
// TODO: router needs a few seconds to wake up here--fixme!
29+
time.Sleep(5000 * time.Millisecond)
2430
appsOpenTest(t, params)
2531
utils.AppsDestroyTest(t, params)
2632
}
@@ -64,6 +70,21 @@ func buildsListTest(t *testing.T, params *utils.DeisTestConfig) {
6470
params.ImageID = strings.Fields(ImageID)[0]
6571
}
6672

73+
// buildsCreateTest uses the `deis builds:create` (or `deis pull`) command
74+
// to promote a build from an existing docker image.
6775
func buildsCreateTest(t *testing.T, params *utils.DeisTestConfig) {
76+
params.AppName = "deispullsample"
77+
params.ImageID = "deis/example-dockerfile-python:latest"
78+
params.ExampleApp = "example-deis-pull"
79+
if err := os.Mkdir(params.ExampleApp, 0755); err != nil {
80+
t.Fatal(err)
81+
}
82+
if err := utils.Chdir(params.ExampleApp); err != nil {
83+
t.Fatal(err)
84+
}
85+
utils.Execute(t, appsCreateCmd, params, false, "")
6886
utils.Execute(t, buildsCreateCmd, params, false, "")
87+
if err := utils.Chdir(".."); err != nil {
88+
t.Fatal(err)
89+
}
6990
}

0 commit comments

Comments
 (0)