Fix post-build test reporting and report summary

This commit is contained in:
Mark McDowall 2024-01-12 19:20:00 -08:00 committed by Mark McDowall
parent d322619733
commit 91f33c670e
2 changed files with 22 additions and 14 deletions

View File

@ -77,22 +77,20 @@ runs:
- name: Run tests - name: Run tests
shell: bash shell: bash
run: dotnet test ./_tests/Sonarr.*.Test.dll --filter "${{ inputs.filter }}" --logger trx --results-directory "${{ env.RESULTS_NAME }}" run: dotnet test ./_tests/Sonarr.*.Test.dll --filter "${{ inputs.filter }}" --logger "trx;LogFileName=${{ env.RESULTS_NAME }}.trx"
- name: Upload Test Results - name: Upload Test Results
if: ${{ !cancelled() }} if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: results-${{ env.RESULTS_NAME }} name: results-${{ env.RESULTS_NAME }}
path: ${{ env.RESULTS_NAME }}/*.trx path: TestResults/*.trx
- name: Publish Test Results - name: Publish Test Results
if: ${{ !cancelled() }} uses: phoenix-actions/test-reporting@v12
uses: EnricoMi/publish-unit-test-result-action/composite@v2
with: with:
check_run: false name: Test Results
check_run_annotations: none output-to: step-summary
comment_mode: off path: '*.trx'
comment_title: ${{ env.RESULTS_NAME }} Test Results reporter: dotnet-trx
large_files: true working-directory: TestResults
files: ${{ env.RESULTS_NAME }}/*.trx

View File

@ -13,19 +13,29 @@ permissions:
jobs: jobs:
report: report:
if: github.event.workflow_run.conclusion != 'skipped' if: ${{ github.event.workflow_run.conclusion != 'skipped' && github.event.workflow_run.conclusion != 'cancelled' }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out
uses: actions/checkout@v3
- name: Download Test Reports - name: Download Test Reports
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
name: results-*
path: test-results path: test-results
pattern: results-*
merge-multiple: true merge-multiple: true
repository: ${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Test Results - name: Publish Test Results
uses: phoenix-actions/test-reporting@v12 uses: phoenix-actions/test-reporting@v12
with: with:
name: 'Test Results' list-suites: failed
path: 'test-results/*.trx' list-tests: failed
name: Test Results
only-summary: true
path: '*.trx'
reporter: dotnet-trx reporter: dotnet-trx
working-directory: test-results