SonarSource / sonar-go-archived

SonarGo: Go Analyzer for SonarQube
https://docs.sonarqube.org/display/PLUG/SonarGo
Other
120 stars 24 forks source link

Support modules when importing test report #378

Open saberduck opened 5 years ago

saberduck commented 5 years ago

go test will use module as package name in the json report. We should read content of the go.mod file. See https://github.com/golang/go/wiki/Modules

Sample go.mod

module github.com/getyoti/yoti-go-sdk/v2

require (
    github.com/golang/protobuf v1.2.0
    github.com/google/go-cmp v0.2.0
    github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024 // indirect
    golang.org/x/sync v0.0.0-20181108010431-42b317875d0f // indirect
)

go test ./... -json

{"Time":"2019-05-28T15:19:12.3801013+02:00","Action":"run","Package":"github.com/getyoti/yoti-go-sdk/v2","Test":"TestYotiClient_KeyLoad_Failure"}
saberduck commented 5 years ago

See also #361