diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index d998224a41..b7b27b8013 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -71,8 +71,8 @@ jobs: make vendor pip3 install wheel - - name: Run tests - run: make test + - name: Run tests with coverage + run: make cover golangci: needs: cleanups diff --git a/Makefile b/Makefile index 37cf5567c6..4f6776d920 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ default: vendor fmt lint PACKAGES=./acceptance/... ./libs/... ./internal/... ./cmd/... ./bundle/... . GOTESTSUM_FORMAT ?= pkgname-and-test-fails +GOTESTSUM_CMD ?= gotestsum --format ${GOTESTSUM_FORMAT} --no-summary=skipped + lint: golangci-lint run --fix @@ -17,22 +19,19 @@ fmt: golangci-lint run --enable-only="gofmt,gofumpt,goimports" --fix ./... test: - gotestsum --format ${GOTESTSUM_FORMAT} --no-summary=skipped -- ${PACKAGES} + ${GOTESTSUM_CMD} -- ${PACKAGES} cover: - gotestsum --format ${GOTESTSUM_FORMAT} --no-summary=skipped -- -coverprofile=coverage.txt ${PACKAGES} - -showcover: - go tool cover -html=coverage.txt - -acc-cover: rm -fr ./acceptance/build/cover/ - CLI_GOCOVERDIR=build/cover go test ./acceptance + CLI_GOCOVERDIR=build/cover ${GOTESTSUM_CMD} -- -coverprofile=coverage.txt ${PACKAGES} rm -fr ./acceptance/build/cover-merged/ mkdir -p acceptance/build/cover-merged/ go tool covdata merge -i $$(printf '%s,' acceptance/build/cover/* | sed 's/,$$//') -o acceptance/build/cover-merged/ go tool covdata textfmt -i acceptance/build/cover-merged -o coverage-acceptance.txt +showcover: + go tool cover -html=coverage.txt + acc-showcover: go tool cover -html=coverage-acceptance.txt