Skip to content

Commit 654b2b9

Browse files
committed
chore(ci): experiment with using tparse
Try out mfridman/tparse in the CI for the various quality of life improvements it gives us around readability of test results
1 parent 53e77a4 commit 654b2b9

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

.gitignore

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ _testmain.go
2323

2424
*.exe
2525

26-
coverage.txt
27-
profile.out
28-
29-
simplest-uncommitted-msg-0.1-jar-with-dependencies.jar
26+
/bin
27+
/coverage.txt
28+
/profile.out
29+
/output.json
3030

3131
.idea

Makefile

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
default: fmt get update test lint
22

33
GO := go
4+
GOBIN := $(shell pwd)/bin
45
GOBUILD := CGO_ENABLED=0 $(GO) build $(BUILD_FLAG)
56
GOTEST := $(GO) test -v -race -coverprofile=profile.out -covermode=atomic
67

78
FILES := $(shell find . -name '*.go' -type f -not -name '*.pb.go' -not -name '*_generated.go' -not -name '*_test.go')
89
TESTS := $(shell find . -name '*.go' -type f -not -name '*.pb.go' -not -name '*_generated.go' -name '*_test.go')
910

11+
$(GOBIN)/tparse:
12+
GOBIN=$(GOBIN) go install github.com/mfridman/[email protected]
1013
get:
1114
$(GO) get ./...
1215
$(GO) mod verify
@@ -23,9 +26,15 @@ fmt:
2326
lint:
2427
GOFLAGS="-tags=functional" golangci-lint run
2528

26-
test:
27-
$(GOTEST) -timeout 2m ./...
29+
test: $(GOBIN)/tparse
30+
$(GOTEST) -timeout 2m -json ./... \
31+
| tee output.json | $(GOBIN)/tparse -follow -all
32+
[ -z "${GITHUB_STEP_SUMMARY}" ] \
33+
|| NO_COLOR=1 $(GOBIN)/tparse -format markdown -file output.json -all >${GITHUB_STEP_SUMMARY}
2834

2935
.PHONY: test_functional
30-
test_functional:
31-
$(GOTEST) -timeout 12m -tags=functional ./...
36+
test_functional: $(GOBIN)/tparse
37+
$(GOTEST) -timeout 12m -tags=functional -json ./... \
38+
| tee output.json | $(GOBIN)/tparse -follow -all
39+
[ -z "${GITHUB_STEP_SUMMARY}" ] \
40+
|| NO_COLOR=1 $(GOBIN)/tparse -format markdown -file output.json -all >${GITHUB_STEP_SUMMARY}

0 commit comments

Comments
 (0)