[ http://jira.codehaus.org/browse/SUREFIRE-737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=266126#action_266126 ]
Rex Hoffman commented on SUREFIRE-737: -------------------------------------- I have seen no evidence of a schema for junit xml reports, some generate properties, some don't, but I don't believe there is an official xsd or dtd for it. I saw some emails detailing a few attempts at standardizing (a relaxng schema that didn't seem to go anywhere). Primary reason for doing this is to support the extra data generated by testng. Extra information like the annotation attached to a test, or the test data passed to a test are pretty valuable for test result reports. Current maven surefire report plugin only reads the junitreport.xml format. Testng has their own support for generating the junit xml report, via a Listener (testng's primary extension point). The maven implementation of the same thing (to generate reports) is written using a listener that writes out as each test completes, preventing any interesting attachment of data. The testng implementation writes out at the end of processing, allowing devs to attach extra info to a test pretty easily. I did this for selenium screen shots. Wrote the screenshot to a uniquely named file in a "content" folder that sat under the junitreports folder. I then included a image tag in the report. Rather than generating a testng report, or copying the surefire report plugin to support the extra info, it seemed reasonable to have surefire reports simply add extra lines to the report based on any extra info in the junit report, if no one uses it, no harm is done, but I'm pretty sure people will use this mechanism. If this is unreasonable, I'm open to putting in effort to generate a solution that can make it into the report plugin. Rex > Report any extra attributes attached to a test > ---------------------------------------------- > > Key: SUREFIRE-737 > URL: http://jira.codehaus.org/browse/SUREFIRE-737 > Project: Maven Surefire > Issue Type: Improvement > Components: Maven Surefire Report Plugin > Reporter: Rex Hoffman > Priority: Minor > Attachments: extra_attributes_patch.txt > > > So if there are any extra attributes on a junit test result (possible, due to > lack of schema) print them out in the html report. > Useful for adding in links, and image tags. > Umm attached an extra bit of functionality, allows a user to set a name for > the report, useful if you do something like: > ... > <reportPlugins combine.children="append"> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-surefire-report-plugin</artifactId> > <version>2.8.1</version> > <reportSets> > <reportSet> > <id>integration-test-report</id> > <reports> > <report>report-only</report> > </reports> > <configuration> > <name>Surefire (Integration)</name> > <aggregate>true</aggregate> > <detail>true</detail> > > <outputName>integration-test-report</outputName> > > <reportsDirectory>${basedir}/target/failsafe-reports/junitreport</reportsDirectory> > </configuration> > </reportSet> > </reportSets> > </plugin> > <plugin> > <groupId>org.apache.maven.plugins</groupId> > <artifactId>maven-surefire-report-plugin</artifactId> > <version>2.8.1</version> > <reportSets> > <reportSet> > <id>unit-test-report</id> > <reports> > <report>report-only</report> > </reports> > <configuration> > <name>Surefire (Unit)</name> > <detail>true</detail> > > <outputName>unit-test-report</outputName> > > <reportsDirectory>${basedir}/target/surefire-reports/junitreport</reportsDirectory> > </configuration> > </reportSet> > </reportSets> > </plugin> > .... -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira