diff --git a/.gitignore b/.gitignore
index e372c7b6..52b08106 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,7 @@
syntax: glob
+CoverageReport
+
### VisualStudio ###
*.dgml
*.bin
diff --git a/Packages.props b/Packages.props
index 6eb33c57..265eacb8 100644
--- a/Packages.props
+++ b/Packages.props
@@ -42,5 +42,7 @@
+
+
\ No newline at end of file
diff --git a/azure-pipelines/build.yml b/azure-pipelines/build.yml
index ef415d75..bd4cf04e 100644
--- a/azure-pipelines/build.yml
+++ b/azure-pipelines/build.yml
@@ -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'
diff --git a/test/Microsoft.InsightsGenerator.UnitTests/Microsoft.InsightsGenerator.UnitTests.csproj b/test/Microsoft.InsightsGenerator.UnitTests/Microsoft.InsightsGenerator.UnitTests.csproj
index c434b61f..dc42afed 100644
--- a/test/Microsoft.InsightsGenerator.UnitTests/Microsoft.InsightsGenerator.UnitTests.csproj
+++ b/test/Microsoft.InsightsGenerator.UnitTests/Microsoft.InsightsGenerator.UnitTests.csproj
@@ -17,6 +17,14 @@
+
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+ all
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/test/Microsoft.Kusto.ServiceLayer.UnitTests/Microsoft.Kusto.ServiceLayer.UnitTests.csproj b/test/Microsoft.Kusto.ServiceLayer.UnitTests/Microsoft.Kusto.ServiceLayer.UnitTests.csproj
index b63cc74c..dcfa5551 100644
--- a/test/Microsoft.Kusto.ServiceLayer.UnitTests/Microsoft.Kusto.ServiceLayer.UnitTests.csproj
+++ b/test/Microsoft.Kusto.ServiceLayer.UnitTests/Microsoft.Kusto.ServiceLayer.UnitTests.csproj
@@ -9,10 +9,18 @@
+
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+ all
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
-
+
-
+
\ No newline at end of file
diff --git a/test/Microsoft.SqlTools.ManagedBatchParser.IntegrationTests/Microsoft.SqlTools.ManagedBatchParser.IntegrationTests.csproj b/test/Microsoft.SqlTools.ManagedBatchParser.IntegrationTests/Microsoft.SqlTools.ManagedBatchParser.IntegrationTests.csproj
index 98eaff4e..783deb63 100644
--- a/test/Microsoft.SqlTools.ManagedBatchParser.IntegrationTests/Microsoft.SqlTools.ManagedBatchParser.IntegrationTests.csproj
+++ b/test/Microsoft.SqlTools.ManagedBatchParser.IntegrationTests/Microsoft.SqlTools.ManagedBatchParser.IntegrationTests.csproj
@@ -21,6 +21,10 @@
+
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+ all
+
diff --git a/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/Microsoft.SqlTools.ServiceLayer.IntegrationTests.csproj b/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/Microsoft.SqlTools.ServiceLayer.IntegrationTests.csproj
index 05d461f3..8c395f30 100644
--- a/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/Microsoft.SqlTools.ServiceLayer.IntegrationTests.csproj
+++ b/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/Microsoft.SqlTools.ServiceLayer.IntegrationTests.csproj
@@ -39,6 +39,10 @@
+
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+ all
+
diff --git a/test/Microsoft.SqlTools.ServiceLayer.TestDriver.Tests/Microsoft.SqlTools.ServiceLayer.TestDriver.Tests.csproj b/test/Microsoft.SqlTools.ServiceLayer.TestDriver.Tests/Microsoft.SqlTools.ServiceLayer.TestDriver.Tests.csproj
index f5159ac5..c1217636 100644
--- a/test/Microsoft.SqlTools.ServiceLayer.TestDriver.Tests/Microsoft.SqlTools.ServiceLayer.TestDriver.Tests.csproj
+++ b/test/Microsoft.SqlTools.ServiceLayer.TestDriver.Tests/Microsoft.SqlTools.ServiceLayer.TestDriver.Tests.csproj
@@ -23,6 +23,10 @@
+
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+ all
+
diff --git a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Microsoft.SqlTools.ServiceLayer.UnitTests.csproj b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Microsoft.SqlTools.ServiceLayer.UnitTests.csproj
index 1370ff35..99a5d237 100644
--- a/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Microsoft.SqlTools.ServiceLayer.UnitTests.csproj
+++ b/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Microsoft.SqlTools.ServiceLayer.UnitTests.csproj
@@ -15,6 +15,14 @@
+
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+ all
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+