From eff66d7250d35ccf206ab5d09c60ec1f5c850fbd Mon Sep 17 00:00:00 2001 From: Twisha Bansal <58483338+twishabansal@users.noreply.github.com> Date: Thu, 13 Mar 2025 14:28:48 +0530 Subject: [PATCH] Revert "tests(sdk): Run tests on toolbox dev version (#19)" This reverts commit 9b42f2ba6fe61c0043ba128077bee7c81b993d83. --- tests/conftest.py | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 94d5ae28..76d1ab5c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -25,7 +25,6 @@ from typing import Generator import google -import pytest import pytest_asyncio from google.auth import compute_engine from google.cloud import secretmanager, storage @@ -131,37 +130,21 @@ def auth_token2(project_id: str) -> str: @pytest_asyncio.fixture(scope="session") -def toolbox_server( - tmp_path_factory: pytest.TempPathFactory, toolbox_version: str, tools_file_path: str -) -> Generator[None]: +def toolbox_server(toolbox_version: str, tools_file_path: str) -> Generator[None]: """Starts the toolbox server as a subprocess.""" - # Get a temp dir for toolbox data - tmp_path = tmp_path_factory.mktemp("toolbox_data") - toolbox_binary_path = str(tmp_path) + "/toolbox" - - # Get toolbox binary - if toolbox_version == "dev": - print("Compiling the current dev toolbox version...") - subprocess.Popen(["go", "get", "./..."]) - subprocess.Popen(["go", "build", "-o", toolbox_binary_path]) - # Wait for compilation - time.sleep(5) - print("Toolbox binary compiled successfully.") - else: - print("Downloading toolbox binary from gcs bucket...") - source_blob_name = get_toolbox_binary_url(toolbox_version) - download_blob("genai-toolbox", source_blob_name, toolbox_binary_path) - print("Toolbox binary downloaded successfully.") - - # Run toolbox binary + print("Downloading toolbox binary from gcs bucket...") + source_blob_name = get_toolbox_binary_url(toolbox_version) + download_blob("genai-toolbox", source_blob_name, "toolbox") + print("Toolbox binary downloaded successfully.") try: print("Opening toolbox server process...") # Make toolbox executable - os.chmod(toolbox_binary_path, 0o700) + os.chmod("toolbox", 0o700) # Run toolbox binary toolbox_server = subprocess.Popen( - [toolbox_binary_path, "--tools_file", tools_file_path] + ["./toolbox", "--tools_file", tools_file_path] ) + # Wait for server to start # Retry logic with a timeout for _ in range(5): # retries