mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-03-25 19:02:24 +01:00
* Version 2.x * Setup .NET 9 * 12 * cleanup some #if for NETSTANDARD1_3 * cleanup + fix tests for net8 * openapi * NO ConfigureAwait(false) + cleanup * . * #endif * HashSet * WireMock.Net.NUnit * HttpContext * Add WebSockets (#1423) * Add WebSockets * Add tests * fix * more tests * Add tests * ... * remove IOwin * - * tests * fluent * ok * match * . * byte[] * x * func * func * byte * trans * ... * frameworks......... * jmes * xxx * sc * using var httpClient = new HttpClient(); * usings * maxRetries * up * xunit v3 * ct * --- * ct * ct2 * T Unit * WireMock.Net.TUnitTests / 10 * t unit first * --project * no tunit * t2 * --project * --project * ci - --project * publish ./test/wiremock-coverage.xml * windows * . * log * ... * log * goed * BodyType * . * . * --scenario * ... * pact * ct * . * WireMock.Net.RestClient.AwesomeAssertions (#1427) * WireMock.Net.RestClient.AwesomeAssertions * ok * atpath * fix test * sonar fixes * ports * proxy test * FIX? * --- * await Task.Delay(100, _ct); * ? * --project * Aspire: use IDistributedApplicationEventingSubscriber (#1428) * broadcast * ok * more tsts * . * Collection * up * . * 2 * remove nfluent * <VersionPrefix>2.0.0-preview-02</VersionPrefix> * ... * . * nuget icon * . * <PackageReference Include="JmesPath.Net" Version="1.1.0" /> * x * 500 * . * fix some warnings * ws
179 lines
6.6 KiB
YAML
179 lines
6.6 KiB
YAML
variables:
|
|
Prerelease: 'ci'
|
|
buildId: "1$(Build.BuildId)"
|
|
buildProjects: '**/src/**/*.csproj'
|
|
|
|
jobs:
|
|
- job: Linux_Build_Test_SonarCloud
|
|
|
|
pool:
|
|
vmImage: 'ubuntu-22.04'
|
|
|
|
steps:
|
|
- script: |
|
|
echo "BuildId = $(buildId)"
|
|
displayName: 'Print buildId'
|
|
|
|
- script: |
|
|
dotnet tool install --global dotnet-sonarscanner
|
|
dotnet tool install --global dotnet-coverage
|
|
displayName: 'Install dotnet tools'
|
|
|
|
- task: PowerShell@2
|
|
displayName: "Use JDK17 by default"
|
|
inputs:
|
|
targetType: 'inline'
|
|
script: |
|
|
$jdkPath = $env:JAVA_HOME_17_X64
|
|
Write-Host "##vso[task.setvariable variable=JAVA_HOME]$jdkPath"
|
|
|
|
- script: |
|
|
dotnet dev-certs https --trust || true
|
|
displayName: 'dotnet dev-certs https'
|
|
|
|
# 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.pullrequest.provider=github /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
|
|
|
|
- task: DotNetCoreCLI@2
|
|
displayName: 'Build Unit tests'
|
|
inputs:
|
|
command: 'build'
|
|
projects: '**/test/**/*.csproj'
|
|
arguments: '--configuration Debug --framework net8.0'
|
|
|
|
- task: CmdLine@2
|
|
inputs:
|
|
script: |
|
|
dotnet-coverage collect "dotnet test --project ./test/WireMock.Net.Tests/WireMock.Net.Tests.csproj --configuration Debug --no-build --framework net8.0" -f xml -o "wiremock-coverage-xunit.xml"
|
|
displayName: 'WireMock.Net.Tests with Coverage'
|
|
|
|
- task: CmdLine@2
|
|
inputs:
|
|
script: |
|
|
dotnet-coverage collect "dotnet test --project ./test/WireMock.Net.TUnitTests/WireMock.Net.TUnitTests.csproj --configuration Debug --no-build" -f xml -o "wiremock-coverage-tunit.xml"
|
|
displayName: 'WireMock.Net.TUnitTests with Coverage'
|
|
|
|
- task: CmdLine@2
|
|
inputs:
|
|
script: |
|
|
dotnet-coverage collect "dotnet test --project ./test/WireMock.Net.Middleware.Tests/WireMock.Net.Middleware.Tests.csproj --configuration Debug --no-build" -f xml -o "wiremock-coverage-middleware.xml"
|
|
displayName: 'WireMock.Net.Middleware.Tests with Coverage'
|
|
|
|
- task: CmdLine@2
|
|
inputs:
|
|
script: |
|
|
dotnet-coverage collect "dotnet test --project ./test/WireMock.Net.Aspire.Tests/WireMock.Net.Aspire.Tests.csproj --configuration Debug --no-build" -f xml -o "wiremock-coverage-aspire.xml"
|
|
displayName: 'WireMock.Net.Aspire.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'
|
|
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests
|
|
|
|
- task: whitesource.ws-bolt.bolt.wss.WhiteSource Bolt@19
|
|
displayName: 'WhiteSource Bolt'
|
|
condition: and(succeeded(), eq(variables['RUN_WHITESOURCE'], 'yes'))
|
|
|
|
- script: |
|
|
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'))
|
|
inputs:
|
|
testRunner: VSTest
|
|
testResultsFiles: '**/*.trx'
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
displayName: Publish coverage files
|
|
inputs:
|
|
PathtoPublish: './test/wiremock-coverage.xml'
|
|
|
|
- job: Windows_Build_Test
|
|
|
|
pool:
|
|
vmImage: 'windows-2025'
|
|
|
|
steps:
|
|
- task: UseDotNet@2
|
|
displayName: Use .NET 8.0
|
|
inputs:
|
|
packageType: 'sdk'
|
|
version: '8.0.x'
|
|
|
|
- task: CmdLine@2
|
|
displayName: 'WireMock.Net.Tests.UsingNuGet'
|
|
inputs:
|
|
script: 'dotnet test ./test/WireMock.Net.Tests.UsingNuGet/WireMock.Net.Tests.UsingNuGet.csproj --configuration Release'
|
|
|
|
- task: CmdLine@2
|
|
displayName: 'WireMock.Net.Tests with Coverage'
|
|
inputs:
|
|
script: 'dotnet test ./test/WireMock.Net.Tests/WireMock.Net.Tests.csproj --configuration Debug --framework net8.0 --collect:"XPlat Code Coverage" --logger trx'
|
|
|
|
# - task: CmdLine@2
|
|
# displayName: 'WireMock.Net.TUnitTests with Coverage'
|
|
# inputs:
|
|
# script: 'dotnet test --project ./test/WireMock.Net.TUnitTests/WireMock.Net.TUnitTests.csproj --configuration Debug --framework net8.0 --collect:"XPlat Code Coverage" --logger trx'
|
|
|
|
- task: CmdLine@2
|
|
displayName: 'WireMock.Net.Middleware.Tests with Coverage'
|
|
inputs:
|
|
script: 'dotnet test ./test/WireMock.Net.Middleware.Tests/WireMock.Net.Middleware.Tests.csproj --configuration Debug --framework net8.0 --collect:"XPlat Code Coverage" --logger trx'
|
|
|
|
- job: Windows_Release_to_MyGet
|
|
dependsOn: Windows_Build_Test
|
|
|
|
pool:
|
|
vmImage: 'windows-2025'
|
|
|
|
steps:
|
|
- script: |
|
|
echo "BuildId = $(buildId)"
|
|
displayName: 'Print buildId'
|
|
|
|
- task: UseDotNet@2
|
|
displayName: Use .NET 8.0
|
|
inputs:
|
|
packageType: 'sdk'
|
|
version: '8.0.x'
|
|
|
|
- task: DotNetCoreCLI@2
|
|
displayName: Build Release
|
|
inputs:
|
|
command: 'build'
|
|
arguments: /p:Configuration=Release
|
|
projects: $(buildProjects)
|
|
|
|
- task: DotNetCoreCLI@2
|
|
displayName: Pack
|
|
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests
|
|
inputs:
|
|
command: pack
|
|
configuration: 'Release'
|
|
packagesToPack: $(buildProjects)
|
|
nobuild: true
|
|
packDirectory: '$(Build.ArtifactStagingDirectory)/packages'
|
|
verbosityPack: 'normal'
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
displayName: Publish Artifacts
|
|
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests
|
|
inputs:
|
|
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
|
|
|
- task: DotNetCoreCLI@2
|
|
displayName: Push to MyGet
|
|
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests
|
|
inputs:
|
|
command: custom
|
|
custom: nuget
|
|
arguments: push $(Build.ArtifactStagingDirectory)\packages\*.nupkg -n -s https://www.myget.org/F/wiremock-net/api/v3/index.json -k $(MyGetKey) |