Dónal
Dónal

Reputation: 187499

maven test report format

When I run the tests In my Java/Groovy Maven project, the test reports are stored in target/surefire-reports. For each test class that is run a .txt and .xml file is created showing the output of that class.

All in all, this is a remarkably unhelpful format, as it doesn't provide any easy way to quickly see which tests failed and the output they produced. I'd like something similar to Grails' test reports. Is there are any easy way to change the report format to something more user friendly?

Ideally, I'd like this report to be generated when I run mvn test, i.e. I'd prefer not to have to run mvn site to generate it.

Upvotes: 5

Views: 6212

Answers (3)

Charlee Chitsuk
Charlee Chitsuk

Reputation: 9059

I am using the Maven Surefire Report plugin to generating the unit testing report. The web site is http://maven.apache.org/plugins/maven-surefire-report-plugin

My POM looks like the following: -

<reporting>
    <plugins>
        ....
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <version>2.9</version>
        </plugin>
    </plugins>
 </reporting>

I hope this may help to achieve your requirement.

//Edit: I also use the CI server, the Jenkins, which provides the unit testing report as well.

Regards,

Charlee Ch.

Upvotes: 3

weekens
weekens

Reputation: 8282

There is an HTML report plugin (here), but not sure this is what you want. If you need something more specific, I guess you'll need to develop your own Maven plugin.

Upvotes: 0

Boris Pavlović
Boris Pavlović

Reputation: 64622

Sort the folder by size in ascending order. Biggest .txt files are the output of failed tests.

Upvotes: 0

Related Questions