diff --git a/Makefile b/Makefile index 0785fdb2e..df8e65ae4 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ ACCEPTANCE_RUN_TESTS=. PKG := ./... TAGS := TESTS := . -TESTFLAGS := +TESTFLAGS := -shuffle=on -count=2 LDFLAGS := -w -s GOFLAGS := CGO_ENABLED ?= 0 @@ -119,7 +119,7 @@ test-unit: test-coverage: @echo @echo "==> Running unit tests with coverage <==" - @ ./scripts/coverage.sh + @ TESTFLAGS="${TESTFLAGS}" ./scripts/coverage.sh .PHONY: test-style test-style: diff --git a/scripts/coverage.sh b/scripts/coverage.sh index 2164d94da..371de6795 100755 --- a/scripts/coverage.sh +++ b/scripts/coverage.sh @@ -16,6 +16,8 @@ set -euo pipefail +TESTFLAGS=${TESTFLAGS:-} + covermode=${COVERMODE:-atomic} coverdir=$(mktemp -d /tmp/coverage.XXXXXXXXXX) profile="${coverdir}/cover.out" @@ -24,7 +26,7 @@ generate_cover_data() { for d in $(go list ./...) ; do ( local output="${coverdir}/${d//\//-}.cover" - go test -coverprofile="${output}" -covermode="$covermode" "$d" + go test ${TESTFLAGS} -coverprofile="${output}" -covermode="$covermode" "$d" ) done @@ -40,4 +42,3 @@ case "${1-}" in go tool cover -html "${profile}" ;; esac -