Skip to content

Commit 7e2c7ae

Browse files
author
Ian Lewis
authored
chore: Don't be verbose with tests locally (#620)
It can sometimes be unwieldy when running tests with the verbose flag. This changes the Makefile to run tests without the flag by default but with the flag set on GitHub Actions. Signed-off-by: Ian Lewis <[email protected]>
1 parent 93d3f8c commit 7e2c7ae

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

Makefile

+16-6
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,25 @@ node_modules/.installed: package.json package-lock.json
2626

2727
.PHONY: unit-test
2828
unit-test: ## Runs all unit tests.
29-
go mod vendor
30-
# NOTE: go test builds packages even if there are no tests.
31-
go test -mod=vendor -v ./...
29+
@ # NOTE: go test builds packages even if there are no tests.
30+
@set -e;\
31+
go mod vendor; \
32+
extraargs=""; \
33+
if [ "$(OUTPUT_FORMAT)" == "github" ]; then \
34+
extraargs="-v"; \
35+
fi; \
36+
go test -mod=vendor $$extraeargs ./...
3237

3338
.PHONY: regression-test
3439
regression-test: ## Runs all regression and unit tests.
35-
go mod vendor
36-
# NOTE: go test builds packages even if there are no tests.
37-
go test -mod=vendor -tags=regression -v -timeout=25m ./...
40+
@ # NOTE: go test builds packages even if there are no tests.
41+
@set -e;\
42+
go mod vendor; \
43+
extraargs=""; \
44+
if [ "$(OUTPUT_FORMAT)" == "github" ]; then \
45+
extraargs="-v"; \
46+
fi; \
47+
go test -mod=vendor -tags=regression $$extraeargs -timeout=25m ./...
3848

3949
## Tools
4050
#####################################################################

0 commit comments

Comments
 (0)