Skip to content

Commit b8df88c

Browse files
authored
Revert "tests(sdk): Run tests on toolbox dev version (#19)" (#89)
This reverts commit 9b42f2b.
1 parent 9b42f2b commit b8df88c

File tree

1 file changed

+8
-25
lines changed

1 file changed

+8
-25
lines changed

tests/conftest.py

+8-25
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
from typing import Generator
2626

2727
import google
28-
import pytest
2928
import pytest_asyncio
3029
from google.auth import compute_engine
3130
from google.cloud import secretmanager, storage
@@ -131,37 +130,21 @@ def auth_token2(project_id: str) -> str:
131130

132131

133132
@pytest_asyncio.fixture(scope="session")
134-
def toolbox_server(
135-
tmp_path_factory: pytest.TempPathFactory, toolbox_version: str, tools_file_path: str
136-
) -> Generator[None]:
133+
def toolbox_server(toolbox_version: str, tools_file_path: str) -> Generator[None]:
137134
"""Starts the toolbox server as a subprocess."""
138-
# Get a temp dir for toolbox data
139-
tmp_path = tmp_path_factory.mktemp("toolbox_data")
140-
toolbox_binary_path = str(tmp_path) + "/toolbox"
141-
142-
# Get toolbox binary
143-
if toolbox_version == "dev":
144-
print("Compiling the current dev toolbox version...")
145-
subprocess.Popen(["go", "get", "./..."])
146-
subprocess.Popen(["go", "build", "-o", toolbox_binary_path])
147-
# Wait for compilation
148-
time.sleep(5)
149-
print("Toolbox binary compiled successfully.")
150-
else:
151-
print("Downloading toolbox binary from gcs bucket...")
152-
source_blob_name = get_toolbox_binary_url(toolbox_version)
153-
download_blob("genai-toolbox", source_blob_name, toolbox_binary_path)
154-
print("Toolbox binary downloaded successfully.")
155-
156-
# Run toolbox binary
135+
print("Downloading toolbox binary from gcs bucket...")
136+
source_blob_name = get_toolbox_binary_url(toolbox_version)
137+
download_blob("genai-toolbox", source_blob_name, "toolbox")
138+
print("Toolbox binary downloaded successfully.")
157139
try:
158140
print("Opening toolbox server process...")
159141
# Make toolbox executable
160-
os.chmod(toolbox_binary_path, 0o700)
142+
os.chmod("toolbox", 0o700)
161143
# Run toolbox binary
162144
toolbox_server = subprocess.Popen(
163-
[toolbox_binary_path, "--tools_file", tools_file_path]
145+
["./toolbox", "--tools_file", tools_file_path]
164146
)
147+
165148
# Wait for server to start
166149
# Retry logic with a timeout
167150
for _ in range(5): # retries

0 commit comments

Comments
 (0)