Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools for PR 8158 (Azure#22780)
Browse files Browse the repository at this point in the history
* allow an override FILE to be honored by test-proxy-tool
* update local test-framework to honor proxy override version by default

---------

Co-authored-by: Scott Beddall (from Dev Box) <[email protected]>
  • Loading branch information
azure-sdk and scbedd authored Apr 25, 2024
1 parent e378785 commit 992d2fe
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 41 deletions.
40 changes: 0 additions & 40 deletions eng/common/testproxy/test-proxy-docker.yml

This file was deleted.

12 changes: 11 additions & 1 deletion eng/common/testproxy/test-proxy-tool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,17 @@ steps:
pwsh: true

- pwsh: |
$version = $(Get-Content "${{ parameters.templateRoot }}/eng/common/testproxy/target_version.txt" -Raw).Trim()
$standardVersion = "${{ parameters.templateRoot }}/eng/common/testproxy/target_version.txt"
$overrideVersion = "${{ parameters.templateRoot }}/eng/target_proxy_version.txt"
$version = $(Get-Content $standardVersion -Raw).Trim()
if (Test-Path $overrideVersion) {
$version = $(Get-Content $overrideVersion -Raw).Trim()
}
Write-Host "Installing test-proxy version $version"
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 `
Expand Down
1 change: 1 addition & 0 deletions eng/target_proxy_version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0.0-dev.20240410.1
10 changes: 10 additions & 0 deletions sdk/internal/recording/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,16 @@ func getProxyLog() (*os.File, error) {

func getProxyVersion(gitRoot string) (string, error) {
proxyVersionConfig := filepath.Join(gitRoot, "eng/common/testproxy/target_version.txt")
overrideProxyVersionConfig := filepath.Join(gitRoot, "eng/target_proxy_version.txt")

if _, err := os.Stat(overrideProxyVersionConfig); err == nil {
version, err := ioutil.ReadFile(overrideProxyVersionConfig)
if err == nil {
proxyVersion := strings.TrimSpace(string(version))
return proxyVersion, nil
}
}

version, err := ioutil.ReadFile(proxyVersionConfig)
if err != nil {
return "", err
Expand Down

0 comments on commit 992d2fe

Please sign in to comment.