Skip to content

Commit c379c12

Browse files
azure-sdkscbeddhallipr
authored
Sync eng/common directory with azure-sdk-tools for PR 10190 (Azure#40353)
* 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 <[email protected]> Co-authored-by: Scott Beddall <[email protected]> Co-authored-by: Patrick Hallisey <[email protected]>
1 parent b41d8e7 commit c379c12

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

eng/common/testproxy/test-proxy-standalone-tool.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,37 +32,54 @@ steps:
3232
}
3333
3434
Write-Host "Installing test-proxy version $version"
35+
Write-Host "${{ parameters.templateRoot }}/eng/common/testproxy/install-test-proxy.ps1 -Version $version -InstallDirectory $(Build.BinariesDirectory)/test-proxy"
3536
${{ parameters.templateRoot }}/eng/common/testproxy/install-test-proxy.ps1 -Version $version -InstallDirectory $(Build.BinariesDirectory)/test-proxy
3637
displayName: "Install test-proxy"
3738
condition: and(succeeded(), ${{ parameters.condition }})
3839
3940
- pwsh: |
41+
Write-Host "Prepending path with the test proxy tool install location: '$(Build.BinariesDirectory)/test-proxy'"
4042
Write-Host "##vso[task.prependpath]$(Build.BinariesDirectory)/test-proxy"
4143
displayName: "Prepend path with test-proxy tool install location"
4244
4345
- ${{ if eq(parameters.runProxy, 'true') }}:
4446
- pwsh: |
47+
Write-Host "Setting ASPNETCORE_Kestrel__Certificates__Default__Path to '${{ parameters.templateRoot }}/eng/common/testproxy/dotnet-devcert.pfx'"
4548
Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Path]${{ parameters.templateRoot }}/eng/common/testproxy/dotnet-devcert.pfx"
49+
Write-Host "Setting ASPNETCORE_Kestrel__Certificates__Default__Password to 'password'"
4650
Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Password]password"
51+
Write-Host "Setting PROXY_MANUAL_START to 'true'"
4752
Write-Host "##vso[task.setvariable variable=PROXY_MANUAL_START]true"
4853
displayName: 'Configure Kestrel and PROXY_MANUAL_START Variables'
4954
condition: and(succeeded(), ${{ parameters.condition }})
5055
5156
- pwsh: |
57+
$invocation = @"
58+
Start-Process $(PROXY_EXE)
59+
-ArgumentList `"start -u --storage-location ${{ parameters.rootFolder }}`"
60+
-NoNewWindow -PassThru -RedirectStandardOutput ${{ parameters.rootFolder }}/test-proxy.log
61+
-RedirectStandardError ${{ parameters.rootFolder }}/test-proxy-error.log
62+
"@
63+
Write-Host $invocation
64+
5265
$Process = Start-Process $(PROXY_EXE) `
5366
-ArgumentList "start -u --storage-location ${{ parameters.rootFolder }}" `
5467
-NoNewWindow -PassThru -RedirectStandardOutput ${{ parameters.rootFolder }}/test-proxy.log `
5568
-RedirectStandardError ${{ parameters.rootFolder }}/test-proxy-error.log
5669
70+
Write-Host "Setting PROXY_PID to $($Process.Id)"
5771
Write-Host "##vso[task.setvariable variable=PROXY_PID]$($Process.Id)"
5872
displayName: 'Run the testproxy - windows'
5973
condition: and(succeeded(), eq(variables['Agent.OS'],'Windows_NT'), ${{ parameters.condition }})
6074
6175
# nohup does NOT continue beyond the current session if you use it within powershell
6276
- bash: |
77+
echo "nohup $(PROXY_EXE) 1>${{ parameters.rootFolder }}/test-proxy.log 2>${{ parameters.rootFolder }}/test-proxy-error.log &"
6378
nohup $(PROXY_EXE) 1>${{ parameters.rootFolder }}/test-proxy.log 2>${{ parameters.rootFolder }}/test-proxy-error.log &
6479
6580
echo $! > $(Build.SourcesDirectory)/test-proxy.pid
81+
82+
echo "Setting PROXY_PID to $(cat $(Build.SourcesDirectory)/test-proxy.pid)"
6683
echo "##vso[task.setvariable variable=PROXY_PID]$(cat $(Build.SourcesDirectory)/test-proxy.pid)"
6784
displayName: "Run the testproxy - linux/mac"
6885
condition: and(succeeded(), ne(variables['Agent.OS'],'Windows_NT'), ${{ parameters.condition }})
@@ -71,7 +88,9 @@ steps:
7188
- pwsh: |
7289
for ($i = 0; $i -lt 10; $i++) {
7390
try {
91+
Write-Host "Invoke-WebRequest -Uri `"http://localhost:5000/Admin/IsAlive`" | Out-Null"
7492
Invoke-WebRequest -Uri "http://localhost:5000/Admin/IsAlive" | Out-Null
93+
Write-Host "Successfully connected to the test proxy on port 5000."
7594
exit 0
7695
} catch {
7796
Write-Warning "Failed to successfully connect to test proxy. Retrying..."

eng/common/testproxy/test-proxy-tool.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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 }})
@@ -69,6 +90,8 @@ steps:
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

Comments
 (0)