mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-01-11 21:10:32 +01:00
Add Aspire Extension (#1109)
* WireMock.Net.Aspire * . * xxx * nuget * [CodeFactor] Apply fixes * ut * t * **WireMock.Net.Aspire** * . * t * . * . * . * TESTS * docker utils * Install .NET Aspire workload * 4 * 4! * projects: '**/test/**/*.csproj' * script: 'dotnet workload install aspire' * projects: '**/test/**/*.csproj' * coverage * WithWatchStaticMappings * Admin * typo * port * fix * . * x * ... * wait * readme * x * 2 * async * <Version>0.0.1-preview-03</Version> * ... * fix aspire * admin/pwd * Install .NET Aspire workload * 0.0.1-preview-04 * WaitForHealthAsync * ... * IsHealthyAsync * . * add eps * name: 'Execute Aspire Tests' * name: Install .NET Aspire workload * . * dotnet test * remove duplicate * . * cc * dotnet tool install --global coverlet.console * -* * merge * /d:sonar.pullrequest.provider=github * <Version>0.0.1-preview-05</Version> * // Copyright © WireMock.Net * . --------- Co-authored-by: codefactor-io <support@codefactor.io>
This commit is contained in:
@@ -14,10 +14,14 @@ jobs:
|
||||
echo "BuildId = $(buildId)"
|
||||
displayName: 'Print buildId'
|
||||
|
||||
- task: CmdLine@2
|
||||
displayName: 'Install .NET Aspire workload'
|
||||
inputs:
|
||||
script: 'dotnet workload install aspire'
|
||||
|
||||
- script: |
|
||||
dotnet tool install --global dotnet-sonarscanner
|
||||
dotnet tool install --global dotnet-coverage
|
||||
dotnet tool install --global coverlet.console
|
||||
displayName: 'Install dotnet tools'
|
||||
|
||||
- task: PowerShell@2
|
||||
@@ -31,10 +35,10 @@ jobs:
|
||||
- script: |
|
||||
dotnet dev-certs https --trust || true
|
||||
displayName: 'dotnet dev-certs https'
|
||||
|
||||
# See: https://docs.sonarsource.com/sonarcloud/enriching/test-coverage/dotnet-test-coverage
|
||||
|
||||
# See: https://docs.sonarsource.com/sonarcloud/enriching/test-coverage/dotnet-test-coverage
|
||||
- script: |
|
||||
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.vscoveragexml.reportsPaths=**/wiremock-coverage.xml /d:sonar.verbose=true
|
||||
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.pullrequest.provider=github /d:sonar.dotnet.excludeTestProjects=true /d:sonar.cs.vscoveragexml.reportsPaths=**/wiremock-coverage-*.xml /d:sonar.verbose=true
|
||||
displayName: 'Begin analysis on SonarCloud'
|
||||
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests
|
||||
|
||||
@@ -42,14 +46,21 @@ jobs:
|
||||
displayName: 'Build Unit tests'
|
||||
inputs:
|
||||
command: 'build'
|
||||
projects: './test/WireMock.Net.Tests/WireMock.Net.Tests.csproj'
|
||||
arguments: '--configuration Debug --framework net8.0 --no-incremental'
|
||||
projects: '**/test/**/*.csproj'
|
||||
arguments: '--configuration Debug --framework net8.0'
|
||||
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
script: 'dotnet-coverage collect "dotnet test ./test/WireMock.Net.Tests/WireMock.Net.Tests.csproj --configuration Debug --no-build --framework net8.0" -f xml -o "wiremock-coverage.xml"'
|
||||
script: |
|
||||
dotnet-coverage collect "dotnet test ./test/WireMock.Net.Tests/WireMock.Net.Tests.csproj --configuration Debug --no-build --framework net8.0" -f xml -o "wiremock-coverage-1.xml"
|
||||
dotnet-coverage collect "dotnet test ./test/WireMock.Net.Aspire.Tests/WireMock.Net.Aspire.Tests.csproj --configuration Debug --no-build" -f xml -o "wiremock-coverage-2.xml"
|
||||
displayName: 'Execute Unit Tests with Coverage'
|
||||
|
||||
|
||||
- task: CmdLine@2
|
||||
displayName: 'Merge coverage files'
|
||||
inputs:
|
||||
script: 'dotnet coverage merge **/wiremock-coverage-*.xml --output ./test/wiremock-coverage.xml --output-format xml'
|
||||
|
||||
- script: |
|
||||
dotnet sonarscanner end /d:sonar.token="$(SONAR_TOKEN)"
|
||||
displayName: 'End analysis on SonarCloud'
|
||||
@@ -60,8 +71,8 @@ jobs:
|
||||
condition: and(succeeded(), eq(variables['RUN_WHITESOURCE'], 'yes'))
|
||||
|
||||
- script: |
|
||||
bash <(curl https://codecov.io/bash) -t $(CODECOV_TOKEN) -f ./test/WireMock.Net.Tests/coverage.8.0.opencover.xml
|
||||
displayName: 'codecov'
|
||||
bash <(curl https://codecov.io/bash) -t $(CODECOV_TOKEN) -f ./test/wiremock-coverage.xml
|
||||
displayName: 'Upload coverage results to codecov'
|
||||
|
||||
- task: PublishTestResults@2
|
||||
condition: and(succeeded(), eq(variables['PUBLISH_TESTRESULTS'], 'yes'))
|
||||
@@ -70,7 +81,7 @@ jobs:
|
||||
testResultsFiles: '**/*.trx'
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Publish coverage file
|
||||
displayName: Publish coverage files
|
||||
inputs:
|
||||
PathtoPublish: './test/WireMock.Net.Tests/coverage.net8.0.opencover.xml'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user