From e9906107c5696e1e60cc27d64981e89a3cab8e52 Mon Sep 17 00:00:00 2001 From: Konrad Hanff Date: Thu, 27 May 2021 08:22:41 +0200 Subject: [PATCH] Do not use cached test results When running the `test` and `e2e-test` target with make, this prevents `go test` from using cached test results. Rerunning the tests every time allows for easy detection of flaky tests. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 502c198..21b9172 100644 --- a/Makefile +++ b/Makefile @@ -62,7 +62,7 @@ mock: deps ## Create/Update a mock. Example: make mock name=apiQuerier pkg=./nom .PHONY: test test: deps ## Run unit tests - @go test -short $(UNIT_TESTS) + @go test -count=1 -short $(UNIT_TESTS) .PHONY: race race: deps ## Run data race detector @@ -81,7 +81,7 @@ coverhtml: coverage ## Generate HTML coverage report .PHONY: e2e-test e2e-test: ## Run e2e tests - @go test ./e2e_tests -v + @go test -count=1 ./e2e_tests -v .PHONY: e2e-docker e2e-docker: docker ## Run e2e tests against the Docker container