Closed nreddipalle closed 1 day ago
Hi, are you using coverlet.msbuild package? There is a known issue
I guess this scenario is not supported and coverage results for failed runs are not available.
This is not a coverlet issue and I think this is related to Azure DevOps pipeline and retry failed tests scenario.
I guess there are 2 options:
rerunFailedTests
and always run all testsMergeWith is the proposed solution
This issue is stale because it has been open for 3 months with no activity.
This issue is stale because it has been open for 3 months with no activity.
I am using following command
dotnet test "$(Build.SourcesDirectory)/Tests/ResourcePlanning.Tests/ResourcePlanning.Tests.csproj" --logger "trx;logfilename=resourceplanningtests-testResults$count.trx" --results-directory "$(Agent.TempDirectory)" --configuration Release --no-build --verbosity minimal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=$(Agent.TempDirectory)\TestResults\Coverage\ResourcePlanningTests-TestResults.opencover.xml
On successful run, it generates code coverage fine.. but some tests are flaky and fails sometimes and pass on rerun.. so when rerun codecoverage is reported only for the flaky tests that passed on second run..
so during 1st run of 3000 tests if 2900 pass and 100 fail.. dotnet test command doesn't generate code coverage during rerun of 100 tests when all 100 pass then it generates code coverage but only for 100 tests
How to achieve proper code coverage in this case? Thanks.