Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools for PR 7877 (#28928)
Browse files Browse the repository at this point in the history
Sync eng/common directory with azure-sdk-tools for PR
Azure/azure-sdk-tools#7877 See [eng/common
workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow)

---------

Co-authored-by: Scott Beddall (from Dev Box) <scbedd@microsoft.com>
  • Loading branch information
azure-sdk and scbedd authored Mar 14, 2024
1 parent 198b9a9 commit d8ac9d6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
10 changes: 10 additions & 0 deletions eng/common/testproxy/test-proxy-tool-shutdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
steps:
- pwsh: |
Stop-Process -Id $(PROXY_PID)
displayName: 'Shut down the testproxy - windows'
condition: and(succeeded(), eq(variables['Agent.OS'],'Windows_NT'))
- bash: |
kill -9 $(PROXY_PID)
displayName: "Shut down the testproxy - linux/mac"
condition: and(succeeded(), ne(variables['Agent.OS'],'Windows_NT'))
8 changes: 7 additions & 1 deletion eng/common/testproxy/test-proxy-tool.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# This template sets variable PROXY_PID to be used for shutdown later.
parameters:
rootFolder: '$(Build.SourcesDirectory)'
runProxy: true
Expand Down Expand Up @@ -42,15 +43,20 @@ steps:
condition: and(succeeded(), ${{ parameters.condition }})
- pwsh: |
Start-Process $(Build.BinariesDirectory)/test-proxy/test-proxy.exe `
$Process = Start-Process $(Build.BinariesDirectory)/test-proxy/test-proxy.exe `
-ArgumentList "start --storage-location ${{ parameters.rootFolder }} -U" `
-NoNewWindow -PassThru -RedirectStandardOutput ${{ parameters.rootFolder }}/test-proxy.log
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: |
nohup $(Build.BinariesDirectory)/test-proxy/test-proxy &>$(Build.SourcesDirectory)/test-proxy.log &
echo $! > $(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 }})
workingDirectory: "${{ parameters.rootFolder }}"
Expand Down

0 comments on commit d8ac9d6

Please sign in to comment.