Sync eng/common directory with azure-sdk-tools for PR 10190 (#6505)

* updating eng/common/testproxy/test-proxy-tool.yml and eng/common/testproxy/test-proxy-standalone-tool.yml to output a bunch of information about what they're actually running for their commands
---------

Co-authored-by: Scott Beddall <scbedd@microsoft.com>
Co-authored-by: Scott Beddall <45376673+scbedd@users.noreply.github.com>
Co-authored-by: Patrick Hallisey <hallipr@gmail.com>
This commit is contained in:
Azure SDK Bot 2025-04-03 15:42:12 -07:00 committed by GitHub
parent 292731bd66
commit d374747dcc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 44 additions and 0 deletions

View File

@ -32,37 +32,54 @@ steps:
}
Write-Host "Installing test-proxy version $version"
Write-Host "${{ parameters.templateRoot }}/eng/common/testproxy/install-test-proxy.ps1 -Version $version -InstallDirectory $(Build.BinariesDirectory)/test-proxy"
${{ parameters.templateRoot }}/eng/common/testproxy/install-test-proxy.ps1 -Version $version -InstallDirectory $(Build.BinariesDirectory)/test-proxy
displayName: "Install test-proxy"
condition: and(succeeded(), ${{ parameters.condition }})
- pwsh: |
Write-Host "Prepending path with the test proxy tool install location: '$(Build.BinariesDirectory)/test-proxy'"
Write-Host "##vso[task.prependpath]$(Build.BinariesDirectory)/test-proxy"
displayName: "Prepend path with test-proxy tool install location"
- ${{ if eq(parameters.runProxy, 'true') }}:
- pwsh: |
Write-Host "Setting ASPNETCORE_Kestrel__Certificates__Default__Path to '${{ parameters.templateRoot }}/eng/common/testproxy/dotnet-devcert.pfx'"
Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Path]${{ parameters.templateRoot }}/eng/common/testproxy/dotnet-devcert.pfx"
Write-Host "Setting ASPNETCORE_Kestrel__Certificates__Default__Password to 'password'"
Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Password]password"
Write-Host "Setting PROXY_MANUAL_START to 'true'"
Write-Host "##vso[task.setvariable variable=PROXY_MANUAL_START]true"
displayName: 'Configure Kestrel and PROXY_MANUAL_START Variables'
condition: and(succeeded(), ${{ parameters.condition }})
- pwsh: |
$invocation = @"
Start-Process $(PROXY_EXE)
-ArgumentList `"start -u --storage-location ${{ parameters.rootFolder }}`"
-NoNewWindow -PassThru -RedirectStandardOutput ${{ parameters.rootFolder }}/test-proxy.log
-RedirectStandardError ${{ parameters.rootFolder }}/test-proxy-error.log
"@
Write-Host $invocation
$Process = Start-Process $(PROXY_EXE) `
-ArgumentList "start -u --storage-location ${{ parameters.rootFolder }}" `
-NoNewWindow -PassThru -RedirectStandardOutput ${{ parameters.rootFolder }}/test-proxy.log `
-RedirectStandardError ${{ parameters.rootFolder }}/test-proxy-error.log
Write-Host "Setting PROXY_PID to $($Process.Id)"
Write-Host "##vso[task.setvariable variable=PROXY_PID]$($Process.Id)"
displayName: 'Run the testproxy - windows'
condition: and(succeeded(), eq(variables['Agent.OS'],'Windows_NT'), ${{ parameters.condition }})
# nohup does NOT continue beyond the current session if you use it within powershell
- bash: |
echo "nohup $(PROXY_EXE) 1>${{ parameters.rootFolder }}/test-proxy.log 2>${{ parameters.rootFolder }}/test-proxy-error.log &"
nohup $(PROXY_EXE) 1>${{ parameters.rootFolder }}/test-proxy.log 2>${{ parameters.rootFolder }}/test-proxy-error.log &
echo $! > $(Build.SourcesDirectory)/test-proxy.pid
echo "Setting PROXY_PID to $(cat $(Build.SourcesDirectory)/test-proxy.pid)"
echo "##vso[task.setvariable variable=PROXY_PID]$(cat $(Build.SourcesDirectory)/test-proxy.pid)"
displayName: "Run the testproxy - linux/mac"
condition: and(succeeded(), ne(variables['Agent.OS'],'Windows_NT'), ${{ parameters.condition }})
@ -71,7 +88,9 @@ steps:
- pwsh: |
for ($i = 0; $i -lt 10; $i++) {
try {
Write-Host "Invoke-WebRequest -Uri `"http://localhost:5000/Admin/IsAlive`" | Out-Null"
Invoke-WebRequest -Uri "http://localhost:5000/Admin/IsAlive" | Out-Null
Write-Host "Successfully connected to the test proxy on port 5000."
exit 0
} catch {
Write-Warning "Failed to successfully connect to test proxy. Retrying..."

View File

@ -33,6 +33,14 @@ steps:
Write-Host "Installing test-proxy version $version"
$invocation = @"
dotnet tool install azure.sdk.tools.testproxy `
--tool-path $(Build.BinariesDirectory)/test-proxy `
--add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json `
--version $version
"@
Write-Host $invocation
dotnet tool install azure.sdk.tools.testproxy `
--tool-path $(Build.BinariesDirectory)/test-proxy `
--add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json `
@ -41,23 +49,36 @@ steps:
condition: and(succeeded(), ${{ parameters.condition }})
- pwsh: |
Write-Host "Prepending path with the test proxy tool install location: '$(Build.BinariesDirectory)/test-proxy'"
Write-Host "##vso[task.prependpath]$(Build.BinariesDirectory)/test-proxy"
displayName: "Prepend path with test-proxy tool install location"
- ${{ if eq(parameters.runProxy, 'true') }}:
- pwsh: |
Write-Host "Setting ASPNETCORE_Kestrel__Certificates__Default__Path to '${{ parameters.templateRoot }}/eng/common/testproxy/dotnet-devcert.pfx'"
Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Path]${{ parameters.templateRoot }}/eng/common/testproxy/dotnet-devcert.pfx"
Write-Host "Setting ASPNETCORE_Kestrel__Certificates__Default__Password to 'password'"
Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Password]password"
Write-Host "Setting PROXY_MANUAL_START to 'true'"
Write-Host "##vso[task.setvariable variable=PROXY_MANUAL_START]true"
displayName: 'Configure Kestrel and PROXY_MANUAL_START Variables'
condition: and(succeeded(), ${{ parameters.condition }})
- pwsh: |
$invocation = @"
Start-Process $(Build.BinariesDirectory)/test-proxy/test-proxy.exe
-ArgumentList `"start -u --storage-location ${{ parameters.rootFolder }}`"
-NoNewWindow -PassThru -RedirectStandardOutput ${{ parameters.rootFolder }}/test-proxy.log
-RedirectStandardError ${{ parameters.rootFolder }}/test-proxy-error.log
"@
Write-Host $invocation
$Process = Start-Process $(Build.BinariesDirectory)/test-proxy/test-proxy.exe `
-ArgumentList "start -u --storage-location ${{ parameters.rootFolder }}" `
-NoNewWindow -PassThru -RedirectStandardOutput ${{ parameters.rootFolder }}/test-proxy.log `
-RedirectStandardError ${{ parameters.rootFolder }}/test-proxy-error.log
Write-Host "Setting PROXY_PID to $($Process.Id)"
Write-Host "##vso[task.setvariable variable=PROXY_PID]$($Process.Id)"
displayName: 'Run the testproxy - windows'
condition: and(succeeded(), eq(variables['Agent.OS'],'Windows_NT'), ${{ parameters.condition }})
@ -69,6 +90,8 @@ steps:
nohup $(Build.BinariesDirectory)/test-proxy/test-proxy 1>${{ parameters.rootFolder }}/test-proxy.log 2>${{ parameters.rootFolder }}/test-proxy-error.log &
echo $! > $(Build.SourcesDirectory)/test-proxy.pid
echo "Setting PROXY_PID to $(cat $(Build.SourcesDirectory)/test-proxy.pid)"
echo "##vso[task.setvariable variable=PROXY_PID]$(cat $(Build.SourcesDirectory)/test-proxy.pid)"
displayName: "Run the testproxy - linux/mac"
condition: and(succeeded(), ne(variables['Agent.OS'],'Windows_NT'), ${{ parameters.condition }})
@ -79,7 +102,9 @@ steps:
- pwsh: |
for ($i = 0; $i -lt 10; $i++) {
try {
Write-Host "Invoke-WebRequest -Uri `"http://localhost:5000/Admin/IsAlive`" | Out-Null"
Invoke-WebRequest -Uri "http://localhost:5000/Admin/IsAlive" | Out-Null
Write-Host "Successfully connected to the test proxy on port 5000."
exit 0
} catch {
Write-Warning "Failed to successfully connect to test proxy. Retrying..."