diff --git a/eng/target_proxy_version.txt b/eng/target_proxy_version.txt new file mode 100644 index 000000000000..a9598ae32651 --- /dev/null +++ b/eng/target_proxy_version.txt @@ -0,0 +1 @@ +1.0.0-dev.20240410.1 \ No newline at end of file diff --git a/tools/azure-sdk-tools/devtools_testutils/proxy_startup.py b/tools/azure-sdk-tools/devtools_testutils/proxy_startup.py index e0b3e3aa4a22..e4089c324dbd 100644 --- a/tools/azure-sdk-tools/devtools_testutils/proxy_startup.py +++ b/tools/azure-sdk-tools/devtools_testutils/proxy_startup.py @@ -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