Skip to content

Commit 216280d

Browse files
committed
update to honor the override file
1 parent 2833ee9 commit 216280d

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

eng/target_proxy_version.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0.0-dev.20240410.1

sdk/core/azure-core-test/src/main/java/com/azure/core/test/utils/TestProxyUtils.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,17 @@ public static void checkForTestProxyErrors(HttpResponse httpResponse) {
238238
*/
239239
public static String getTestProxyVersion(Path testClassPath) {
240240
Path rootPath = TestUtils.getRepoRootResolveUntil(testClassPath, "eng");
241+
Path overrideVersionFile = Paths.get("eng", "target_proxy_version.txt");
241242
Path versionFile = Paths.get("eng", "common", "testproxy", "target_version.txt");
242-
rootPath = rootPath.resolve(versionFile);
243+
244+
// if a long-lived override exists, use it.
245+
if (Files.exists(rootPath.resolve(overrideVersionFile))) {
246+
versionFile = overrideVersionFile;
247+
}
248+
249+
versionFilePath = rootPath.resolve(versionFile);
243250
try {
244-
return Files.readAllLines(rootPath).get(0).replace(System.getProperty("line.separator"), "");
251+
return Files.readAllLines(versionFilePath).get(0).replace(System.getProperty("line.separator"), "");
245252
} catch (IOException e) {
246253
throw new UncheckedIOException(e);
247254
}

0 commit comments

Comments
 (0)