error: 1061: orphan end test
We are facing issue while running the below command for go2xunit package, since a month
command : go test -v $PKGS | $GOPATH/bin/go2xunit
error snippet root@****:<PATH># go test -v $PKGS | $GOPATH/bin/go2xunit -output tests.xml error: 1044: orphan end test
root@*****:<PATH># go test -v $PKGS | $GOPATH/bin/go2xunit - (should output to console, but none) error: 1036: orphan end test *error snippet
go2xunit package version - 1.4.8
Thanks @tej24 . Can you give me a bit more information?
Mostly I'd like to see the output of go test -v $PKGS. go version will be helpful as well
@tebeka List of files ( not exactly same in content though) github.abc.def.hij/test/productapi.git/model/resourceCustomActionsModel github.abc.def.hij/test/productapi.git/model/resourceModel github.abc.def.hij/test/productapi.git/model/roleModel github.abc.def.hij/test/productapi.git/model/schedulerModel github.abc.def.hij/test/productapi.git/model/scriptTypeModel github.abc.def.hij/test/productapi.git/model/tagmodel github.abc.def.hij/test/productapi.git/model/templateModel github.abc.def.hij/test/productapi.git/model/ucmdbResourceModel github.abc.def.hij/test/productapi.git/util/clientutils github.abc.def.hij/test/productapi.git/util/constants github.abc.def.hij/test/productapi.git/webserver
go version go1.9.5 linux/amd64
Thanks @tej24, The output of go test -v $PKGS will be much more helpful. If you can attach it (maybe mask information) it'll be much more helpful. Currently I don't have much to go on.
@tebeka I'm getting the same error with some of our testcases.
Maybe it's related to that some of our testcases print something in json format to the console?
I ran:
go test -tags unit ./... 2>&1
to generate the output: output.txt.
When I pass it to
cat output.txt | go2xunit -output junit
I get the error:
error: 5: orphan end test
and the output file is empty.
- go version go1.11.2 linux/amd64
- go2xunit 1.4.8
IMO the test output is truncated. The first line in output.txt that gives any indication that it's a test is
--- FAIL: TestTriggerDueRemindersWhenAllARsAreDue (0.26s), there should be a RUN before it.
@tebeka yes, sorry, you are right. In the attached output.txt, I ran go test without the -v flag.
The orphan end test error happens reproducibly for multiple of our unit tests (also when passing the -v flag).
Attached is the output from another test run, where go2xunit fails to parse it with the error:
error: 10: orphan end test
If required I can provide more examples.
Thanks. Will have a look soon.
Seems like you're running with t.Parallel? (CONT/PAUSE was added in go 1.10).
Currently t.Parallel is "problematic", see #29
Yes, those tests were using t.parallel
I am also hitting this error when I have fmt.Print for output instead of fmt.Println ps. tests are not running with t.parallel
go version go1.10.3 linux/amd64 go2xunit 1.4.8
Sorry for the slow updates. I'll try to solved this soon.
I am seeing this problem, too. I have tests that are not using T.Parallel, but do test a gin based web service. Running my tests gives debug output from gin, along the lines of:
[GIN] 2019/09/05 - 14:24:14 | 400 | 12.38µs | | POST /api/v1/launch
=== RUN TestLaunch/Missing_cilist
[GIN] 2019/09/05 - 14:24:14 | 400 | 48.228µs | | POST /api/v1/launch/wannaTest
=== RUN TestLaunch/Minimal_request
[GIN] 2019/09/05 - 14:24:14 | 200 | 776.615µs | | POST /api/v1/launch/wannaTest
Response: {Message: Error:false CiList:[node1] Description: Tags:[] JobNumber: CIStatus:[]}=== RUN TestLaunch/Multiple_CIs
[GIN] 2019/09/05 - 14:24:14 | 200 | 567.495µs | | POST /api/v1/launch/wannaTest
Thanks @kelbyers, can you provide the input to go2xunit?
Sorry about the delay. In trying to get some data for you, we discovered that our test had some debug output that was printing as control characters, instead of taking an int and printing it as a string. It may well be a problem with our tests.