I have a Azure DevOps build that creates two TRX files for a .NET solution, one unit test for x64 and another for x86. Using the Azure task 5.* I can do the analysis on the project but the analyzer will only ever pick up one of the two TRX files and therefore doesn’t calculate the code coverage correctly. Is it not possible to have multiple TRX files discovered?
A sample run I get two TRX files (logs) as below:
E:\Builds_VNext\Agent1_Builds\142\s\TestResults\DA_NAM_TFS_BUILD_1_S011_2022-04-25_11_29_46.trx
Attachments:
E:\Builds_VNext\Agent1_Builds\142\s\TestResults\2bd9687a-2a04-4c2f-b135-7067f8b9a223\DA_NAM_TFS_BUILD_1_S011_2022-04-25.11_29_37.coverage
E:\Builds_VNext\Agent1_Builds\142\s\TestResults\DA_NAM_TFS_BUILD_1_S011_2022-04-25_11_30_59.trx
Attachments:
E:\Builds_VNext\Agent1_Builds\142\s\TestResults\d9e135bc-a7c9-41cf-a0c5-249e236fc4ac\DA_NAM_TFS_BUILD_1_S011_2022-04-25.11_30_53.coverage
When the analyzer runs it can only ever find the last file written.
Attempting to locate a test results (.trx) file…
Looking for TRX files in: E:\Builds_VNext\Agent1_Builds\142\TestResults, E:\Builds_VNext\Agent1_Builds\142\s\TestResults
The following test results files were found: E:\Builds_VNext\Agent1_Builds\142\s\TestResults\DA_NAM_TFS_BUILD_1_S011_2022-04-25_11_30_59.trx
My scan prepare task has this set:
sonar.visualstudio.enable=true
sonar.dotnet.excludeGeneratedCode=true
sonar.cs.vscoveragexml.reportsPaths="***.coveragexml"