From 0a186acf389dfd3ce1d3c87f554afe024d7587d2 Mon Sep 17 00:00:00 2001 From: Simon Novak Date: Fri, 8 Dec 2023 16:11:58 +0100 Subject: [PATCH 1/2] chore(#39): Revised & Updated test reports' generation and consuming --- .github/workflows/build.yml | 2 +- .github/workflows/sonarcloud.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4dc9a88..1d5a864 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: - name: Build .NET Solution run: dotnet build --configuration Release --no-restore - name: Test .NET Solution - run: dotnet test --configuration Release --no-build --filter=Category=UnitTest --logger "trx;LogFileName=test-results-{framework}.trx" + run: dotnet test --configuration Release --no-build --filter=Category=UnitTest --logger "trx;LogFilePrefix=test-results" - uses: actions/upload-artifact@v2 if: success() || failure() with: diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 4f5e6c6..785bc7b 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -54,7 +54,7 @@ jobs: dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner - name: Build and analyze env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} if: ${{ env.SONAR_TOKEN != null }} shell: powershell @@ -63,7 +63,7 @@ jobs: /k:"escendit_rabbitmq-dotnet-extensions" ` /o:"escendit" ` /v:${{ env.GitVersion_FullSemVer }} ` - /d:sonar.login="${{ secrets.SONAR_TOKEN }}" ` + /d:sonar.token="${{ secrets.SONAR_TOKEN }}" ` /d:sonar.host.url="https://sonarcloud.io" ` /d:sonar.cs.vstest.reportsPaths=**/TestResults/*.trx ` /d:sonar.cs.opencover.reportsPaths=**/TestResults/*/coverage.opencover.xml ` @@ -75,6 +75,6 @@ jobs: --filter=Category=UnitTest ` --collect "XPlat Code Coverage" ` --results-directory TestResults/ ` - --logger "trx;LogFileName=test-results.trx" ` + --logger "trx;LogFilePrefix=test-results" ` -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" From 2a04a24b744812ca71380ac766c8dfe974f5b53d Mon Sep 17 00:00:00 2001 From: Simon Novak Date: Fri, 8 Dec 2023 16:16:39 +0100 Subject: [PATCH 2/2] chore(#39): Fix filename ending --- .github/workflows/test-report.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-report.yml b/.github/workflows/test-report.yml index e3211bb..c430193 100644 --- a/.github/workflows/test-report.yml +++ b/.github/workflows/test-report.yml @@ -11,5 +11,5 @@ jobs: with: artifact: test-results name: dotnet tests - path: '**/test-results-*.trx' + path: '**/test-results*.trx' reporter: dotnet-trx