Skip to content

Commit 976d8f9

Browse files
committed
dotnet-coverage
1 parent a278723 commit 976d8f9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

azure-pipelines-ci.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
1717
- script: |
1818
dotnet tool install --global dotnet-sonarscanner
19+
dotnet tool install --global dotnet-coverage
1920
dotnet tool install --global coverlet.console
2021
displayName: 'Install dotnet tools'
2122
@@ -32,7 +33,8 @@ jobs:
3233
displayName: 'dotnet dev-certs https'
3334
3435
- script: |
35-
dotnet sonarscanner begin /k:"WireMock-Net_WireMock.Net" /o:"wiremock-net" /d:sonar.branch.name=$(Build.SourceBranchName) /d:sonar.host.url="https://sonarcloud.io" /d:sonar.token="$(SONAR_TOKEN)" /d:sonar.dotnet.excludeTestProjects=true /d:sonar.cs.opencover.reportsPaths=coverage.xml /d:sonar.verbose=true
36+
# dotnet sonarscanner begin /k:"WireMock-Net_WireMock.Net" /o:"wiremock-net" /d:sonar.branch.name=$(Build.SourceBranchName) /d:sonar.host.url="https://sonarcloud.io" /d:sonar.token="$(SONAR_TOKEN)" /d:sonar.dotnet.excludeTestProjects=true /d:sonar.cs.opencover.reportsPaths=coverage.xml /d:sonar.verbose=true
37+
dotnet sonarscanner begin /k:"WireMock-Net_WireMock.Net" /o:"wiremock-net" /d:sonar.branch.name=$(Build.SourceBranchName) /d:sonar.host.url="https://sonarcloud.io" /d:sonar.token="$(SONAR_TOKEN)" /d:sonar.dotnet.excludeTestProjects=true sonar.cs.vscoveragexml.reportsPaths=coverage.xml /d:sonar.verbose=true
3638
displayName: 'Begin analysis on SonarCloud'
3739
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests
3840
@@ -45,8 +47,8 @@ jobs:
4547

4648
- task: CmdLine@2
4749
inputs:
48-
script: |
49-
coverlet ./test/WireMock.Net.Tests/bin/Debug/net8.0/WireMock.Net.Tests.dll --target "dotnet" --targetargs "test --no-build --configuration Debug --framework net8.0" -f=opencover -o="coverage.xml"
50+
script: 'dotnet-coverage collect "dotnet test" ./test/WireMock.Net.Tests/WireMock.Net.Tests.csproj -f xml -o "coverage.xml"'
51+
# script: coverlet ./test/WireMock.Net.Tests/bin/Debug/net8.0/WireMock.Net.Tests.dll --target "dotnet" --targetargs "test --no-build --configuration Debug --framework net8.0" -f=opencover -o="coverage.xml"
5052
# script: 'dotnet test ./test/WireMock.Net.Tests/WireMock.Net.Tests.csproj --no-build --configuration Debug --framework net8.0'
5153
displayName: 'Execute Unit Tests with Coverage'
5254

0 commit comments

Comments
 (0)