aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CI/build-pipeline.yml13
-rw-r--r--Timeline.Tests/Timeline.Tests.csproj4
2 files changed, 16 insertions, 1 deletions
diff --git a/CI/build-pipeline.yml b/CI/build-pipeline.yml
index c515f181..2c15e301 100644
--- a/CI/build-pipeline.yml
+++ b/CI/build-pipeline.yml
@@ -9,12 +9,17 @@ pool:
vmImage: 'Ubuntu-16.04'
steps:
+- task: UseDotNet@2
+ inputs:
+ packageType: sdk
+ version: 2.2.x
+
- script: |
dotnet restore Timeline/Timeline.csproj --configfile nuget.config
dotnet restore Timeline.Tests/Timeline.Tests.csproj --configfile nuget.config
displayName: Dotnet Restore
-- script: dotnet test Timeline.Tests/Timeline.Tests.csproj --configuration $(buildConfiguration) --no-restore --logger trx
+- script: dotnet test Timeline.Tests/Timeline.Tests.csproj --configuration $(buildConfiguration) --no-restore --logger trx --collect:"XPlat Code Coverage"
displayName: Dotnet Test
- task: PublishTestResults@2
@@ -22,3 +27,9 @@ steps:
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'
+
+- task: PublishCodeCoverageResults@1
+ condition: succeededOrFailed()
+ inputs:
+ codeCoverageTool: 'Cobertura'
+ summaryFileLocation: '**/TestResults/*/coverage.cobertura.xml'
diff --git a/Timeline.Tests/Timeline.Tests.csproj b/Timeline.Tests/Timeline.Tests.csproj
index 1a5f2850..854c63ac 100644
--- a/Timeline.Tests/Timeline.Tests.csproj
+++ b/Timeline.Tests/Timeline.Tests.csproj
@@ -5,6 +5,10 @@
</PropertyGroup>
<ItemGroup>
+ <PackageReference Include="coverlet.collector" Version="1.0.1">
+ <PrivateAssets>all</PrivateAssets>
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+ </PackageReference>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="2.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />