-suffle=on and -count=2 option is added to TESTFLAGS

Signed-off-by: Alfonso Uceda <uceda73@gmail.com>
pull/31013/head
Alfonso Uceda 3 months ago
parent 17b3b5b19f
commit f243617229

@ -21,7 +21,7 @@ ACCEPTANCE_RUN_TESTS=.
PKG := ./... PKG := ./...
TAGS := TAGS :=
TESTS := . TESTS := .
TESTFLAGS := TESTFLAGS := -shuffle=on -count=2
LDFLAGS := -w -s LDFLAGS := -w -s
GOFLAGS := GOFLAGS :=
CGO_ENABLED ?= 0 CGO_ENABLED ?= 0
@ -119,7 +119,7 @@ test-unit:
test-coverage: test-coverage:
@echo @echo
@echo "==> Running unit tests with coverage <==" @echo "==> Running unit tests with coverage <=="
@ ./scripts/coverage.sh @ TESTFLAGS="${TESTFLAGS}" ./scripts/coverage.sh
.PHONY: test-style .PHONY: test-style
test-style: test-style:

@ -16,6 +16,8 @@
set -euo pipefail set -euo pipefail
TESTFLAGS=${TESTFLAGS:-}
covermode=${COVERMODE:-atomic} covermode=${COVERMODE:-atomic}
coverdir=$(mktemp -d /tmp/coverage.XXXXXXXXXX) coverdir=$(mktemp -d /tmp/coverage.XXXXXXXXXX)
profile="${coverdir}/cover.out" profile="${coverdir}/cover.out"
@ -24,7 +26,7 @@ generate_cover_data() {
for d in $(go list ./...) ; do for d in $(go list ./...) ; do
( (
local output="${coverdir}/${d//\//-}.cover" local output="${coverdir}/${d//\//-}.cover"
go test -coverprofile="${output}" -covermode="$covermode" "$d" go test ${TESTFLAGS} -coverprofile="${output}" -covermode="$covermode" "$d"
) )
done done
@ -40,4 +42,3 @@ case "${1-}" in
go tool cover -html "${profile}" go tool cover -html "${profile}"
;; ;;
esac esac

Loading…
Cancel
Save