Failsafe html reports in Jenkins
Answer for the part 1) to generate HTML reports for Failsafe.
Add the following to pom.xml
<reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-report-plugin</artifactId> <version>2.18.1</version> <configuration> <skipSurefireReport>${skipSurefireReport}</skipSurefireReport> <reportsDirectories> <reportsDirectory>${basedir}/target/failsafe-reports</reportsDirectory> </reportsDirectories> </configuration> </plugin> </plugins></reporting><properties> <skipSurefireReport>true</skipSurefireReport></properties>
I am assuming you are using mvn verify to run the integration tests using failsafe-plugin.By default, this generates the (*.txt
& *.xml
) reports in {basedir}/target/failsafe-reports. This should be specified in <reportDirectories>
. You can point to any directory which has TEST-*.xml reports.
And then run the cmd
mvn site
This would generate html reports for the Failsafe run integration tests. By default, The files would be in {basedir}/target/site/failsafe-report.html.This location be changed.