Skip to content

Commit

Permalink
Add code coverage (#919)
Browse files Browse the repository at this point in the history
Add coverlet.msbuild to collect code coverage from the tests.
  • Loading branch information
martincostello committed Feb 13, 2022
1 parent 9d7d8bc commit 3cbef2b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,5 @@ tools

*.lock.json
*.nuget.targets
*.nuget.props
*.nuget.props
coverage.*.json
8 changes: 8 additions & 0 deletions src/Polly.Specs/Polly.Specs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="3.1.2" PrivateAssets="all" />
<PackageReference Include="FluentAssertions" Version="6.5.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Moq" Version="4.16.1" />
Expand All @@ -23,4 +24,11 @@
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)'!='net461' and '$(TargetFramework)'!='net472'">
<CollectCoverage>true</CollectCoverage>
<Exclude>[xunit.*]*</Exclude>
<ExcludeByAttribute>System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute</ExcludeByAttribute>
<Threshold>75,60,70</Threshold>
</PropertyGroup>

</Project>

0 comments on commit 3cbef2b

Please sign in to comment.