Skip to content

Commit 697c5ec

Browse files
author
Matthew Fisher
committed
ref(tests): separate unit tests from functional tests
That way we can fail faster if the unit tests fail.
1 parent a997083 commit 697c5ec

6 files changed

Lines changed: 31 additions & 9 deletions

File tree

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,14 @@ release: check-registry
6767

6868
deploy: build dev-release restart
6969

70-
test: test-components push test-integration
70+
test: test-unit test-functional push test-integration
7171

72-
test-components:
73-
@$(foreach C, $(COMPONENTS), $(MAKE) -C $(C) test &&) echo done
72+
test-functional:
73+
@$(foreach C, $(COMPONENTS), $(MAKE) -C $(C) test-functional &&) echo done
74+
75+
test-unit:
76+
@$(foreach C, $(COMPONENTS), $(MAKE) -C $(C) test-unit &&) echo done
77+
@$(foreach C, $(CLIENTS), $(MAKE) -C $(C) test-unit &&) echo done
7478

7579
test-integration:
7680
$(MAKE) -C tests/ test-full

client/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ setup-venv:
3636

3737
test-style: setup-venv
3838
venv/bin/flake8
39+
40+
test-unit:
41+
@echo no unit tests

publisher/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ stop: check-deisctl
4949

5050
test: test-unit
5151

52+
test-functional:
53+
@echo no functional tests
54+
5255
test-unit:
5356
godep go test -v ./...
5457

tests/bin/test-acceptance.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ log_phase "Running documentation tests"
2222
# test building documentation
2323
make -C docs/ test
2424

25+
log_phase "Running unit tests"
26+
27+
make test-unit
28+
2529
log_phase "Building from current source tree"
2630

2731
# build all docker images and client binaries
@@ -30,9 +34,9 @@ make build
3034
# use the built client binaries
3135
export PATH=$DEIS_ROOT/deisctl:$DEIS_ROOT/client/dist:$PATH
3236

33-
log_phase "Running unit and functional tests"
37+
log_phase "Running functional tests"
3438

35-
make test-components
39+
make test-functional
3640

3741
log_phase "Provisioning 3-node CoreOS"
3842

tests/bin/test-integration.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ log_phase "Running documentation tests"
2222
# test building documentation
2323
make -C docs/ test
2424

25+
log_phase "Running unit tests"
26+
27+
make test-unit
28+
2529
log_phase "Building from current source tree"
2630

2731
# build all docker images and client binaries
@@ -30,9 +34,9 @@ make build
3034
# use the built client binaries
3135
export PATH=$DEIS_ROOT/deisctl:$DEIS_ROOT/client/dist:$PATH
3236

33-
log_phase "Running unit and functional tests"
37+
log_phase "Running functional tests"
3438

35-
make test-components
39+
make test-functional
3640

3741
log_phase "Provisioning 3-node CoreOS"
3842

tests/bin/test-smoke.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ log_phase "Running documentation tests"
2222
# test building documentation
2323
make -C docs/ test
2424

25+
log_phase "Running unit tests"
26+
27+
make test-unit
28+
2529
log_phase "Building from current source tree"
2630

2731
# build all docker images and client binaries
@@ -30,9 +34,9 @@ make build
3034
# use the built client binaries
3135
export PATH=$DEIS_ROOT/deisctl:$DEIS_ROOT/client/dist:$PATH
3236

33-
log_phase "Running unit and functional tests"
37+
log_phase "Running functional tests"
3438

35-
make test-components
39+
make test-functional
3640

3741
log_phase "Provisioning 3-node CoreOS"
3842

0 commit comments

Comments
 (0)