Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get surefire reports form Travis-CI build?

Tags:

travis-ci

The question says it all really. How can I download or view the surefire-reports generated during a build on Travis?

like image 671
acorello Avatar asked Oct 30 '13 14:10

acorello


People also ask

How do I create a surefire report using basedir?

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.

What does surefire-257 surefire-report do?

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

How to generate a surefire report using MVN?

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:

What are pull request builds in Travis CI?

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.


2 Answers

You can just do

after_failure:
  - cat target/surefire-reports/*.txt
like image 179
sujithvm Avatar answered Sep 28 '22 02:09

sujithvm


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
like image 42
acorello Avatar answered Sep 28 '22 02:09

acorello