From 8659b352a3c38617394250a87d5697008fdaf622 Mon Sep 17 00:00:00 2001 From: Stef Heyenrath Date: Sat, 28 Nov 2020 18:48:54 +0100 Subject: [PATCH] VSTest@2 --- azure-pipelines-ci.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/azure-pipelines-ci.yml b/azure-pipelines-ci.yml index 6dbe7f67..dee23771 100644 --- a/azure-pipelines-ci.yml +++ b/azure-pipelines-ci.yml @@ -12,11 +12,18 @@ steps: echo "BuildId = $(buildId)" displayName: 'Print buildId' -# Install Tools (SonarScanner) +# Install Tools - script: | dotnet tool install --global dotnet-sonarscanner displayName: Install Tools (SonarScanner) +- task: DotNetCoreCLI@2 + displayName: "Install tool: dotnet-coverageconverter" + inputs: + command: 'custom' + custom: 'tool' + arguments: 'update --global dotnet-coverageconverter' + - task: PowerShell@2 displayName: "Use JDK11 by default" inputs: @@ -57,6 +64,22 @@ steps: arguments: '--configuration Debug --framework netcoreapp3.1 --logger trx /p:CollectCoverage=true /p:CoverletOutputFormat=opencover' condition: and(succeeded(), eq(variables['RUN_SONARCLOUD'], 'yes')) +- task: VSTest@2 + displayName: 'VsTest' + inputs: + testSelector: 'testAssemblies' + vsTestVersion: 16.0 + diagnosticsEnabled: true + codeCoverageEnabled: true + testAssemblyVer2: | + **\*tests.dll + !**\obj\** + +- task: CmdLine@2 + displayName: 'Convert .coverage to .coveragexml' + inputs: + script: 'dotnet-coverageconverter --CoverageFilesFolder "$(Agent.TempDirectory)\TestResults"' + - script: | dotnet test ./test/WireMock.Net.Tests/WireMock.Net.Tests.csproj --configuration Debug --framework netcoreapp3.1 --logger trx /p:CollectCoverage=true /p:CoverletOutputFormat=opencover displayName: 'Build tests and run tests for netcoreapp3.1 (with coverage)'