From 2c40503687db640cc6aff54acdf00a34bd5b6cf8 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 16 Feb 2022 17:48:38 -0800 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools for PR 2758 (#27127) * tooling updates. allow install but no run of test proxy, prepending the path properly, etc * update targeted versions of the test-proxy Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com> --- eng/common/testproxy/docker-start-proxy.ps1 | 2 +- eng/common/testproxy/test-proxy-tool.yml | 42 ++++++++++++--------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/eng/common/testproxy/docker-start-proxy.ps1 b/eng/common/testproxy/docker-start-proxy.ps1 index 7270c72a7be1c..1bef33483e0a7 100644 --- a/eng/common/testproxy/docker-start-proxy.ps1 +++ b/eng/common/testproxy/docker-start-proxy.ps1 @@ -31,7 +31,7 @@ catch { Write-Error "Please check your docker invocation and try running the script again." } -$SELECTED_IMAGE_TAG = "1314089" +$SELECTED_IMAGE_TAG = "1369319" $CONTAINER_NAME = "ambitious_azsdk_test_proxy" $LINUX_IMAGE_SOURCE = "azsdkengsys.azurecr.io/engsys/testproxy-lin:${SELECTED_IMAGE_TAG}" $WINDOWS_IMAGE_SOURCE = "azsdkengsys.azurecr.io/engsys/testproxy-win:${SELECTED_IMAGE_TAG}" diff --git a/eng/common/testproxy/test-proxy-tool.yml b/eng/common/testproxy/test-proxy-tool.yml index d03837272666e..a1d5191eb01b1 100644 --- a/eng/common/testproxy/test-proxy-tool.yml +++ b/eng/common/testproxy/test-proxy-tool.yml @@ -1,34 +1,40 @@ parameters: rootFolder: '$(Build.SourcesDirectory)' + runProxy: true steps: - pwsh: | $(Build.SourcesDirectory)/eng/common/scripts/trust-proxy-certificate.ps1 displayName: 'Language Specific Certificate Trust' - - pwsh: | - Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Path]$(Build.SourcesDirectory)/eng/common/testproxy/dotnet-devcert.pfx" - Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Password]password" - Write-Host "##vso[task.setvariable variable=PROXY_MANUAL_START]true" - displayName: 'Configure Kestrel and PROXY_MANUAL_START Variables' - - pwsh: | dotnet tool install azure.sdk.tools.testproxy ` --tool-path $(Build.BinariesDirectory)/test-proxy ` --add-source https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json ` - --version 1.0.0-dev.20220119.2 + --version 1.0.0-dev.20220210.1 displayName: "Install test-proxy" - pwsh: | - Start-Process $(Build.BinariesDirectory)/test-proxy/test-proxy.exe ` - -ArgumentList "--storage-location ${{ parameters.rootFolder }}" ` - -NoNewWindow -PassThru -RedirectStandardOutput $(Build.SourcesDirectory)/test-proxy.log - displayName: 'Run the testproxy - windows' - condition: and(succeeded(), eq(variables['Agent.OS'],'Windows_NT')) + Write-Host "##vso[task.prependpath]$(Build.BinariesDirectory)/test-proxy" + displayName: "Prepend path with test-proxy tool install location" + + - ${{ if eq(parameters.runProxy, 'true') }}: + - pwsh: | + Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Path]$(Build.SourcesDirectory)/eng/common/testproxy/dotnet-devcert.pfx" + Write-Host "##vso[task.setvariable variable=ASPNETCORE_Kestrel__Certificates__Default__Password]password" + Write-Host "##vso[task.setvariable variable=PROXY_MANUAL_START]true" + displayName: 'Configure Kestrel and PROXY_MANUAL_START Variables' + + - pwsh: | + Start-Process $(Build.BinariesDirectory)/test-proxy/test-proxy.exe ` + -ArgumentList "--storage-location ${{ parameters.rootFolder }}" ` + -NoNewWindow -PassThru -RedirectStandardOutput $(Build.SourcesDirectory)/test-proxy.log + displayName: 'Run the testproxy - windows' + condition: and(succeeded(), eq(variables['Agent.OS'],'Windows_NT')) - # 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 & - displayName: "Run the testproxy - linux/mac" - condition: and(succeeded(), ne(variables['Agent.OS'],'Windows_NT')) - workingDirectory: "${{ parameters.rootFolder }}" + # 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 & + displayName: "Run the testproxy - linux/mac" + condition: and(succeeded(), ne(variables['Agent.OS'],'Windows_NT')) + workingDirectory: "${{ parameters.rootFolder }}"