Converting Go testing output to XUnit

隐身守侯 提交于 2019-12-08 21:08:47

问题


How can I have the output of Go's testing library output in XUnit format for integration with Jenkins? There are no command line options to output to XML or to XUnit format with go test.


回答1:


There's a nice little plugin to convert: https://github.com/tebeka/go2xunit

To install it:

go get github.com/tebeka/go2xunit

To use it:

# Run your tests like normal, but pipe the verbose output to the converter
go test -v | $GOPATH/bin/go2xunit > test_output.xml

If you have $GOPATH/bin in your normal $PATH:

go test -v | go2xunit > test_output.xml


来源:https://stackoverflow.com/questions/20958647/converting-go-testing-output-to-xunit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!