File tree Expand file tree Collapse file tree 5 files changed +23
-2
lines changed
Hosting.CommandLine.Tests Expand file tree Collapse file tree 5 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 1313 "commands" : [
1414 " NuGetKeyVaultSignTool"
1515 ]
16+ },
17+ "dotnet-reportgenerator-globaltool" : {
18+ "version" : " 4.4.0" ,
19+ "commands" : [
20+ " reportgenerator"
21+ ]
1622 }
1723 }
1824}
Original file line number Diff line number Diff line change @@ -42,13 +42,18 @@ jobs:
4242 env :
4343 KEYVAULT_CLIENT_SECRET : $(kv-access-token)
4444 - task : PublishTestResults@2
45- displayName : Upload test results
45+ displayName : Publish test results
4646 condition : always()
4747 continueOnError : true
4848 inputs :
4949 testRunTitle : $(vmImage)
5050 testRunner : vstest
5151 testResultsFiles : ' **/*.trx'
52+ - task : PublishCodeCoverageResults@1
53+ displayName : Publish code coverage results
54+ inputs :
55+ codeCoverageTool : cobertura
56+ summaryFileLocation : coverlet/reports/Cobertura.xml
5257 - publish : artifacts/
5358 artifact : Packages
5459 displayName : Publish artifacts
Original file line number Diff line number Diff line change @@ -42,14 +42,14 @@ if (-not (Test-Path variable:\IsCoreCLR)) {
4242$CodeSign = $sign -or ($ci -and -not $isPr -and $IsWindows )
4343
4444if ($CodeSign ) {
45- exec dotnet tool restore
4645 $MSBuildArgs += ' -p:CodeSign=true'
4746}
4847
4948$artifacts = " $PSScriptRoot /artifacts/"
5049
5150Remove-Item - Recurse $artifacts - ErrorAction Ignore
5251
52+ exec dotnet tool restore
5353exec dotnet build -- configuration $Configuration ' -warnaserror:CS1591' @MSBuildArgs
5454exec dotnet pack -- no- restore -- no- build -- configuration $Configuration - o $artifacts @MSBuildArgs
5555exec dotnet build -- configuration $Configuration " $PSScriptRoot /docs/samples/samples.sln"
@@ -63,7 +63,15 @@ if ($env:TF_BUILD) {
6363}
6464
6565exec dotnet test -- no- restore -- no- build -- configuration $Configuration `
66+ -- collect:" XPlat Code Coverage" `
6667 @testArgs `
6768 @MSBuildArgs
6869
70+ if ($ci ) {
71+ exec dotnet tool run reportgenerator `
72+ " -reports:$PSScriptRoot /**/coverage.cobertura.xml" `
73+ " -targetdir:$PSScriptRoot /coverlet/reports" `
74+ " -reporttypes:Cobertura"
75+ }
76+
6977write-host -f magenta ' Done'
Original file line number Diff line number Diff line change 1414 </ItemGroup >
1515
1616 <ItemGroup >
17+ <PackageReference Include =" coverlet.collector" Version =" 1.1.0" />
1718 <PackageReference Include =" Microsoft.Extensions.DependencyInjection" Version =" 3.1.0" />
1819 <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 16.4.0" />
1920 <PackageReference Include =" FluentAssertions" Version =" 5.9.0" />
Original file line number Diff line number Diff line change 1414 </ItemGroup >
1515
1616 <ItemGroup >
17+ <PackageReference Include =" coverlet.collector" Version =" 1.1.0" />
1718 <PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 16.4.0" />
1819 <PackageReference Include =" Moq" Version =" 4.13.1" />
1920 <PackageReference Include =" xunit" Version =" 2.4.1" />
You can’t perform that action at this time.
0 commit comments