SonarCloud

This commit is contained in:
Stef Heyenrath
2020-11-28 13:00:04 +01:00
parent 3829a5a7f9
commit f0bddf0604
3 changed files with 12 additions and 5 deletions

1
.gitignore vendored
View File

@@ -252,3 +252,4 @@ paket-files/
*.sln.iml
./report/coverlet/
/test/WireMock.Net.Tests/coverage.opencover.xml

View File

@@ -32,15 +32,22 @@ steps:
# - https://github.com/Microsoft/vsts-tasks/issues/8291
#
- script: |
%USERPROFILE%\.dotnet\tools\dotnet-sonarscanner begin /k:"wiremock" /o:"stefh-github" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /v:"$(buildId)" /d:sonar.cs.opencover.reportsPaths="**\coverage.opencover.xml"
%USERPROFILE%\.dotnet\tools\dotnet-sonarscanner begin /k:"wiremock" /o:"stefh-github" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /v:"$(buildId)" /d:sonar.cs.opencover.reportsPaths="./test/WireMock.Net.Tests/coverage.opencover.xml"
displayName: Begin SonarScanner
condition: and(succeeded(), eq(variables['RUN_SONAR'], 'yes'))
# Build source, tests and run tests for net452 and netcoreapp3.1 (with coverage)
- task: DotNetCoreCLI@2
displayName: Build Debug
inputs:
command: 'build'
arguments: /p:Configuration=Debug
projects: $(buildProjects)
# Build tests and run tests for net452 and netcoreapp3.1 (with coverage)
- script: |
dotnet test ./test/WireMock.Net.Tests/WireMock.Net.Tests.csproj --configuration Debug --framework net452
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 source, tests and run tests for net452 and netcoreapp3.1 (with coverage)'
displayName: 'Build tests and run tests for net452 and netcoreapp3.1 (with coverage)'
# End SonarScanner
- script: |

View File

@@ -2,8 +2,7 @@
<PropertyGroup>
<Authors>Stef Heyenrath</Authors>
<!--<TargetFrameworks>net452;netcoreapp2.1</TargetFrameworks>-->
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net452;netcoreapp3.1</TargetFramework>
<DebugType>full</DebugType>
<AssemblyName>WireMock.Net.Tests</AssemblyName>
<PackageId>WireMock.Net.Tests</PackageId>