如何以XUnit格式输出Go的测试库输出以与Jenkins集成?没有命令行选项可以输出到XML或XUnit格式go test.
有一个很好的小插件转换:https://github.com/tebeka/go2xunit
要安装它:
go get github.com/tebeka/go2xunit
Run Code Online (Sandbox Code Playgroud)
要使用它:
# Run your tests like normal, but pipe the verbose output to the converter
go test -v | $GOPATH/bin/go2xunit > test_output.xml
Run Code Online (Sandbox Code Playgroud)
如果你有$GOPATH/bin正常的$PATH:
go test -v | go2xunit > test_output.xml
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3648 次 |
| 最近记录: |