Skip to content

Commit 3169e83

Browse files
chmouelzakisk
authored andcommitted
feat: allow configuration of gotestsum output format
Introduced a default variable to define the gotestsum output format. This enabled users to override the default test output style when running unit tests via the Makefile.
1 parent d407897 commit 3169e83

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ GOLANGCI_LINT=golangci-lint
55
GOFUMPT=gofumpt
66
TKN_BINARY_NAME := tkn
77
TKN_BINARY_URL := https://tekton.dev/docs/cli/\#installation
8+
DEFAULT_GOTESTSUM_FORMAT ?= testdox
89
LDFLAGS=
910
OUTPUT_DIR=bin
1011
GO = go
@@ -68,7 +69,7 @@ test-unit: ## Run unit tests
6869
@mkdir -p tmp/
6970
@echo "Running unit tests..."
7071
@if command -v gotestsum >/dev/null 2>&1; then \
71-
gotestsum --format testdox -- $(DEFAULT_GO_TEST_FLAGS) $(GO_TEST_FLAGS) -timeout $(TIMEOUT_UNIT) ./pkg/...; \
72+
gotestsum --format ${DEFAULT_GOTESTSUM_FORMAT} -- $(DEFAULT_GO_TEST_FLAGS) $(GO_TEST_FLAGS) -timeout $(TIMEOUT_UNIT) ./pkg/...; \
7273
else \
7374
$(GO) test $(DEFAULT_GO_TEST_FLAGS) $(GO_TEST_FLAGS) -timeout $(TIMEOUT_UNIT) ./pkg/...; \
7475
fi

0 commit comments

Comments
 (0)