Skip to content

Commit dfbae84

Browse files
committed
fix(tests): build docker image as first test step
This keeps us from starting etcd and other test support services minutes before they are needed, and makes the component tests fail faster when there are build errors, which is not uncommon.
1 parent b88cff2 commit dfbae84

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

tests/controller_test.go

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,9 @@ import (
1212
)
1313

1414
func runDeisControllerTest(t *testing.T, testSessionUID string, etcdPort string, servicePort string) {
15+
var err error
1516
cli, stdout, stdoutPipe := dockercliutils.GetNewClient()
1617
done := make(chan bool, 1)
17-
err := dockercliutils.BuildImage(t, "../", "deis/controller:"+testSessionUID)
18-
if err != nil {
19-
t.Fatal(err)
20-
}
2118
ipaddr := utils.GetHostIPAddress()
2219
done <- true
2320
go func() {
@@ -39,18 +36,25 @@ func runDeisControllerTest(t *testing.T, testSessionUID string, etcdPort string,
3936
}
4037

4138
func TestController(t *testing.T) {
42-
setkeys := []string{"/deis/registry/protocol",
39+
setkeys := []string{
40+
"/deis/registry/protocol",
4341
"deis/registry/host",
4442
"/deis/registry/port",
4543
"/deis/cache/host",
46-
"/deis/cache/port"}
47-
setdir := []string{"/deis/controller",
44+
"/deis/cache/port",
45+
}
46+
setdir := []string{
47+
"/deis/controller",
4848
"/deis/cache",
4949
"/deis/database",
5050
"/deis/registry",
51-
"/deis/domains"}
52-
var testSessionUID = utils.NewUuid()
53-
fmt.Println("UUID for the session Controller Test :" + testSessionUID)
51+
"/deis/domains",
52+
}
53+
testSessionUID := utils.NewUuid()
54+
err := dockercliutils.BuildImage(t, "../", "deis/controller:"+testSessionUID)
55+
if err != nil {
56+
t.Fatal(err)
57+
}
5458
etcdPort := utils.GetRandomPort()
5559
servicePort := utils.GetRandomPort()
5660
dbPort := utils.GetRandomPort()

0 commit comments

Comments
 (0)