jstemmer / go-junit-report

Convert Go test output to JUnit XML
MIT License
776 stars 224 forks source link

The generated results do not have the correct entry for testcases so Junit of jenkins will complain no test found. And the failed test result does not report the correct error msg #56

Closed kaka0950 closed 6 years ago

kaka0950 commented 7 years ago

When there is no test fail, there is no testcase node at all.

jstemmer commented 7 years ago

Can you give an example showing the test output and generated XML?

kaka0950 commented 7 years ago

test output ok something.com/services/name1 6.089s ok something.com/name2 0.402s

generated XML is <?xml version="1.0" encoding="UTF-8"?>

kaka0950 commented 7 years ago

untitled text 2.txt

jstemmer commented 7 years ago

I don't see any individual test output, how are you running the go test command? Did you specify the -v flag?

kaka0950 commented 7 years ago

this 2 lines are the test output ok something.com/services/name1 6.089s ok something.com/name2 0.402s

no i do not use -v flag since it reports some failed tests which should not be reported

kaka0950 commented 7 years ago

cat testouput.out | path/bin/go-junit-report -set-exit-code >> folder/report.xml

jstemmer commented 6 years ago

go-junit-report needs the additional information that is present when you run go test with the -v flag, otherwise the output doesn't contain the information needed to generate the individual testcases in the output report.