Skip to content

Commit 9132a01

Browse files
committed
test: split up into individual targets, run all
"make test" used to abort after the first test failure. That was partly intentional: if the simple tests already fail (for example, because of a syntax error), then there is no point in continuing to test. However, it also makes it harder to find all errors in a CI system when the errors are unrelated (first error shows up, gets fixed, next error shows up, etc.). Now "make test" still aborts early, but "make -k test" is used in the CI and will run all individual tests because they are split up into different targets.
1 parent 73db459 commit 9132a01

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

build.make

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,23 @@ clean:
8989
-rm -rf bin
9090

9191
test:
92+
93+
.PHONY: test-go
94+
test: test-go
95+
test-go:
96+
@ echo; echo $@
9297
go test `go list ./... | grep -v 'vendor'` $(TESTARGS)
98+
99+
.PHONY: test-vet
100+
test: test-vet
101+
test-vet:
102+
@ echo; echo $@
93103
go vet `go list ./... | grep -v vendor`
104+
105+
.PHONY: test-fmt
106+
test: test-fmt
107+
test-fmt:
108+
@ echo; echo $@
94109
files=$$(find . -name '*.go' | grep -v './vendor'); \
95110
if [ $$(gofmt -d $$files | wc -l) -ne 0 ]; then \
96111
echo "formatting errors:"; \

travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ matrix:
66
include:
77
- go: 1.11.1
88
script:
9-
- make all test
9+
- make -k all test
1010
after_success:
1111
- if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
1212
docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}" quay.io;

0 commit comments

Comments
 (0)