It's all about the answers!

Ask a question

junitLogPublisher - how to collect multiple reports?


Torben Knerr (41112) | asked Feb 06 '08, 7:45 a.m.
Hi all,

we are trying to include the junit test reports in the Jazz build. Currently, we are using the junit <batchtest /> task for running our testsuites. However, the <batchtest /> task generates multiple testreports at once which we would like to publish using the junitLogPublisher task.

The javadoc for AbstractFilePublisher says:
"filePath - A path relative to the base directory of the build file or the full path to the input file or directory."

Thus I assumed I could simply specify the _directory_ containing all the testreports generated during the batchtest. However, the build (more precisely: the junitLogPublisher and logFilePublisher tasks) fail:

* logPublisherTask says "com.ibm.team.build.common.TeamBuildException: D:\jazzbuilds\fetched\testproject\target\testreports (Access is denied.)"
* junitLogPublisherTask says "com.ibm.team.build.common.TeamBuildException: Exception parsing "D:\jazzbuilds\fetched\testproject\target\testreports""

Is there a solution to this?

Thanks and best regards,
Torben


===
P.S.: here is a code snippet of our ant build:

<junit haltonfailure="true"
printsummary="withOutAndErr"
fork="false"
dir="${build.dir}">
<classpath refid="project.test.classpath" />
<formatter type="xml" />
<batchtest todir="${build.dir}/testreports">
<fileset dir="${build.test.dir}">
<include name="**/*Test.class" />
<include name="**/Test*.class" />
<include name="**/*TestCase.class" />
<exclude name="**/*MayFail**" />
</fileset>
</batchtest>
</junit>

<!-- Publish the raw junit log. -->
<logPublisher buildResultUUID="${buildResultUUID}"
repositoryAddress="${repositoryAddress}"
userId="${userId}"
password="${password}"
filePath="${build.dir}/testreports/"
label="Raw JUnit logs for ${projectName}" / -->

<!-- Publish the JUnit log to Jazz. -->
<junitLogPublisher filePath="${build.dir}/testreports/"
buildResultUUID="${buildResultUUID}"
repositoryAddress="${repositoryAddress}"
userId="${userId}"
password="${password}" />

3 answers



permanent link
Don Weinand (7851) | answered Feb 06 '08, 2:09 p.m.
JAZZ DEVELOPER
There is a bit of bad news/good news on this one. Bad news first...currently the task does require the path to the JUnit log file to be able to process it. Unfortunately this will require you to use another ant mechanism to process through all the files. There are some suggestions for doing that in a similar thread on this topic on 1/17/08. The good news is we recently enhanced that task so that it can take a directory instead. This was added as part of workitem 41526 and should be available in M5.

Don Weinand
Jazz Team Build Developer

permanent link
Ryan Manwiller (1.3k1) | answered Feb 06 '08, 4:38 p.m.
JAZZ DEVELOPER
I've attached a beta2(a) version of the junitLogPublisher to the work item
so you don't have to wait until M5 is released.

https://jazz.net/jazz/resource/itemName/WorkItem/41526

permanent link
Torben Knerr (41112) | answered Feb 07 '08, 2:04 a.m.
Dear Ryan,

Thanks for sharing the patch. I've worked around the issue using the ant-contrib <foreach /> task, but now I'm glad I no longer need this dependency...

Thanks,
Torben

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.