The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JUnit Test Job -- Help with Configuration

Deleted user
August 10, 2011

Hello,

I use GoogleTest to test the software on our team. It generates a JUNit compatible (I believe) XML Test Report. I already have the tests running automatically as a part of our Bamboo build, but I haven't figured out how to configure the JUnit Test Job properly to parse the generated XML.

Can somebody help me with a working example? I just need to know where to put the .XML file, and how to configure the job to properly see/parse it.

Thanks a ton,

Jim

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 11, 2011
Something like this should do the trick:
Set up a task that produces the results in XML format:

./SomeGTest --gtest_output=xml:SomeGTest.xml exit 0

And follow up with JUnit Test Parser task pointed to the XMLs you generate.
Deleted user
August 11, 2011

I understand that. What I'm confused with is the information to enter in to the JUnit Parser task. (Screenshot's not working for me)

Basically, I want to know two things:

  1. Where to copy the XML? What directory does it need to be in? Right now, it's automatically generated in a location outside of bamboo-home.
  2. How do I specify it on the JUnit Parser screen. Specifically, what should I enter in the "Specify custom results directories" edit box? Do I just enter a directory like "C:\XMLResults"? Do I need to specify the file? "C:\XMLRepores\Tests.xml"?

Thanks,

Jim

0 votes
Ron Chan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 11, 2011

That is an Ant based syntax which means 'zero or more directories' which match the path.

Try it!

Deleted user
August 11, 2011

I will. Last question. You say it's "relative to your build script". Where is that relative to your bamboo-home directory?

My bamboo home directory is "C:\Aristocrat\bamboo-home". Is "bin-test" right under that?

Thanks,

Jim

Przemek Bruski
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 11, 2011

Where is that relative to your bamboo-home directory?

It's relative to your build directory, not bamboo-home directory. If you don't use absolute paths for storing xml files (which you should), that's where the files will end up.

<tt>If you need to know the build direcotyr location, Bamboo makes it available via build.working.directory.
More information here: http://confluence.atlassian.com/display/BAMBOO/Using+Global%2C+Plan+or+Build-specific+Variables</tt>

0 votes
Ron Chan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 11, 2011

Here's what my Junit Parser Configuration looks like:

**/bin-test/Release/*.xml

(this path is relative to my build script....do NOT USE literal paths)

I hope this helps.

Ron

Deleted user
August 11, 2011

What does the "**" mean? I haven't seen that syntax before. That's what was confusing me about the built-in example.

Jim

TAGS
AUG Leaders

Atlassian Community Events