The question says it all really. How can I download or view the surefire-reports generated during a build on Travis?
Set the reports and outputFolder configuration properties to $ {basedir}/target/surefire-reports to let the Surefire plugin locate them. To create a Surefire report, add the site argument to the command you use to start the test. For example: The generated reports are saved in the <project-folder>/target/site folder.
surefire-report:report Generates the test results report into HTML format. surefire-report:report-only This goal does not run the tests, it only builds the reports. It is provided as a work around for SUREFIRE-257 surefire-report:failsafe-report-only This goal does not run the tests, it only builds the IT reports. See SUREFIRE-257
To generate the Surefire report as part of the site generation, add the following in the <reporting> section of your POM: ... ... When mvn site is invoked, the report will automatically be included in the Project Reports menu as shown in the figure below. The plugin can also generate the report using its standalone goal:
Pull request builds are an essential part of Travis CI. Whenever a pull request is opened on GitHub, Travis CI builds it and updates the status icon on the pull request page. You can identify if a pull request was built while it was considered draft by the contributor by looking at the DRAFT tag in the web UI.
You can just do
after_failure:
- cat target/surefire-reports/*.txt
Having not found a direct way to access the surefire-report files I came up with the this workaround:
In .travis.yml
I added an after_failure
hook:
after_failure: print_surefire_reports.sh
In the hook print_surefire_reports.sh
I put:
#!/usr/bin/env sh
echo "Current directory is $(pwd)"
echo "\n=== SUREFIRE REPORTS ===\n"
for F in target/surefire-reports/*.txt
do
echo $F
cat $F
echo
done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With