coverlet icon indicating copy to clipboard operation
coverlet copied to clipboard

[BUG] Threshold includes also not included projects

Open Mateusz19021996 opened this issue 1 year ago • 2 comments

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?

Mateusz19021996 avatar Nov 13 '23 22:11 Mateusz19021996

Hi, please double check the include parameter. This does not support file names see documentation.

Bertk avatar Dec 04 '23 17:12 Bertk

This issue is stale because it has been open for 3 months with no activity.

github-actions[bot] avatar Apr 14 '24 01:04 github-actions[bot]