From 86e9d577c22c55892f848130b6a448eb5ab31ece Mon Sep 17 00:00:00 2001 From: 杨宇千 Date: Mon, 5 Aug 2019 00:40:05 +0800 Subject: Add code coverage. --- CI/build-pipeline.yml | 8 +++++++- Timeline.Tests/Timeline.Tests.csproj | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CI/build-pipeline.yml b/CI/build-pipeline.yml index c515f181..64a851f0 100644 --- a/CI/build-pipeline.yml +++ b/CI/build-pipeline.yml @@ -14,7 +14,7 @@ steps: 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 +22,9 @@ steps: inputs: testRunner: VSTest testResultsFiles: '**/*.trx' + +- task: PublishCodeCoverageResults@1 + condition: succeededOrFailed() + inputs: + codeCoverageTool: 'Cobertura' + summaryFileLocation: '**/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 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + -- cgit v1.2.3