Skip to content

Commit 657b9af

Browse files
committed
fix: use iris entry-point script instead of python -m iris.cli.main
python -m iris.cli.main silently exits with rc 0 because there is no __main__ guard — the Click group is never invoked. Use the installed ``iris`` console script from the venv instead.
1 parent 5edd9d7 commit 657b9af

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

tests/integration/iris/test_cli_dispatch.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
"""CLI dispatch integration tests — submit jobs via 'iris job run' subprocess."""
44

55
import json
6+
import shutil
67
import subprocess
78
import sys
89
import time
10+
from pathlib import Path
911

1012
import pytest
1113
from iris.cluster.types import is_job_finished
@@ -14,9 +16,20 @@
1416
pytestmark = [pytest.mark.integration, pytest.mark.slow]
1517

1618

19+
def _find_iris_executable() -> str:
20+
"""Locate the ``iris`` entry-point script in the current venv."""
21+
venv_bin = Path(sys.executable).parent / "iris"
22+
if venv_bin.exists():
23+
return str(venv_bin)
24+
found = shutil.which("iris")
25+
if found:
26+
return found
27+
raise FileNotFoundError("Cannot find 'iris' CLI entry point")
28+
29+
1730
def _run_iris_cli(controller_url: str, *args: str, timeout: float = 60) -> subprocess.CompletedProcess:
1831
"""Run an iris CLI command as a subprocess."""
19-
cmd = [sys.executable, "-m", "iris.cli.main", "--controller-url", controller_url, *args]
32+
cmd = [_find_iris_executable(), "--controller-url", controller_url, *args]
2033
return subprocess.run(cmd, capture_output=True, text=True, timeout=timeout)
2134

2235

0 commit comments

Comments
 (0)