coverlet
coverlet copied to clipboard
[BUG] Threshold includes also not included projects
Describe the bug In my project I run below command to run test execution with coverage and threshold. I found problem. When I execute my command , while execution in logs I can see that error occures also in projects which are not included. For example :
This is simple structure: my-project.sln tests ---> services.unitTests.csproj ---> domain.unitTests.csproj ---> repository.unitTests.csproj src ---> services.csproj ---> domain.csproj ---> repository.csproj
I run :
dotnet test /p:CollectCoverage=true /p: CoverletOutput:"../Results/Coverage/" /p:MergeWith: "../Results/Coverage/" /p:CoverletOutputFormat:"json,cobertura,opencover" /p:Threshold:80 /p:Include:"[services.csproj]*,[domain.csproj]*"
Expected behavior
Actual behavior Actually final ASCII table with results looks fine, but while execution I can see that table is generated multiple times, and under all there are errors which says that : The total line coverage is below the specified 80 [path to not included project <repository.unitTests.csproj>]
Additional context I don't undestand this behavior's. For first why we check test coverage of test project?.. and secondly I'm trying to handle this exception by regex.. so I cannot have excpetion from not included project.. Any suggestions how to handle it?
Hi, please double check the include
parameter. This does not support file names see documentation.
This issue is stale because it has been open for 3 months with no activity.