From 2171ea676ebd98fce1a2ec1e5ed6056843565761 Mon Sep 17 00:00:00 2001 From: Malcolm Nixon Date: Fri, 28 Aug 2026 01:20:17 -0400 Subject: [PATCH] fix: correct SonarCloud opencover glob pattern for coverlet.MTP output CI's Sonar scan explicitly logged: WARNING: Could not find any coverage report file matching the pattern '**/*.opencover.xml'. coverlet.MTP (the Microsoft.Testing.Platform-native coverage extension used here, since coverlet.collector's VSTest-only integration doesn't run under the MTP 'dotnet test' mode required by xunit.v3 4.0.0) names its output files coverage.opencover..xml, e.g. coverage.opencover.280826051706281.xml - not coverage.opencover.xml. The glob **/*.opencover.xml only matches files whose name literally ends in the two dot-segments "opencover.xml"; the numeric session-id segment coverlet.MTP inserts breaks that match, so sonar.cs.opencover.reportsPaths never found any file and SonarCloud always reported 0% new-code coverage, regardless of actual test coverage. Changed the glob to **/coverage.opencover.*.xml, which matches coverlet.MTP's actual output naming. Verified locally: dotnet test --coverlet --coverlet-output-format opencover (matching CI's exact Test step) produces coverage.opencover..xml files under each test project's results folder; the new glob pattern matches all of them. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 008b2a9..e0be546 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -172,7 +172,7 @@ jobs: /o:"demaconsulting" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" - /d:sonar.cs.opencover.reportsPaths=**/*.opencover.xml + /d:sonar.cs.opencover.reportsPaths=**/coverage.opencover.*.xml /d:sonar.scanner.scanAll=false - name: Build