Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools for PR 5224 (#4274)
Browse files Browse the repository at this point in the history
* feature/upload-proxy-artifact

* update template to ensure that having the file in use on windows doesn't break the build

* incoming PR fixes where test-proxy stores its log. as as result, we also need to update the location of where we read out the test-proxy log

Co-authored-by: scbedd <[email protected]>
  • Loading branch information
azure-sdk and scbedd authored Jan 27, 2023
1 parent 74a1ad7 commit a3e9ad1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
16 changes: 16 additions & 0 deletions eng/common/testproxy/publish-proxy-logs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
parameters:
rootFolder: '$(Build.SourcesDirectory)'

steps:
- pwsh: |
Copy-Item -Path "${{ parameters.rootFolder }}/test-proxy.log" -Destination "${{ parameters.rootFolder }}/proxy.log"
displayName: Copy Log File
- template: ../pipelines/templates/steps/publish-artifact.yml
parameters:
ArtifactName: "$(System.JobName)-proxy-logs"
ArtifactPath: "${{ parameters.rootFolder }}/proxy.log"

- pwsh: |
Remove-Item -Force ${{ parameters.rootFolder }}/proxy.log
displayName: Cleanup Copied Log File
4 changes: 2 additions & 2 deletions eng/common/testproxy/test-proxy-tool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ steps:
- pwsh: |
Start-Process $(Build.BinariesDirectory)/test-proxy/test-proxy.exe `
-ArgumentList "--storage-location ${{ parameters.rootFolder }}" `
-NoNewWindow -PassThru -RedirectStandardOutput ${{ parameters.templateRoot }}/test-proxy.log
-NoNewWindow -PassThru -RedirectStandardOutput ${{ parameters.rootFolder }}/test-proxy.log
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 > ${{ parameters.templateRoot }}/test-proxy.log &
nohup $(Build.BinariesDirectory)/test-proxy/test-proxy > ${{ parameters.rootFolder }}/test-proxy.log &
displayName: "Run the testproxy - linux/mac"
condition: and(succeeded(), ne(variables['Agent.OS'],'Windows_NT'), ${{ parameters.condition }})
workingDirectory: "${{ parameters.rootFolder }}"
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/templates/jobs/ci.tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ jobs:
get-content test-proxy.log
displayName: TestProxy Log
condition: and(succeededOrFailed(), contains(variables.CmakeArgs, 'BUILD_TESTING=ON'),ne('${{parameters.ServiceDirectory}}', 'template'))
workingDirectory: $(Build.SourcesDirectory)
workingDirectory: $(Build.SourcesDirectory)/sdk/${{parameters.ServiceDirectory}}
continueOnError: true
- task: PublishTestResults@2
Expand Down

0 comments on commit a3e9ad1

Please sign in to comment.