publishing JUNIT results from multiple directories
2 answers
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 :
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 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,