5
如何以XUnit格式输出Go的测试库输出以便与Jenkins集成?没有命令行选项可以输出为XML或XUnit格式,其格式为go test
。将Go测试输出转换为XUnit
如何以XUnit格式输出Go的测试库输出以便与Jenkins集成?没有命令行选项可以输出为XML或XUnit格式,其格式为go test
。将Go测试输出转换为XUnit
有一个可爱的小插件转换:https://github.com/tebeka/go2xunit
进行安装:
go get github.com/tebeka/go2xunit
要使用它:
# Run your tests like normal, but pipe the verbose output to the converter
go test -v | $GOPATH/bin/go2xunit > test_output.xml
如果你在正常$PATH
有$GOPATH/bin
:
go test -v | go2xunit > test_output.xml