C
C#3y ago
Morridis

How to exclude ef core migrations from coverage statistics? [solved]

I run
dotnet test .\BookStore.sln /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
reportgenerator -reports:"tests\BookStore.IntegrationTests\coverage.cobertura.xml;tests\BookStore.Tests\coverage.cobertura.xml" -targetdir:"coveragereport" -reporttypes:Html
dotnet test .\BookStore.sln /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
reportgenerator -reports:"tests\BookStore.IntegrationTests\coverage.cobertura.xml;tests\BookStore.Tests\coverage.cobertura.xml" -targetdir:"coveragereport" -reporttypes:Html
And migrations folders affects my coverage statistics. From what I understand better to hide them. But
dotnet test .\BookStore.sln /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:ExcludeByFile=\"../BookStore.DataAccess/Migrations/*.cs"
dotnet test .\BookStore.sln /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:ExcludeByFile=\"../BookStore.DataAccess/Migrations/*.cs"
not works.
1 Reply
Morridis
MorridisOP3y ago
Nevermind. This solves the issue.
reportgenerator -reports:"tests\BookStore.IntegrationTests\coverage.cobertura.xml;tests\BookStore.ApplicationServices.Tests\coverage.cobertura.xml" -targetdir:"coveragereport" -reporttypes:"html;Badges" -filefilters:-*BookStore.DataAccess\Migrations*
reportgenerator -reports:"tests\BookStore.IntegrationTests\coverage.cobertura.xml;tests\BookStore.ApplicationServices.Tests\coverage.cobertura.xml" -targetdir:"coveragereport" -reporttypes:"html;Badges" -filefilters:-*BookStore.DataAccess\Migrations*
Want results from more Discord servers?
Add your server