It's all about the answers!

Ask a question

How to get junit logs from jenkins to RTC


Abraham Sweiss (2.4k1331) | asked Feb 21 '14, 2:51 p.m.
Hello team,

Environment
RTC 4.0.0.1 using Jenkins

On the build results > logs  page in RTC I have a link to the build and compile logs.  

Question:  On Jenkins there are seperate logs for junit results.  How can I get these log files over to the build results -> logs page.

2 answers



permanent link
Abraham Sweiss (2.4k1331) | answered Feb 27 '14, 3:02 p.m.
For examples of ant tasks see the following link.
http://pic.dhe.ibm.com/infocenter/clmhelp/v4r0m2/index.jsp?topic=%2Fcom.ibm.team.build.doc%2Ftopics%2Fr_publishbuildresult.html&resultof%3D%2522%2562%2575%2569%256c%2564%2522%2520%2522%2572%2565%2573%2575%256c%2574%2522%2520%2522%2564%256f%2577%256e%256c%256f

However, for JUnit and ECJ compiler logs, there is a way to publish these with build definition configuration only.
In the build definition editor, click the editor header drop-down menu, choose Edit Configuration...
In the post-build tab, select JUnit Publishing
You should now see a "JUnit Publishing" tab in the definition editor
Go to the JUnit Publishing tab. In the "Log or directory" field, enter the path to the JUnit output files. For example: /home/user/my-app/target/surefire-reports
Save the definition
Request a build
After the build completes, you should see a JUnit tab in the build result

I have openned up the following documentation enhancement
https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/305579

permanent link
Nick Edgar (6.5k711) | answered Feb 21 '14, 2:57 p.m.
JAZZ DEVELOPER
Hi Abraham, if the XML output is available from running JUnit, you can publish that to RTC using the junitLogPublisher Ant task. This could be set up as a separate step in the Jenkins build.
Note that the XML format is actually generated by Ant's logger for JUnit, not JUnit itself.  I assume Jenkins uses this approach too.  For more details, see https://pzolee.blogs.balabit.com/2012/11/jenkins-vs-junit-xml-format/


Comments
Abraham Sweiss commented Feb 27 '14, 2:59 p.m.

Nick, Thanks that led me in the right direction

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.