Skip to content

Commit 14e00ef

Browse files
committed
feat(*): build test-etcd, test-postgresql, and mock-store locally
Previously we were relying on someone manually building and pushing these to Docker Hub. We should build these with our BUILD_TAG like we do all components, so that Jenkins can pick up local changes in a branch.
1 parent 1ee59b8 commit 14e00ef

13 files changed

Lines changed: 19 additions & 24 deletions

File tree

builder/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ test-unit:
6767
$(GOTEST) .
6868

6969
test-functional:
70-
@docker history deis/test-etcd >/dev/null 2>&1 || docker pull deis/test-etcd:latest
70+
@$(MAKE) -C ../tests/ test-etcd
7171
godep go test -v ./tests/...
7272

7373
test-style:

cache/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,5 @@ test-style:
6767
$(GOLINT) ./...
6868

6969
test-functional:
70-
@docker history deis/test-etcd >/dev/null 2>&1 || docker pull deis/test-etcd:latest
70+
@$(MAKE) -C ../tests/ test-etcd
7171
GOPATH=`cd ../tests/ && godep path`:$(GOPATH) go test -v ./tests/...

controller/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,6 @@ test-unit: setup-venv test-style
7979
venv/bin/coverage report -m
8080

8181
test-functional:
82-
@docker history deis/test-etcd >/dev/null 2>&1 || docker pull deis/test-etcd:latest
83-
@docker history deis/test-postgresql >/dev/null 2>&1 || docker pull deis/test-postgresql:latest
82+
@$(MAKE) -C ../tests/ test-etcd
83+
@$(MAKE) -C ../tests/ test-postgresql
8484
GOPATH=`cd ../tests/ && godep path`:$(GOPATH) go test -v ./tests/...

database/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,6 @@ test-style:
5454
shellcheck $(SHELL_SCRIPTS)
5555

5656
test-functional:
57-
@docker history deis/mock-store >/dev/null 2>&1 || $(MAKE) -C ../tests/ mock-store
58-
@docker history deis/test-etcd >/dev/null 2>&1 || docker pull deis/test-etcd:latest
57+
@$(MAKE) -C ../tests/ mock-store
58+
@$(MAKE) -C ../tests/ test-etcd
5959
GOPATH=`cd ../tests/ && godep path`:$(GOPATH) go test -v ./tests/...

docs/contributing/testing.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,7 @@ continuous deployment, start one locally:
6060

6161
The functional tests also use several mock or example containers:
6262
**deis/test-etcd**, **deis/test-postgresql**, and **deis/mock-store**.
63-
These are referenced by the ``:latest`` tag, so in the rare case that one
64-
of these test containers needs to change, ``docker rmi`` its image and
65-
the tests will pull it from Docker Hub or rebuild it.
66-
63+
These are built locally during a test run.
6764

6865
Run the Tests
6966
-------------

logger/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ deploy: build dev-release restart
5858
test: test-style test-unit test-functional
5959

6060
test-functional:
61-
@docker history deis/test-etcd >/dev/null 2>&1 || docker pull deis/test-etcd:latest
61+
@$(MAKE) -C ../tests/ test-etcd
6262
GOPATH=`cd ../tests/ && godep path`:$(GOPATH) go test -v ./tests/...
6363

6464
test-style:

registry/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ deploy: build dev-release restart
4646
test: test-style test-unit test-functional
4747

4848
test-functional:
49-
@docker history deis/mock-store >/dev/null 2>&1 || $(MAKE) -C ../tests/ mock-store
50-
@docker history deis/test-etcd >/dev/null 2>&1 || docker pull deis/test-etcd:latest
49+
@$(MAKE) -C ../tests/ mock-store
50+
@$(MAKE) -C ../tests/ test-etcd
5151
GOPATH=`cd ../tests/ && godep path`:$(GOPATH) go test -v ./tests/...
5252

5353
test-style:

router/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ deploy: build dev-release restart
6363
test: test-style test-unit test-functional
6464

6565
test-functional:
66-
@docker history deis/test-etcd >/dev/null 2>&1 || docker pull deis/test-etcd:latest
66+
@$(MAKE) -C ../tests/ test-etcd
6767
GOPATH=`cd ../tests/ && godep path`:$(GOPATH) go test -v ./tests/...
6868

6969
test-style:

store/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ deploy: build dev-release restart
100100
test: test-style test-unit test-functional
101101

102102
test-functional:
103-
@docker history deis/test-etcd >/dev/null 2>&1 || docker pull deis/test-etcd:latest
103+
@$(MAKE) -C ../tests/ test-etcd
104104
GOPATH=`cd ../tests/ && godep path`:$(GOPATH) go test -v ./tests/...
105105

106106
test-style:

tests/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ GO_FILES = $(wildcard *.go)
77
GO_PACKAGES = dockercli etcdutils mock utils
88
GO_PACKAGES_REPO_PATH = $(addprefix $(repo_path)/,$(GO_PACKAGES))
99

10-
MOCK_STORE_IMAGE = $(IMAGE_PREFIX)mock-store:latest
11-
TEST_ETCD_IMAGE = $(IMAGE_PREFIX)test-etcd:latest
12-
TEST_POSTGRESQL_IMAGE = $(IMAGE_PREFIX)test-postgresql:latest
10+
MOCK_STORE_IMAGE = $(IMAGE_PREFIX)mock-store:$(BUILD_TAG)
11+
TEST_ETCD_IMAGE = $(IMAGE_PREFIX)test-etcd:$(BUILD_TAG)
12+
TEST_POSTGRESQL_IMAGE = $(IMAGE_PREFIX)test-postgresql:$(BUILD_TAG)
1313

1414
test: test-smoke
1515

0 commit comments

Comments
 (0)