Skip to content

Commit

Permalink
Consolidated test reports published to pages, close #4
Browse files Browse the repository at this point in the history
  • Loading branch information
javiertuya committed Jul 15, 2024
1 parent 8f5af43 commit 24aa9d2
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,87 @@ jobs:
**/target/site
**/target/surefire-reports
**/target/pit-reports
**/target/out
**/target/*.html
**/target/*.log
test-report:
needs: [test]
#if: ${{ false }} # disable for now
#avoid publishing to Github pages PRs and dependabot branches
if: ${{ always() && github.event_name != 'pull_request' && !contains('/head/refs/dependabot/', github.ref) && !contains('/head/refs/dashgit/combined/', github.ref) }}
runs-on: ubuntu-latest
# Configuration to deploy at github pages
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
# Downloads all artifacts with test report files
- uses: actions/[email protected]
if: always()
with:
path: .
- run: ls -la

# Generates and uploads the html reports and the individual surefire reports for further reference
# Includes the options to add links to Visual Assert diff files
- name: Aggregated junit html report
if: always()
uses: javiertuya/[email protected]
with:
surefire-files: "**/target/surefire-reports/TEST-*.xml"
report-dir: reports
report-title: "Test Report: ALL - Branch: ${{ github.ref_name }} - Run #${{ github.run_number }}"
diff-links-enabled: true
#diff-links-prefix: "target/"
diff-links-reports: "reports/junit-*/**/*.html"
#diff-links-files: "/**/target/*.html"

- name: Copy pit reports
run: cp -r test-report-files-Eval/st-tdg-eval/target/pit-reports reports/pit-reports
- name: Index file to html reports
if: always()
run: |
echo "<html><head><title>Latest Test Reports</title></head><body>" > index.html
echo "<h2>Latest Test Reports - Branch: ${{ github.ref_name }} - Run #${{ github.run_number }}</h2>" >> index.html
echo "<p><a href=\"reports/junit-noframes/junit-noframes.html\">JUnit test report - Single page</a></p>" >> index.html
echo "<p><a href=\"reports/junit-frames/index.html\">JUnit test report - Multiple page with frames</a></p>" >> index.html
echo "<p><a href=\"reports/pit-reports/index.html\">PIT test report</a></p>" >> index.html
echo "</body></html>" >> index.html
ls -la reports
- name: Publish test report files
if: always()
uses: actions/upload-artifact@v4
with:
name: "test-report-ALL"
path: |
index.html
reports
**/target/surefire-reports
**/target/out
**/target/*.html
**/target/*.log
# Deploy to GitHub Pages
# Some files (e.g. junit reports) have 600 permissions.
# As of [email protected], permissions must be set explicitly
# to 0755 (as indicated in warnings produced by v1.0.8)
- name: Fix permissions to actions/[email protected]
if: always()
run: sudo chmod -c -R 0755 reports
- name: Upload artifact
if: always()
uses: actions/[email protected]
with:
path: "."
- name: Deploy to GitHub Pages
if: always()
id: deployment
uses: actions/[email protected]
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[![Status](https://github.com/giis-uniovi/tdrules-st-tdg/actions/workflows/test.yml/badge.svg)](https://github.com/giis-uniovi/tdrules-st-tdg/actions)
[![Test Reports](https://img.shields.io/badge/%20-Test_Reports-orange)](https://giis-uniovi.github.io/tdrules-st-tdg)

# Test Data Generation for APIs - System Tests

This project contains the system and integration tests of *Test Data Generation for APIs* (TDG).
Expand Down

0 comments on commit 24aa9d2

Please sign in to comment.