Fix regression where failed tests would still leave passing builds.

This commit is contained in:
Will Rouesnel 2017-10-09 12:22:07 +11:00
parent 2d3aa082b1
commit 97708205f6
2 changed files with 3 additions and 3 deletions

View File

@ -46,7 +46,7 @@ run-tests: tools
mkdir -p $(COVERDIR)
rm -f $(COVERDIR)/*
for pkg in $(GO_PKGS) ; do \
go test -v -covermode count -coverprofile=$(COVERDIR)/$$(echo $$pkg | tr '/' '-').out $$pkg ; \
go test -v -covermode count -coverprofile=$(COVERDIR)/$$(echo $$pkg | tr '/' '-').out $$pkg || exit 1 ; \
done
test: run-tests
@ -65,7 +65,7 @@ docker-build:
-v $(shell pwd):/real_src \
-e SHELL_UID=$(shell id -u) -e SHELL_GID=$(shell id -g) \
-w /go/src/github.com/wrouesnel/postgres_exporter \
golang:1.8-wheezy \
golang:1.9-wheezy \
/bin/bash -c "make >&2 && chown $$SHELL_UID:$$SHELL_GID ./postgres_exporter"
docker build -t $(CONTAINER_NAME) .

View File

@ -10,6 +10,6 @@ shift
echo "mode: count" > $output_cov
test_cov=$(mktemp)
$test_binary -test.coverprofile=$test_cov $@
$test_binary -test.coverprofile=$test_cov $@ || exit 1
tail -n +2 $test_cov >> $output_cov
rm -f $test_cov