added junit.xml output
This commit is contained in:
parent
568b230e21
commit
24b469c511
10
Makefile
10
Makefile
@ -19,10 +19,16 @@ vet: fmt
|
|||||||
go vet ./...
|
go vet ./...
|
||||||
|
|
||||||
test: build
|
test: build
|
||||||
go test -count=1 ${TESTFLAGS} ./pkg/... ./cmd/...
|
mkdir -p testout
|
||||||
|
go test -count=1 -coverprofile=testout/coverage.out -json ${TESTFLAGS} ./pkg/... ./cmd/... 2>&1 | \
|
||||||
|
tee testout/tests.json | sh filtertestjson
|
||||||
|
go-junit-report < testout/tests.json > testout/junit.xml
|
||||||
|
|
||||||
integrationtest: build
|
integrationtest: build
|
||||||
go test -count=1 ${TESTFLAGS} ./integrationtest/...
|
mkdir -p testout
|
||||||
|
go test -count=1 ${TESTFLAGS} ./integrationtest/... -json 2>&1 | \
|
||||||
|
tee testou8t/integrationtests.json | sh filtertestjson
|
||||||
|
go-junit-report < testout/integrationtests.json > testout/integrationtest.xml
|
||||||
|
|
||||||
build: generate vet
|
build: generate vet
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
|
12
filtertestjson
Normal file
12
filtertestjson
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
|
jq -r '
|
||||||
|
select(.Action != "outputx") |
|
||||||
|
if .Action == "fail" then "❌ FAIL: \(.Package) \(.Test // "")"
|
||||||
|
elif .Action == "pass" then "✅ PASS: \(.Package) \(.Test // "")"
|
||||||
|
elif .Action == "run" then "▶️ RUN: \(.Package) \(.Test // "")"
|
||||||
|
else " \(.Output // "" | rtrimstr("\n") )"
|
||||||
|
end
|
||||||
|
'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user