douni1396
2018-06-27 07:45
浏览 254
已采纳

GoSonar:如何生成go test -json> report.json

How to generate go test -json > report.json

Golang Version: Go1.10.3

SonarQube Properties: sonar.go.tests.reportPaths = report.json

Offical Sonar Document -> https://docs.sonarqube.org/display/PLUG/Unit+Tests+Results+Import

Makefile

.PHONY: test
test:
    @$(foreach package,$(packages), \
        go test -coverprofile $(package)/cover.out -covermode=count $(package);)

.PHONY: cover
cover-xml:
    @$(foreach package,$(packages), \
        gocov convert $(package)/cover.out | gocov-xml > $(package)/coverage.xml;)

1条回答 默认 最新

相关推荐 更多相似问题