From 241bdb849ce431e1a5e398a5649cde93149ee374 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Tue, 26 Apr 2022 16:38:45 -0700 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools for PR 3212 (#17731) * bump consumed version of test proxy. update scripting to target the fully cross-platform image tag name. * update target version of the test-proxy to one that enforces http/1.1 * pin previous version of the test-proxy to unblock CI Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com> --- eng/common/testproxy/docker-start-proxy.ps1 | 10 +++------- eng/common/testproxy/target_version.txt | 2 +- eng/pipelines/templates/steps/build-test.yml | 3 +++ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/eng/common/testproxy/docker-start-proxy.ps1 b/eng/common/testproxy/docker-start-proxy.ps1 index c15fc37a7e40..c34c9d38d82d 100644 --- a/eng/common/testproxy/docker-start-proxy.ps1 +++ b/eng/common/testproxy/docker-start-proxy.ps1 @@ -38,8 +38,7 @@ catch { $SELECTED_IMAGE_TAG = $(Get-Content "$PSScriptRoot/target_version.txt" -Raw).Trim() $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}" +$IMAGE_SOURCE = "azsdkengsys.azurecr.io/engsys/testproxy:${SELECTED_IMAGE_TAG}" if($VersionOverride) { Write-Host "Overriding default target proxy version of '$SELECTED_IMAGE_TAG' with override $VersionOverride." @@ -58,8 +57,6 @@ function Get-Proxy-Container(){ | Select-Object -First 1) } - -$SelectedImage = $LINUX_IMAGE_SOURCE $Initial = "" $AdditionalContainerArgs = "--add-host=host.docker.internal:host-gateway" @@ -67,7 +64,6 @@ $AdditionalContainerArgs = "--add-host=host.docker.internal:host-gateway" # however, in CI, windows images default to _windows_ containers. We cannot swap them. We can tell if we're in a CI build by # checking for the environment variable TF_BUILD. if ($IsWindows -and $env:TF_BUILD){ - $SelectedImage = $WINDOWS_IMAGE_SOURCE $Initial = "C:" $AdditionalContainerArgs = "" } @@ -93,9 +89,9 @@ if ($Mode -eq "start"){ else { $attempts = 0 Write-Host "Attempting creation of Docker host $CONTAINER_NAME" - Write-Host "docker container create -v `"${root}:${Initial}/srv/testproxy`" $AdditionalContainerArgs -p 5001:5001 -p 5000:5000 --name $CONTAINER_NAME $SelectedImage" + Write-Host "docker container create -v `"${root}:${Initial}/srv/testproxy`" $AdditionalContainerArgs -p 5001:5001 -p 5000:5000 --name $CONTAINER_NAME $IMAGE_SOURCE" while($attempts -lt 3){ - docker container create -v "${root}:${Initial}/srv/testproxy" $AdditionalContainerArgs -p 5001:5001 -p 5000:5000 --name $CONTAINER_NAME $SelectedImage + docker container create -v "${root}:${Initial}/srv/testproxy" $AdditionalContainerArgs -p 5001:5001 -p 5000:5000 --name $CONTAINER_NAME $IMAGE_SOURCE if($LASTEXITCODE -ne 0){ $attempts += 1 diff --git a/eng/common/testproxy/target_version.txt b/eng/common/testproxy/target_version.txt index ac34389c6099..a72b151d94e5 100644 --- a/eng/common/testproxy/target_version.txt +++ b/eng/common/testproxy/target_version.txt @@ -1 +1 @@ -1.0.0-dev.20220224.2 +1.0.0-dev.20220426.1 diff --git a/eng/pipelines/templates/steps/build-test.yml b/eng/pipelines/templates/steps/build-test.yml index 17dc761ac5e4..b06ca963f800 100644 --- a/eng/pipelines/templates/steps/build-test.yml +++ b/eng/pipelines/templates/steps/build-test.yml @@ -48,6 +48,9 @@ steps: - ${{ if eq(parameters.TestProxy, true) }}: - template: /eng/common/testproxy/test-proxy-tool.yml + parameters: + targetVersion: '1.0.0-dev.20220224.2' + - task: PowerShell@2 displayName: 'Run Tests'