Hello,
We’re using SonarCloudAnalyze in our Azure DevOps CI pipelines. We’re getting very inconsistent results with the code coverage and have linked it to the output names of the trx / coverage files. It appears that the files are created with a name format that has a datetime suffix e.g.
build000GCC_2021-01-28_14_40_48.trx
build000GCC_2021-01-28_14_40_42.trx
etc.
Sometimes we seem to end up with multiple files with the same name except with an extra [1] - presumably because the tests completed at the exact same time:
build000GCC_2021-01-28_14_40_42.trx
build000GCC_2021-01-28_14_40_42.[1].trx
When this happens the following sonar step complains that it cannot find it:
None of the following coverage attachments could be found: build000GCC_2021-01-28_14_40_42.[1].trx
At which point the coverage drops to something like 50% of the regular coverage. When the filename are unique then it shoots back up.
If you look at the timeline of the code coverage it goes up and down daily (presumably because two tests completing at the same time is random).
We’re using:
dotnet test --logger trx --collect "Code coverage"
to generate the file.
Does anyone have any suggestions?