Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

publishing JUNIT results from multiple directories

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,

0 votes



2 answers

Permanent link
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,

0 votes


Permanent link
FYI an Enhancement Work Item has just been created for such a feature : 83242

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Apr 03 '09, 2:42 p.m.

Question was seen: 6,575 times

Last updated: Apr 03 '09, 2:42 p.m.

Confirmation Cancel Confirm