How to get surefire reports form Travis-CI build?

前端 未结 4 802
一个人的身影
一个人的身影 2021-01-12 21:40

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

4条回答
  •  执笔经年
    2021-01-12 22:01

    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
    

提交回复
热议问题