Bamboo's JUnit Parser won't parse my gtest output.xml
Asked Answered
D

1

6

I was trying to add some automated Unit Tests to my project with Bamboo and have been facing some problems. The Unit Tests themselves are done with googletest, which creates an XML file which should be compatible with the JUnit parser.

However, I'm getting the following error when executing Bamboo's JUnit Parser:

02-Apr-2013 12:11:22 Starting task ''Parse UnitTest output' of type 'com.atlassian.bamboo.plugins.testresultparser:task.testresultparser.junit'
02-Apr-2013 12:11:22 Parsing test results...
02-Apr-2013 12:11:22 Failing task since test cases were expected but none were found.
02-Apr-2013 12:11:22 Finished task 'Parse UnitTest output'

This doesn't seem to have anything to do with the .xml file itself, as I've tried a few. This included my own output.xml, generated by googletest and the sample outputs from https://confluence.atlassian.com/display/BAMBOO/JUnit+parsing+in+Bamboo.
I also adapted said files against the two proposed .xsd files, which should match the output that the JUnit Parser expects, but all to no effect.

Update:
Up until now I told the JUnit Parser to look for ${bamboo.build.working.directory}/output.xml
When I tried **/*.xml it worked.
As I understand it now, after very carefully reading the task description, I have to give it a folder. But I can also give it the files, if I do it in ant-style (with a glob?). This is at the very least very confusing and still doesn't fully answer the inital question. So if anyone could enlighten me, please do.

Decalogue answered 2/4, 2013 at 10:34 Comment(4)
I've raised a support request for Bamboo. I am also having the same issue jira.atlassian.com/browse/BAM-13082Marital
Tristans, I've since found a solution which at least works for me. See the update above, maybe it works for you too.Decalogue
I think you are supposed to give a relative path: relative to the current build directory. ${bamboo.build.working.directory}/output.xml is absolute, not relative. Can this be the reason of your problem? Also, remember that the build directory may change between jobs.Timaru
This is a very common issue, and I suggest if you can you should the update section as an answer.Evangelistic
B
3

This is a super-old question, I figured I'd add an answer for posterity. As a few people have commented, the configuration value for test output files requires a relative path. The question is, relative to what?

I think the answer to that depends on how you have your source repositories configured, but in general it will be relative to the root of your project. If all else fails, look at where bamboo is putting your source code when it gets checked out; that'll be the directory to which bamboo appends the test output search path.

For the configuration syntax, you're correct that ant-style patterns can be used (Learning Ant path style for reference).

Just as an example, if you have a project which on your local machine lives at C:\git\MyProject, and your test results end up at C:\git\MyProject\Output\Tests\output.xml, then you'd specify Output/Tests/output.xml in the 'Specify custom results directories' field of the appropriate task configuration. You could also use Output/**/*.xml to search for all .xml files in the Output directory.

Boyce answered 27/7, 2015 at 21:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.