Skip to content

Commit 76a1a09

Browse files
authored
Merge pull request #7 from joncloud/coverage
Adds Coverlet Code Coverage
2 parents 8eb1184 + 2ed9616 commit 76a1a09

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

azure-pipelines.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ steps:
4141
inputs:
4242
command: test
4343
projects: '**/https.Tests.csproj'
44+
arguments: '--configuration $(buildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura -- xunit.parallelizeAssembly=true xunit.parallelizeTestCollections=true'
45+
46+
- script: |
47+
dotnet tool install dotnet-reportgenerator-globaltool --tool-path tools
48+
./tools/reportgenerator -reports:$(Build.SourcesDirectory)/tests/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/CodeCoverage -reporttypes:Cobertura
49+
displayName: Code Coverage Report
4450

4551
- task: PublishBuildArtifacts@1
4652
displayName: Upload Artifacts

tests/https.Tests/https.Tests.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99

1010
<ItemGroup>
1111
<FrameworkReference Include="Microsoft.AspNetCore.App" />
12+
<PackageReference Include="coverlet.collector" Version="1.3.0">
13+
<PrivateAssets>all</PrivateAssets>
14+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
15+
</PackageReference>
16+
<PackageReference Include="coverlet.msbuild" Version="2.9.0">
17+
<PrivateAssets>all</PrivateAssets>
18+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19+
</PackageReference>
1220
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.6" />
1321
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
1422
<PackageReference Include="xunit" Version="2.4.1" />

0 commit comments

Comments
 (0)