Skip to content

Commit 52a1e58

Browse files
committed
chore: make CLI build location configurable in tests
1 parent 3da6a90 commit 52a1e58

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

tests/integration/features/environment.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ def after_scenario(context, scenario):
4545

4646

4747
def _find_tower_binary():
48+
if binary := os.environ.get("TOWER_CLI_BINARY"):
49+
if Path(binary).exists():
50+
return binary
51+
4852
# Look for debug build first
4953
debug_path = (
5054
Path(__file__).parent.parent.parent.parent / "target" / "debug" / "tower"

tests/integration/run_tests.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ def start_mock_server():
103103

104104
def main():
105105
"""Run the integration tests."""
106-
# Check prerequisites - look for tower binary from cargo build or on PATH
106+
# Check prerequisites - look for tower binary from env, cargo build, or PATH
107+
has_env_binary = bool(os.environ.get("TOWER_CLI_BINARY") and Path(os.environ["TOWER_CLI_BINARY"]).exists())
107108
project_root = Path(__file__).parent.parent.parent
108109
has_cargo_binary = any(
109110
(project_root / "target" / build / "tower").exists()
@@ -115,7 +116,7 @@ def main():
115116
else False
116117
)
117118

118-
if not has_cargo_binary and not has_path_binary:
119+
if not has_env_binary and not has_cargo_binary and not has_path_binary:
119120
log(
120121
"ERROR: Tower binary not found. Please run 'cargo build' or 'maturin develop' first."
121122
)

0 commit comments

Comments
 (0)