From c9afb278746d64a4dd1e79a29d26514872d46f22 Mon Sep 17 00:00:00 2001 From: Alessandro Date: Fri, 6 Feb 2026 16:27:44 +0100 Subject: [PATCH] Fix CLI tests to work in CI (find agentrial in PATH) The tests hardcoded .venv/bin/agentrial which doesn't exist in CI. Now falls back to shutil.which() to find the binary in PATH. Co-Authored-By: Claude Opus 4.6 --- tests/test_cli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index f563e7d..b0d3f1f 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -2,10 +2,13 @@ import json import os +import shutil import subprocess import tempfile -AGENTRIAL = os.path.join(os.path.dirname(os.path.dirname(__file__)), ".venv", "bin", "agentrial") +# Use .venv binary if available (local dev), otherwise find in PATH (CI) +_venv_bin = os.path.join(os.path.dirname(os.path.dirname(__file__)), ".venv", "bin", "agentrial") +AGENTRIAL = _venv_bin if os.path.isfile(_venv_bin) else shutil.which("agentrial") or "agentrial" def run_cli(*args: str, cwd: str | None = None, timeout: int = 30) -> subprocess.CompletedProcess: