How to get junit logs from jenkins to RTC
2 answers
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/
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
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