Skip to content

Commit 3536ac7

Browse files
azure-sdkscbedd
andauthored
Sync eng/common directory with azure-sdk-tools for PR 15500 (#26735)
* allow explicit binding to a target url from test-proxy-standalone * address pr comments --------- Co-authored-by: Scott Beddall <scbedd@microsoft.com>
1 parent 8f55b8a commit 3536ac7

2 files changed

Lines changed: 13 additions & 11 deletions

File tree

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ parameters:
55
targetVersion: ''
66
templateRoot: '$(Build.SourcesDirectory)'
77
condition: true
8+
proxyUrl: 'http://localhost:5000'
89

910
steps:
1011
- pwsh: |
@@ -56,14 +57,14 @@ steps:
5657
- pwsh: |
5758
$invocation = @"
5859
Start-Process $(PROXY_EXE)
59-
-ArgumentList `"start -u --storage-location ${{ parameters.rootFolder }}`"
60+
-ArgumentList `"start -u --storage-location ${{ parameters.rootFolder }} -- --urls ${{ parameters.proxyUrl }}`"
6061
-NoNewWindow -PassThru -RedirectStandardOutput ${{ parameters.rootFolder }}/test-proxy.log
6162
-RedirectStandardError ${{ parameters.rootFolder }}/test-proxy-error.log
6263
"@
6364
Write-Host $invocation
6465
6566
$Process = Start-Process $(PROXY_EXE) `
66-
-ArgumentList "start -u --storage-location ${{ parameters.rootFolder }}" `
67+
-ArgumentList "start -u --storage-location ${{ parameters.rootFolder }} -- --urls ${{ parameters.proxyUrl }}" `
6768
-NoNewWindow -PassThru -RedirectStandardOutput ${{ parameters.rootFolder }}/test-proxy.log `
6869
-RedirectStandardError ${{ parameters.rootFolder }}/test-proxy-error.log
6970
@@ -77,8 +78,8 @@ steps:
7778
if [[ "$(uname)" == "Darwin" ]]; then
7879
export DOTNET_ROOT="$HOME/.dotnet"
7980
fi
80-
echo "nohup $(PROXY_EXE) 1>${{ parameters.rootFolder }}/test-proxy.log 2>${{ parameters.rootFolder }}/test-proxy-error.log &"
81-
nohup $(PROXY_EXE) 1>${{ parameters.rootFolder }}/test-proxy.log 2>${{ parameters.rootFolder }}/test-proxy-error.log &
81+
echo "nohup $(PROXY_EXE) start -u --storage-location ${{ parameters.rootFolder }} -- --urls \"${{ parameters.proxyUrl }}\" 1>${{ parameters.rootFolder }}/test-proxy.log 2>${{ parameters.rootFolder }}/test-proxy-error.log &"
82+
nohup $(PROXY_EXE) start -u --storage-location ${{ parameters.rootFolder }} -- --urls "${{ parameters.proxyUrl }}" 1>${{ parameters.rootFolder }}/test-proxy.log 2>${{ parameters.rootFolder }}/test-proxy-error.log &
8283
8384
echo $! > $(Build.SourcesDirectory)/test-proxy.pid
8485
@@ -93,8 +94,8 @@ steps:
9394
- pwsh: |
9495
for ($i = 0; $i -lt 10; $i++) {
9596
try {
96-
Write-Host "Invoke-WebRequest -Uri `"http://localhost:5000/Admin/IsAlive`" | Out-Null"
97-
Invoke-WebRequest -Uri "http://localhost:5000/Admin/IsAlive" | Out-Null
97+
Write-Host "Invoke-WebRequest -Uri `"${{ parameters.proxyUrl }}/Admin/IsAlive`" | Out-Null"
98+
Invoke-WebRequest -Uri "${{ parameters.proxyUrl }}/Admin/IsAlive" | Out-Null
9899
Write-Host "Successfully connected to the test proxy on port 5000."
99100
exit 0
100101
} catch {

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ parameters:
55
targetVersion: ''
66
templateRoot: '$(Build.SourcesDirectory)'
77
condition: true
8+
proxyUrl: 'http://localhost:5000'
89

910
steps:
1011
- pwsh: |
@@ -67,14 +68,14 @@ steps:
6768
- pwsh: |
6869
$invocation = @"
6970
Start-Process $(Build.BinariesDirectory)/test-proxy/test-proxy.exe
70-
-ArgumentList `"start -u --storage-location ${{ parameters.rootFolder }}`"
71+
-ArgumentList `"start -u --storage-location ${{ parameters.rootFolder }} -- --urls ${{ parameters.proxyUrl }}`"
7172
-NoNewWindow -PassThru -RedirectStandardOutput ${{ parameters.rootFolder }}/test-proxy.log
7273
-RedirectStandardError ${{ parameters.rootFolder }}/test-proxy-error.log
7374
"@
7475
Write-Host $invocation
7576
7677
$Process = Start-Process $(Build.BinariesDirectory)/test-proxy/test-proxy.exe `
77-
-ArgumentList "start -u --storage-location ${{ parameters.rootFolder }}" `
78+
-ArgumentList "start -u --storage-location ${{ parameters.rootFolder }} -- --urls ${{ parameters.proxyUrl }}" `
7879
-NoNewWindow -PassThru -RedirectStandardOutput ${{ parameters.rootFolder }}/test-proxy.log `
7980
-RedirectStandardError ${{ parameters.rootFolder }}/test-proxy-error.log
8081
@@ -90,7 +91,7 @@ steps:
9091
if [[ "$(uname)" == "Darwin" ]]; then
9192
export DOTNET_ROOT="$HOME/.dotnet"
9293
fi
93-
nohup $(Build.BinariesDirectory)/test-proxy/test-proxy 1>${{ parameters.rootFolder }}/test-proxy.log 2>${{ parameters.rootFolder }}/test-proxy-error.log &
94+
nohup $(Build.BinariesDirectory)/test-proxy/test-proxy start -u --storage-location ${{ parameters.rootFolder }} -- --urls "${{ parameters.proxyUrl }}" 1>${{ parameters.rootFolder }}/test-proxy.log 2>${{ parameters.rootFolder }}/test-proxy-error.log &
9495
9596
echo $! > $(Build.SourcesDirectory)/test-proxy.pid
9697
@@ -105,8 +106,8 @@ steps:
105106
- pwsh: |
106107
for ($i = 0; $i -lt 10; $i++) {
107108
try {
108-
Write-Host "Invoke-WebRequest -Uri `"http://localhost:5000/Admin/IsAlive`" | Out-Null"
109-
Invoke-WebRequest -Uri "http://localhost:5000/Admin/IsAlive" | Out-Null
109+
Write-Host "Invoke-WebRequest -Uri `"${{ parameters.proxyUrl }}/Admin/IsAlive`" | Out-Null"
110+
Invoke-WebRequest -Uri "${{ parameters.proxyUrl }}/Admin/IsAlive" | Out-Null
110111
Write-Host "Successfully connected to the test proxy on port 5000."
111112
exit 0
112113
} catch {

0 commit comments

Comments
 (0)