It's all about the answers!

Ask a question

publishing JUNIT results from multiple directories


Daniel martin (10122926) | asked Apr 03 '09, 2:42 p.m.
I have a maven build which produces junit result in three different surefire-reports directories. I have not found a way through the use of build properties, or using relative paths to put all the test result in the publication. Is there any way to currently get this done?

thanks,

2 answers



permanent link
Sébastien Alonzo (561) | answered May 12 '09, 6:32 a.m.
Hello,

I have exactly the same situation and it seems the automatic JUnit publication in the build definition page can only handle one directory.

To publish test results for more than one project this you have to invoke Jazz ANT tasks in your Maven build.

There is a specific page for that in the wiki : https://jazz.net/wiki/bin/view/Main/MavenBuild

Here is a sample of my Parent pom.xml :

<profiles>
<profile>
<id>jazzBuild</id>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>jazzTest</id>
<phase>test</phase>
<inherited>false</inherited>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<taskdef name="junitLogPublisher"
classname="com.ibm.team.build.ant.task.JUnitLogPublisherTask" />

<junitLogPublisher repositoryAddress="${repositoryAddress}"
userId="${build.userId}" passwordFile="${build.passwordFile}"
buildResultUUID="${buildResultUUID}" filePath="target/surefire-reports/"
failOnError="false" />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>



Then all you have to do is invoke your maven goal with the 'jazzBuild' profile on the parent project so that each module surefire-reports will be published to Jazz server.

Note :
build userId and password/passwordFile must be supplied somhow to the ant task, therefore I had to specify them using -D options in my Maven build definition
if some of your projects don't have tests, the target/surefire-reports directory will be missing and you must specify failOnError="false" in the junitLogPublisher task

Hope that helps,
Sebastien

I have a maven build which produces junit result in three different surefire-reports directories. I have not found a way through the use of build properties, or using relative paths to put all the test result in the publication. Is there any way to currently get this done?

thanks,

permanent link
Sébastien Alonzo (561) | answered May 18 '09, 7:24 a.m.
FYI an Enhancement Work Item has just been created for such a feature : 83242

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.