@@ -33,6 +33,14 @@ steps:
3333
3434 Write-Host "Installing test-proxy version $version"
3535
36+ $invocation = @"
37+ dotnet tool install azure.sdk.tools.testproxy `
38+ --tool-path $(Build.BinariesDirectory)/test-proxy `
39+ --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json `
40+ --version $version
41+ "@
42+ Write-Host $invocation
43+
3644 dotnet tool install azure.sdk.tools.testproxy `
3745 --tool-path $(Build.BinariesDirectory)/test-proxy `
3846 --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json `
@@ -41,23 +49,36 @@ steps:
4149 condition: and(succeeded(), ${{ parameters.condition }})
4250
4351 - pwsh : |
52+ Write-Host "Prepending path with the test proxy tool install location: '$(Build.BinariesDirectory)/test-proxy'"
4453 Write-Host "##vso[task.prependpath]$(Build.BinariesDirectory)/test-proxy"
4554 displayName: "Prepend path with test-proxy tool install location"
4655
4756 - ${{ if eq(parameters.runProxy, 'true') }} :
4857 - pwsh : |
58+ Write-Host "Setting ASPNETCORE_Kestrel__Certificates__Default__Path to '${{ parameters.templateRoot }}/eng/common/testproxy/dotnet-devcert.pfx'"
4959 Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Path]${{ parameters.templateRoot }}/eng/common/testproxy/dotnet-devcert.pfx"
60+ Write-Host "Setting ASPNETCORE_Kestrel__Certificates__Default__Password to 'password'"
5061 Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Password]password"
62+ Write-Host "Setting PROXY_MANUAL_START to 'true'"
5163 Write-Host "##vso[task.setvariable variable=PROXY_MANUAL_START]true"
5264 displayName: 'Configure Kestrel and PROXY_MANUAL_START Variables'
5365 condition: and(succeeded(), ${{ parameters.condition }})
5466
5567 - pwsh : |
68+ $invocation = @"
69+ Start-Process $(Build.BinariesDirectory)/test-proxy/test-proxy.exe
70+ -ArgumentList `"start -u --storage-location ${{ parameters.rootFolder }}`"
71+ -NoNewWindow -PassThru -RedirectStandardOutput ${{ parameters.rootFolder }}/test-proxy.log
72+ -RedirectStandardError ${{ parameters.rootFolder }}/test-proxy-error.log
73+ "@
74+ Write-Host $invocation
75+
5676 $Process = Start-Process $(Build.BinariesDirectory)/test-proxy/test-proxy.exe `
5777 -ArgumentList "start -u --storage-location ${{ parameters.rootFolder }}" `
5878 -NoNewWindow -PassThru -RedirectStandardOutput ${{ parameters.rootFolder }}/test-proxy.log `
5979 -RedirectStandardError ${{ parameters.rootFolder }}/test-proxy-error.log
6080
81+ Write-Host "Setting PROXY_PID to $($Process.Id)"
6182 Write-Host "##vso[task.setvariable variable=PROXY_PID]$($Process.Id)"
6283 displayName: 'Run the testproxy - windows'
6384 condition: and(succeeded(), eq(variables['Agent.OS'],'Windows_NT'), ${{ parameters.condition }})
6990 nohup $(Build.BinariesDirectory)/test-proxy/test-proxy 1>${{ parameters.rootFolder }}/test-proxy.log 2>${{ parameters.rootFolder }}/test-proxy-error.log &
7091
7192 echo $! > $(Build.SourcesDirectory)/test-proxy.pid
93+
94+ echo "Setting PROXY_PID to $(cat $(Build.SourcesDirectory)/test-proxy.pid)"
7295 echo "##vso[task.setvariable variable=PROXY_PID]$(cat $(Build.SourcesDirectory)/test-proxy.pid)"
7396 displayName: "Run the testproxy - linux/mac"
7497 condition: and(succeeded(), ne(variables['Agent.OS'],'Windows_NT'), ${{ parameters.condition }})
@@ -79,7 +102,9 @@ steps:
79102 - pwsh : |
80103 for ($i = 0; $i -lt 10; $i++) {
81104 try {
105+ Write-Host "Invoke-WebRequest -Uri `"http://localhost:5000/Admin/IsAlive`" | Out-Null"
82106 Invoke-WebRequest -Uri "http://localhost:5000/Admin/IsAlive" | Out-Null
107+ Write-Host "Successfully connected to the test proxy on port 5000."
83108 exit 0
84109 } catch {
85110 Write-Warning "Failed to successfully connect to test proxy. Retrying..."
0 commit comments