- ALM used : Azure DevOps
- CI system used : Azure DevOps
- Scanner command used : SonarCloudAnalyze@3
- Languages of the repository : C# / .NET Framework 4.8
- Context : SonarCloudAnalyze is unable to parse the coverage file (coveragexml) in my azure devops pipeline.
The coverage file (.coveragexml) and the unit tests results (.trx file) are correctly discovered, but the it seems sonar is unable to determine the tests files (*.cs) absolute path.
- Error observed :
Looking for TRX files in: D:\a\1\TestResults, D:\a\1\s\TestResults
The following test results files were found: D:\a\1\s\TestResults\VssAdministrator_fv-az619-609_2025-02-11_10_12_20.trx
Absolute path to coverage file: D:\a\1\s\TestResults\VssAdministrator_fv-az619-609_2025-02-11_10_12_20\In\fv-az619-609\VssAdministrator_fv-az619-609_2025-02-11.10_12_22.coverage
The following code coverage attachments were found from the trx files: D:\a\1\s\TestResults\VssAdministrator_fv-az619-609_2025-02-11_10_12_20\In\fv-az619-609\VssAdministrator_fv-az619-609_2025-02-11.10_12_22.coverage
Not using the fallback mechanism to detect binary coverage files.
Converting coverage file 'D:\a\1\s\TestResults\VssAdministrator_fv-az619-609_2025-02-11_10_12_20\In\fv-az619-609\VssAdministrator_fv-az619-609_2025-02-11.10_12_22.coverage' to 'D:\a\1\s\TestResults\VssAdministrator_fv-az619-609_2025-02-11_10_12_20\In\fv-az619-609\VssAdministrator_fv-az619-609_2025-02-11.10_12_22.coveragexml'.
Coverage report conversion completed successfully.
10:13:03.364 DEBUG: Pattern matcher extracted prefix/absolute path 'D:\a\1\s\TestResults\VssAdministrator_fv-az619-609_2025-02-11_10_12_20\In\fv-az619-609\VssAdministrator_fv-az619-609_2025-02-11.10_12_22.coveragexml' from the given pattern 'D:\a\1\s\TestResults\VssAdministrator_fv-az619-609_2025-02-11_10_12_20\In\fv-az619-609\VssAdministrator_fv-az619-609_2025-02-11.10_12_22.coveragexml'.
10:13:03.364 DEBUG: Pattern matcher returns a single file: 'D:\a\1\s\TestResults\VssAdministrator_fv-az619-609_2025-02-11_10_12_20\In\fv-az619-609\VssAdministrator_fv-az619-609_2025-02-11.10_12_22.coveragexml'.
10:13:03.364 DEBUG: The current user dir is 'D:\a\1'.
10:13:03.364 INFO: Parsing the Visual Studio coverage XML report D:\a\1\s\TestResults\VssAdministrator_fv-az619-609_2025-02-11_10_12_20\In\fv-az619-609\VssAdministrator_fv-az619-609_2025-02-11.10_12_22.coveragexml
10:13:03.432 DEBUG: The file 'Facturation.ServiceWindows.Tests\FacturationContextDefinition.cs' does not have a deterministic build path and is either not indexed or does not have a supported language. Will skip this coverage entry. Verify sonar.sources in .sonarqube\out\sonar-project.properties.
10:13:03.433 DEBUG: The file 'Facturation.ServiceWindows.Tests\UnitTestHelper.cs' does not have a deterministic build path and is either not indexed or does not have a supported language. Will skip this coverage entry. Verify sonar.sources in .sonarqube\out\sonar-project.properties.
10:13:03.438 DEBUG: The file 'Facturation.ServiceWindows.Tests\States\ControleStatutsHelperTest.cs' does not have a deterministic build path and is either not indexed or does not have a supported language. Will skip this coverage entry. Verify sonar.sources in .sonarqube\out\sonar-project.properties.
10:13:03.439 DEBUG: The file 'Facturation.ServiceWindows.Tests\helpers\CalculMontantsLigneHelperTest.cs' does not have a deterministic build path and is either not indexed or does not have a supported language. Will skip this coverage entry. Verify sonar.sources in .sonarqube\out\sonar-project.properties.
10:13:03.439 DEBUG: The file 'Facturation.ServiceWindows.Tests\helpers\InformationComptableTest.cs' does not have a deterministic build path and is either not indexed or does not have a supported language. Will skip this coverage entry. Verify sonar.sources in .sonarqube\out\sonar-project.properties.
10:13:03.439 DEBUG: The file 'Facturation.ServiceWindows.Tests\Fonctions\Revision\RevisionMensuelTests.cs' does not have a deterministic build path and is either not indexed or does not have a supported language. Will skip this coverage entry. Verify sonar.sources in .sonarqube\out\sonar-project.properties.
...
10:13:03.820 DEBUG: The file '/_/src/Moq/Async/Awaitable.cs' is not indexed or does not have the supported language. Will skip this coverage entry. Verify sonar.sources in .sonarqube\out\sonar-project.properties.
10:13:03.823 DEBUG: The file '/_/src/Moq/Async/AwaitableFactory.cs' is not indexed or does not have the supported language. Will skip this coverage entry. Verify sonar.sources in .sonarqube\out\sonar-project.properties.
10:13:03.825 DEBUG: The file '/_/src/Moq/Async/AwaitableFactory`1.cs' is not indexed or does not have the supported language. Will skip this coverage entry. Verify sonar.sources in .sonarqube\out\sonar-project.properties.
10:13:03.828 DEBUG: The file '/_/src/Moq/Async/AwaitableFactory`2.cs' is not indexed or does not have the supported language. Will skip this coverage entry. Verify sonar.sources in .sonarqube\out\sonar-project.properties.
10:13:03.830 DEBUG: The file '/_/src/Moq/Async/AwaitExpression.cs' is not indexed or does not have the supported language. Will skip this coverage entry. Verify sonar.sources in .sonarqube\out\sonar-project.properties.
10:13:03.833 DEBUG: The file '/_/src/Moq/Async/TaskFactory.cs' is not indexed or does not have the supported language. Will skip this coverage entry. Verify sonar.sources in .sonarqube\out\sonar-project.properties.
10:13:03.835 DEBUG: The file '/_/src/Moq/Async/TaskFactory`1.cs' is not indexed or does not have the supported language. Will skip this coverage entry. Verify sonar.sources in .sonarqube\out\sonar-project.properties.
10:13:03.838 DEBUG: The file '/_/src/Moq/Async/ValueTaskFactory.cs' is not indexed or does not have the supported language. Will skip this coverage entry. Verify sonar.sources in .sonarqube\out\sonar-project.properties.
10:13:03.840 DEBUG: The file '/_/src/Moq/Async/ValueTaskFactory`1.cs' is not indexed or does not have the supported language. Will skip this coverage entry. Verify sonar.sources in .sonarqube\out\sonar-project.properties.
10:13:03.850 DEBUG: The file 'D:\a\1\s\src\Facturation.Common.Infrastucture\FacturationContext.cs' does not have a deterministic build path and is either not indexed or does not have a supported language. Will skip this coverage entry. Verify sonar.sources in .sonarqube\out\sonar-project.properties.
10:13:03.851 DEBUG: The file 'D:\a\1\s\src\Facturation.Common.Infrastucture\FacturationContext.StoredProcedures.cs' does not have a deterministic build path and is either not indexed or does not have a supported language. Will skip this coverage entry. Verify sonar.sources in .sonarqube\out\sonar-project.properties.
10:13:03.851 DEBUG: The file 'D:\a\1\s\src\Facturation.Common.Infrastucture\Resilience\ResiliencePipelineProvider.cs' does not have a deterministic build path and is either not indexed or does not have a supported language. Will skip this coverage entry. Verify sonar.sources in .sonarqube\out\sonar-project.properties.
10:13:03.852 DEBUG: The file 'D:\a\1\s\src\Facturation.Common.Infrastucture\Extensions\SqlParameterExtensions.cs' does not have a deterministic build path and is either not indexed or does not have a supported language. Will skip this coverage entry. Verify sonar.sources in .sonarqube\out\sonar-project.properties.
10:13:03.852 DEBUG: The file 'D:\a\1\s\src\Facturation.Common.Infrastucture\EntitiesConfiguration\BudgetIndicesProjetesEntityConfiguration.cs' does not have a deterministic build path and is either not indexed or does not have a supported language. Will skip this coverage entry. Verify sonar.sources in .sonarqube\out\sonar-project.properties.
etc
...
10:13:03.936 INFO: Adding this code coverage report to the cache for later reuse: D:\a\1\s\TestResults\VssAdministrator_fv-az619-609_2025-02-11_10_12_20\In\fv-az619-609\VssAdministrator_fv-az619-609_2025-02-11.10_12_22.coveragexml
10:13:03.936 DEBUG: Analyzing coverage after aggregate found '0' coverage files.
10:13:03.936 DEBUG: The total number of file count statistics is '0'.
10:13:03.937 INFO: Sensor C# Tests Coverage Report Import [csharpenterprise] (done) | time=575ms
10:13:03.938 INFO: Sensor C# Unit Test Results Import [csharpenterprise]
10:13:03.939 DEBUG: Pattern matcher extracted prefix/absolute path 'D:\a\1\s\TestResults\VssAdministrator_fv-az619-609_2025-02-11_10_12_20.trx' from the given pattern 'D:\a\1\s\TestResults\VssAdministrator_fv-az619-609_2025-02-11_10_12_20.trx'.
10:13:03.939 DEBUG: Pattern matcher returns a single file: 'D:\a\1\s\TestResults\VssAdministrator_fv-az619-609_2025-02-11_10_12_20.trx'.
10:13:03.939 INFO: Parsing the Visual Studio Test Results file 'D:\a\1\s\TestResults\VssAdministrator_fv-az619-609_2025-02-11_10_12_20.trx'.
10:13:03.943 DEBUG: Parsed Visual Studio Unit Test - testId: 77df6ef5-3186-91dc-585a-b9c518def00a outcome: Passed, duration: 219
10:13:03.944 DEBUG: Parsed Visual Studio Unit Test - testId: 77773f8e-a201-ba82-21aa-bb7f81c99f05 outcome: Passed, duration: 0
10:13:03.944 DEBUG: Parsed Visual Studio Unit Test - testId: 4d6a5944-3895-23cf-81d1-1c0cf9d7d820 outcome: Passed, duration: 0
10:13:03.945 DEBUG: Parsed Visual Studio Unit Test - testId: a9e997e5-27df-190b-50ce-4b5f99d959fb outcome: Passed, duration: 0
10:13:03.947 DEBUG: Parsed Visual Studio Unit Test - testId: fd40d99f-ecb6-984f-97bd-dde7c2a3117b outcome: Passed, duration: 16
10:13:03.947 DEBUG: Parsed Visual Studio Unit Test - testId: d6067139-eeb8-d151-c2e6-a92621fb1872 outcome: Passed, duration: 1251
10:13:03.948 DEBUG: Parsed Visual Studio Unit Test - testId: fd861b2b-d2be-4d62-732c-1233e12f43c5 outcome: Passed, duration: 0
10:13:03.948 DEBUG: Parsed Visual Studio Unit Test - testId: 4ea9224b-abb9-8cd2-83c4-5c3f1ca2a621 outcome: Passed, duration: 0
10:13:03.955 DEBUG: Parsed Visual Studio Unit Test - testId: a99f982b-287e-3cf8-0247-b10a9c5de8cc outcome: Passed, duration: 250
10:13:03.956 DEBUG: Parsed Visual Studio Unit Test - testId: d939a924-33f9-dd3e-04e5-000799175f1e outcome: Passed, duration: 16
10:13:03.956 DEBUG: Parsed Visual Studio Unit Test - testId: c9b23956-673f-6a6c-c42b-5228ef557cd9 outcome: Passed, duration: 0
10:13:03.958 DEBUG: Parsed Visual Studio Unit Test - testId: 56b723ec-3a82-0603-64c7-e86dfd95c6dc outcome: Passed, duration: 250
10:13:03.958 DEBUG: Parsed Visual Studio Unit Test - testId: 36175781-f417-4e49-b8b0-bae05b554952 outcome: Passed, duration: 47
10:13:03.958 DEBUG: Parsed Visual Studio Unit Test - testId: fcae27c3-cf08-650b-7c00-2a451d69556e outcome: Passed, duration: 0
10:13:03.959 DEBUG: Test method Facturation.ServiceWindows.Tests.Facturation.ServiceWindows.Tests.helpers.CalculMontantsLigneHelperTest.Should_CalculateSingleLineBasicScenario cannot be mapped to the test source file. The test will not be included.
10:13:03.959 DEBUG: Test method Facturation.ServiceWindows.Tests.Facturation.ServiceWindows.Tests.Fonctions.Revision.RevisionMensuelTests.GetCurrentTexteFormuleToEdit_ThrowsException cannot be mapped to the test source file. The test will not be included.
10:13:03.959 DEBUG: Test method Facturation.ServiceWindows.Tests.Facturation.ServiceWindows.Tests.States.ControleStatutsHelperTest.ControlStatutsHelper_ShouldThrowArgumentNullException_WhenStatedataIsnull cannot be mapped to the test source file. The test will not be included.
10:13:03.960 DEBUG: Test method Facturation.ServiceWindows.Tests.Facturation.ServiceWindows.Tests.helpers.InformationComptableTest.PlusProcheReleve_ShouldReturnReleveWithHigherNumber_WhenSimilarDate cannot be mapped to the test source file. The test will not be included.
10:13:03.960 DEBUG: Test method Facturation.ServiceWindows.Tests.Facturation.ServiceWindows.Tests.Fonctions.Revision.RevisionMensuelTests.GetRegexIndicesBaseToEdit_ReturnsCorrectRegExp cannot be mapped to the test source file. The test will not be included.
- Steps to reproduce
pipeline-sonarcloudanalyze.log (500.8 KB)
build-on-merge-scan.yml.txt (1.8 KB)
Facturation.ServiceWindows.Tests.csproj.txt (1.2 KB)
*Working tree
- Potential workaround
No workaround. I’ve tried 100 different setup to make it work (including using dotnet-coverage tool instead of VSTest), no success at all.