Skip to content

Commit

Permalink
update to honor the override file
Browse files Browse the repository at this point in the history
  • Loading branch information
scbedd committed Apr 25, 2024
1 parent 2833ee9 commit 216280d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
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;
}

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 216280d

Please sign in to comment.