Skip to content

Commit 4adcc65

Browse files
committed
test(component): add make test to deis/registry and unit tests for controller
1 parent 5b2b6c0 commit 4adcc65

9 files changed

Lines changed: 78 additions & 3 deletions

File tree

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,17 @@ status: check-fleet
118118
stop: check-fleet
119119
$(FLEETCTL) stop -block-attempts=600 $(strip $(call deis_units,launched,active))
120120

121+
test: .PHONY
122+
@$(foreach C,$(ALL_COMPONENTS), \
123+
echo \\nTesting deis/$(C) ; \
124+
$(MAKE) -C $(C) test ; \
125+
)
126+
121127
tests:
122128
cd test && bundle install && bundle exec rake
123129

124130
uninstall: check-fleet stop
125131
$(FLEETCTL) unload $(call deis_units,launched,.)
126132
$(FLEETCTL) destroy $(strip $(call deis_units,.,.))
133+
134+
.PHONY:

builder/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,11 @@ clean: uninstall
2626

2727
full-clean: clean
2828
$(call ssh_all,'sudo docker rmi deis/builder')
29+
30+
test: test-unit test-functional
31+
32+
test-unit:
33+
@echo no unit tests
34+
35+
test-functional:
36+
@echo no functional tests

cache/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,11 @@ clean: uninstall
2626

2727
full-clean: clean
2828
$(call ssh_all,'sudo docker rmi deis/cache')
29+
30+
test: test-unit test-functional
31+
32+
test-unit:
33+
@echo no unit tests
34+
35+
test-functional:
36+
@echo no functional tests

controller/Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ clean: uninstall
3131
full-clean: clean
3232
$(call ssh_all,'sudo docker rmi deis/controller')
3333

34-
test:
35-
python manage.py test --noinput api
36-
3734
runserver:
3835
python manage.py runserver
3936

@@ -46,3 +43,13 @@ coverage:
4643

4744
flake8:
4845
flake8
46+
47+
test: test-unit test-functional
48+
49+
test-unit:
50+
@if [ ! -d venv ]; then virtualenv venv; fi
51+
venv/bin/pip install -q -r requirements.txt
52+
venv/bin/python manage.py test --noinput api
53+
54+
test-functional:
55+
@echo no functional tests

database/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,11 @@ clean: uninstall
2626

2727
full-clean: clean
2828
$(call ssh_all,'sudo docker rmi deis/database')
29+
30+
test: test-unit test-functional
31+
32+
test-unit:
33+
@echo no unit tests
34+
35+
test-functional:
36+
@echo no functional tests

logger/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,11 @@ clean: uninstall
2626

2727
full-clean: clean
2828
$(call ssh_all,'sudo docker rmi deis/logger')
29+
30+
test: test-unit test-functional
31+
32+
test-unit:
33+
@echo no unit tests
34+
35+
test-functional:
36+
go test -v ./...

registry/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# test-unit temporary files
2+
test-unit/

registry/Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,21 @@ clean: uninstall
2626

2727
full-clean: clean
2828
$(call ssh_all,'sudo docker rmi deis/registry')
29+
30+
test: test-unit test-functional
31+
32+
test-unit: .PHONY
33+
@if [ ! -d test-unit ]; then \
34+
git clone -b 0.6.8 https://github.com/dotcloud/docker-registry test-unit; \
35+
fi
36+
@if [ ! -d venv ]; then virtualenv venv; fi
37+
venv/bin/pip install -q -r test-unit/requirements.txt
38+
venv/bin/pip install -q -r test-unit/test-requirements.txt
39+
cd test-unit && \
40+
DOCKER_REGISTRY_CONFIG=config_test.yml SETTINGS_FLAVOR=test PYTHONPATH=test \
41+
../venv/bin/python -m unittest discover -s test
42+
43+
test-functional:
44+
@echo no functional tests
45+
46+
.PHONY:

router/Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,11 @@ clean: uninstall
4242

4343
full-clean: clean
4444
$(call ssh_all,'sudo docker rmi deis/router')
45+
46+
test: test-unit test-functional
47+
48+
test-unit:
49+
@echo no unit tests
50+
51+
test-functional:
52+
@echo no functional tests

0 commit comments

Comments
 (0)