Add code coverage reporting (#1585)

* Add code coverage

* fix and add publishTestResults

* Use PublishTestResults

* Add coverlet.msbuild

* Generate report

* Update coverage report location

* Add one more
This commit is contained in:
Charles Gagnon
2022-07-18 15:31:47 -07:00
committed by GitHub
parent d636065b85
commit 82118f6431
9 changed files with 55 additions and 4 deletions

View File

@@ -33,7 +33,7 @@ steps:
command: test
projects: test/Microsoft.SqlTools.ServiceLayer.UnitTests
testRunTitle: SqlTools.ServiceLayer.UnitTests
arguments: '--configuration $(buildConfiguration)'
arguments: '--configuration $(buildConfiguration) --collect "XPlat Code Coverage"'
- task: DotNetCoreCLI@2
displayName: 'dotnet test test/Microsoft.Kusto.ServiceLayer.UnitTests'
@@ -41,7 +41,18 @@ steps:
command: test
projects: test/Microsoft.Kusto.ServiceLayer.UnitTests
testRunTitle: Kusto.ServiceLayer.UnitTests
arguments: '--configuration $(buildConfiguration)'
arguments: '--configuration $(buildConfiguration) --collect "XPlat Code Coverage"'
- script: |
dotnet tool install -g dotnet-reportgenerator-globaltool
reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Agent.TempDirectory)/coverlet/reports -reporttypes:"Cobertura"
displayName: Create Code coverage report
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage report'
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: '$(Agent.TempDirectory)/coverlet/reports/Cobertura.xml'
- task: Npm@1
displayName: 'npm install -g gulp-cli'