jstemmer / go-junit-report

Convert Go test output to JUnit XML
MIT License
764 stars 222 forks source link

Is it possible to generate both xml and json? #121

Closed andresmonc closed 2 years ago

andresmonc commented 3 years ago

Unfortunately Jenkins wants XML and Sonar wants JSON. Any way to work around this?

KacperPerschke commented 2 years ago

Does the pseudo JSON from the command

go test -json

meet the expectations of the Sonar application?

jstemmer commented 2 years ago

What kind of JSON is Sonar expecting? Can you give an example or link to a page describing the format Sonar needs?

KacperPerschke commented 2 years ago

@jstemmer probably sonarqube "Generic Issue Import Format" is the answear to your qestion.

If so I'ld ask @andresmonc if use of go test results as sonarqube input is a good idea. As I understand that go test is primarily intended for unit testing, and sonar for static code analysis. Which IMHO is another kind of a beast.

jstemmer commented 2 years ago

If the JSON Sonar expects is indeed for static code analysis, then go-junit-report is probably not the tool you need. In any case, without more information there's not much more we can do right now.