Skip to content

Commit

Permalink
chore: Upload test results even when test job fails (#2743)
Browse files Browse the repository at this point in the history
The default behavior is to run the steps only if the previous steps
succeed. This PR enables the test report upload when the tests fail.
  • Loading branch information
StaNov authored Dec 3, 2024
1 parent 19a4960 commit 0a977e3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/reportIntermittentTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,26 @@ jobs:

- name: Get report name
id: reportName
if: always()
run: |
reportName=${{ matrix.command }}
echo "reportName=${reportName//\:/_}" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v3
if: always()
with:
name: backend_test_reports_${{ steps.version.outputs.reportName }}
name: backend_test_reports_${{ steps.reportName.outputs.reportName }}
path: |
./**/build/reports/**/*
- name: Test Report
uses: dorny/test-reporter@v1
if: always()
with:
name: Test report for ${{ matrix.command }}
path: "**/build/test-results/**/TEST-*.xml"
reporter: java-junit

e2e:
needs: [ frontend-build, backend-build, e2e-install-deps ]
runs-on: ubuntu-latest
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,22 +130,23 @@ jobs:

- name: Get report name
id: reportName
if: always()
run: |
reportName=${{ matrix.command }}
echo "reportName=${reportName//\:/_}" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v3
if: always()
with:
name: backend_test_reports_${{ steps.version.outputs.reportName }}
name: backend_test_reports_${{ steps.reportName.outputs.reportName }}
path: |
./**/build/reports/**/*
- name: Test Report
uses: dorny/test-reporter@v1
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
if: ${{ always() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
with:
name: Backend Tests
name: Test report for ${{ matrix.command }}
path: "**/build/test-results/**/TEST-*.xml"
reporter: java-junit

Expand Down

0 comments on commit 0a977e3

Please sign in to comment.