Skip to content

Commit

Permalink
handle the target version override
Browse files Browse the repository at this point in the history
  • Loading branch information
scbedd committed Apr 24, 2024
1 parent f020bab commit 1d5aba1
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
11 changes: 9 additions & 2 deletions tools/azure-sdk-tools/devtools_testutils/proxy_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,17 @@
def get_target_version(repo_root: str) -> str:
"""Gets the target test-proxy version from the target_version.txt file in /eng/common/testproxy"""
version_file_location = os.path.relpath("eng/common/testproxy/target_version.txt")
override_version_file_location = os.path.relpath("eng/target_proxy_version.txt")

version_file_location_from_root = os.path.abspath(os.path.join(repo_root, version_file_location))
override_version_file_location_from_root = os.path.abspath(os.path.join(repo_root, override_version_file_location))

with open(version_file_location_from_root, "r") as f:
target_version = f.read().strip()
if os.path.exists(override_version_file_location_from_root):
with open(override_version_file_location_from_root, "r") as f:
target_version = f.read().strip()
else:
with open(version_file_location_from_root, "r") as f:
target_version = f.read().strip()

return target_version

Expand Down

0 comments on commit 1d5aba1

Please sign in to comment.