From 37f801927273b07a32120fef9db9ff55b78e5f7c Mon Sep 17 00:00:00 2001 From: StaNov Date: Tue, 3 Dec 2024 12:44:55 +0100 Subject: [PATCH] chore: Upload test results even when test job fails 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. --- .github/workflows/reportIntermittentTests.yml | 11 ++++++++++- .github/workflows/test.yml | 7 ++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/reportIntermittentTests.yml b/.github/workflows/reportIntermittentTests.yml index f99852877f..2665a4b2b1 100644 --- a/.github/workflows/reportIntermittentTests.yml +++ b/.github/workflows/reportIntermittentTests.yml @@ -121,6 +121,7 @@ jobs: - name: Get report name id: reportName + if: always() run: | reportName=${{ matrix.command }} echo "reportName=${reportName//\:/_}" >> $GITHUB_OUTPUT @@ -128,10 +129,18 @@ jobs: - 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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e35a43cdcd..2c7b42b283 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -130,6 +130,7 @@ jobs: - name: Get report name id: reportName + if: always() run: | reportName=${{ matrix.command }} echo "reportName=${reportName//\:/_}" >> $GITHUB_OUTPUT @@ -137,15 +138,15 @@ jobs: - 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