diff --git a/Makefile b/Makefile index aaf5317fe6..10f07793fb 100644 --- a/Makefile +++ b/Makefile @@ -11,15 +11,15 @@ clean: ## remove build artifacts rm -rf ./build/* cli/winresources/rsrc_* ./man/man[1-9] docs/yaml/gen .PHONY: test-unit -test-unit: ## run unit test - ./scripts/test/unit $(shell go list ./... | grep -vE '/vendor/|/e2e/') +test-unit: ## run unit tests, to change the output format use: GOTESTSUM_FORMAT=(dots|short|standard-quiet|short-verbose|standard-verbose) make test-unit + gotestsum -- $(shell go list ./... | grep -vE '/vendor/|/e2e/') .PHONY: test test: test-unit ## run tests .PHONY: test-coverage test-coverage: ## run test coverage - ./scripts/test/unit-with-coverage $(shell go list ./... | grep -vE '/vendor/|/e2e/') + gotestsum -- -coverprofile=coverage.txt $(shell go list ./... | grep -vE '/vendor/|/e2e/') .PHONY: fmt fmt: diff --git a/scripts/test/unit b/scripts/test/unit deleted file mode 100755 index 6e0b6d5cba..0000000000 --- a/scripts/test/unit +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -set -eu -o pipefail - -gotestsum -- "$@" diff --git a/scripts/test/unit-with-coverage b/scripts/test/unit-with-coverage deleted file mode 100755 index db2efe7853..0000000000 --- a/scripts/test/unit-with-coverage +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -set -eu -o pipefail - -# install test dependencies once before running tests for each package. This -# reduces the runtime from 200s down to 23s -go test -i "$@" - -echo "mode: atomic" > coverage.txt -for pkg in "$@"; do - ./scripts/test/unit \ - -cover \ - -coverprofile=profile.out \ - -covermode=atomic \ - "${pkg}" - - if test -f profile.out; then - grep -v "^mode:" < profile.out >> coverage.txt || true - rm profile.out - fi -done