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.
This commit is contained in:
15
build.make
15
build.make
@@ -89,8 +89,23 @@ clean:
|
|||||||
-rm -rf bin
|
-rm -rf bin
|
||||||
|
|
||||||
test:
|
test:
|
||||||
|
|
||||||
|
.PHONY: test-go
|
||||||
|
test: test-go
|
||||||
|
test-go:
|
||||||
|
@ echo; echo $@
|
||||||
go test `go list ./... | grep -v 'vendor'` $(TESTARGS)
|
go test `go list ./... | grep -v 'vendor'` $(TESTARGS)
|
||||||
|
|
||||||
|
.PHONY: test-vet
|
||||||
|
test: test-vet
|
||||||
|
test-vet:
|
||||||
|
@ echo; echo $@
|
||||||
go vet `go list ./... | grep -v vendor`
|
go vet `go list ./... | grep -v vendor`
|
||||||
|
|
||||||
|
.PHONY: test-fmt
|
||||||
|
test: test-fmt
|
||||||
|
test-fmt:
|
||||||
|
@ echo; echo $@
|
||||||
files=$$(find . -name '*.go' | grep -v './vendor'); \
|
files=$$(find . -name '*.go' | grep -v './vendor'); \
|
||||||
if [ $$(gofmt -d $$files | wc -l) -ne 0 ]; then \
|
if [ $$(gofmt -d $$files | wc -l) -ne 0 ]; then \
|
||||||
echo "formatting errors:"; \
|
echo "formatting errors:"; \
|
||||||
|
@@ -6,7 +6,7 @@ matrix:
|
|||||||
include:
|
include:
|
||||||
- go: 1.11.1
|
- go: 1.11.1
|
||||||
script:
|
script:
|
||||||
- make all test
|
- make -k all test
|
||||||
after_success:
|
after_success:
|
||||||
- if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
|
- if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
|
||||||
docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}" quay.io;
|
docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}" quay.io;
|
||||||
|
Reference in New Issue
Block a user