Collect Test Metadata from "go test -json"

go
golang

#1

Go 1.10 adds a new -json flag to the go test command that outputs test results in a machine-readable JSON format. It would be really cool if Circle CI collected test metadata from this output, like it does with other languages.


#2

Could you just use the test artifact feature, and fetch that via the Circle API? I appreciate that’s not as convenient, but it’d get you unstuck in the short term.

Or can you convert your JSON to JUnit format, so it can integrate with Circle?


#3

Unfortunately, there isn’t really any tool to do that. The closest would be go-junit-report but that doesn’t have any releases and doesn’t seem to be maintained that well (there is a PR from 2016 that is still open)


#4

Fetching the file via the API doesn’t really buy us anything. It’s the Insights screen that we’re really interested in.


#5