Skip to content

Commit 6a1d600

Browse files
committed
chore: Change test commands and add junit output
1 parent 27e565f commit 6a1d600

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
- run: dockerize -wait tcp://localhost:8088 -timeout 5m
122122
- run: dockerize -wait tcp://localhost:8181 -timeout 5m
123123
- run: docker logs keycloak
124-
- run: make test/all/gotestfmt
124+
- run: make test/all
125125
- run: make test/coverage
126126
- run: go install github.com/mattn/goveralls@latest
127127
- env:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,4 @@ _dist/
139139
coverage.html
140140
bundle.tar.gz
141141
*.log
142+
junit.xml

Makefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ HAS_GIT := $(shell command -v git;)
3131
HAS_GOLANGCI_LINT := $(shell command -v golangci-lint;)
3232
HAS_CURL:=$(shell command -v curl;)
3333
HAS_MOCKGEN:=$(shell command -v mockgen;)
34-
HAS_GOTESTFMT:=$(shell command -v gotestfmt;)
34+
HAS_GOTESTSUM:=$(shell command -v gotestsum;)
3535
HAS_FIELDALIGNMENT:=$(shell command -v fieldalignment;)
3636

3737
.DEFAULT_GOAL := code/lint
@@ -96,11 +96,11 @@ endif
9696

9797
.PHONY: test/all
9898
test/all: setup/dep/install
99-
$(GO) test --tags=unit,integration -v -coverpkg=./pkg/... -covermode=count -coverprofile=c.out.tmp ./pkg/...
99+
gotestsum --junitfile junit.xml --format testname --format-hide-empty-pkg -- --tags=unit,integration -coverpkg=./pkg/... -covermode=count -coverprofile=c.out.tmp ./pkg/...
100100

101-
.PHONY: test/all/gotestfmt
102-
test/all/gotestfmt: setup/dep/install
103-
$(GO) test -json --tags=unit,integration -v -coverpkg=./pkg/... -covermode=count -coverprofile=c.out.tmp ./pkg/... | tee /tmp/gotest.log | gotestfmt
101+
.PHONY: test/all/original
102+
test/all/original: setup/dep/install
103+
$(GO) test --tags=unit,integration -v -coverpkg=./pkg/... -covermode=count -coverprofile=c.out.tmp ./pkg/...
104104

105105
.PHONY: test/unit
106106
test/unit: setup/dep/install
@@ -184,9 +184,9 @@ ifndef HAS_MOCKGEN
184184
@echo "=> Installing mockgen tool"
185185
go install github.com/golang/mock/mockgen@v1.6.0
186186
endif
187-
ifndef HAS_GOTESTFMT
188-
@echo "=> Installing gotestfmt tool"
189-
go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@v2.4.1
187+
ifndef HAS_GOTESTSUM
188+
@echo "=> Installing gotestsum tool"
189+
go install gotest.tools/gotestsum@v1.10.1
190190
endif
191191
ifndef HAS_FIELDALIGNMENT
192192
@echo "=> Installing fieldalignment tool"

0 commit comments

Comments
 (0)