Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools for PR 8158 (#39906)
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) <scbedd@microsoft.com>
  • Loading branch information
azure-sdk and scbedd authored Apr 25, 2024
1 parent 49743ea commit 71214ad
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 43 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
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,17 @@ public static void checkForTestProxyErrors(HttpResponse httpResponse) {
*/
public static String getTestProxyVersion(Path testClassPath) {
Path rootPath = TestUtils.getRepoRootResolveUntil(testClassPath, "eng");
Path overrideVersionFile = Paths.get("eng", "target_proxy_version.txt");
Path versionFile = Paths.get("eng", "common", "testproxy", "target_version.txt");
rootPath = rootPath.resolve(versionFile);

// if a long-lived override exists, use it.
if (Files.exists(rootPath.resolve(overrideVersionFile))) {
versionFile = overrideVersionFile;
}

Path versionFilePath = rootPath.resolve(versionFile);
try {
return Files.readAllLines(rootPath).get(0).replace(System.getProperty("line.separator"), "");
return Files.readAllLines(versionFilePath).get(0).replace(System.getProperty("line.separator"), "");
} catch (IOException e) {
throw new UncheckedIOException(e);
}
Expand Down

0 comments on commit 71214ad

Please sign in to comment.