tebeka / go2xunit

Convert "go test" output to xunit compatible (used in Jenkins/Hudson)
MIT License
162 stars 46 forks source link

"orphan end test" error for go 1.5 beta 1 #23

Closed bfallik closed 9 years ago

bfallik commented 9 years ago

Our test conversion fails when run agains the recent go 1.5 beta 1. The error is:

bin/go2xunit -fail -input go-test.out -output go-test.xml
error: 2: orphan end test

When I compare output from 1.4 the diffs show some additional whitespace in the test output:

$ diff -u go1.4.2.make.log go1.5.make.log | head -n 10
--- go1.4.2.make.log    2015-07-13 23:43:48.000000000 -0400
+++ go1.5.make.log  2015-07-13 23:41:20.000000000 -0400
@@ -1,6070 +1,6067 @@
 GOPATH='/Users/bfallik/sandbox/gillnet/go:/Users/bfallik/sandbox/gillnet/go' go install _vendor/bitbucket.org/tebeka/go2xunit
 GOPATH='/Users/bfallik/sandbox/gillnet/go:/Users/bfallik/sandbox/gillnet/go' go test -v ./... | tee go-test.out ; exit ${PIPESTATUS[0]} # BASH specific
-=== RUN Test_schedulesStat
+=== RUN   Test_schedulesStat
 --- PASS: Test_schedulesStat (0.00s)
-=== RUN Test_AdZoneStateZip
+=== RUN   Test_AdZoneStateZip

If I use sed to coalesce the whitespace go2xunit completes successfully.

tebeka commented 9 years ago

Thanks for reporting, will try to fix this soon.

bfallik commented 9 years ago

@tebeka would you be willing to review+accept a PR to address this one?

tebeka commented 9 years ago

Sure, was planning to review it tomorrow morning - but I'll try tonight.

tebeka commented 9 years ago

Fixed in 1.2.2. Thanks again for reporting.

bfallik commented 9 years ago

@tebeka thanks! I can verify this fixes our issue and still works with go1.4 too.