junitLogPublisher - how to collect multiple reports?
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
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 |
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 |
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
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.