Render compose and return the langgraph service's command as a single string.
(env_overrides: dict[str, str])
| 33 | |
| 34 | |
| 35 | def _langgraph_command(env_overrides: dict[str, str]) -> str: |
| 36 | """Render compose and return the langgraph service's command as a single string.""" |
| 37 | if shutil.which("docker") is None: |
| 38 | pytest.skip("docker CLI not available") |
| 39 | env = {**os.environ, **env_overrides} |
| 40 | result = subprocess.run( |
| 41 | ["docker", "compose", "-f", str(COMPOSE), "config"], |
| 42 | env=env, |
| 43 | cwd=REPO_ROOT, |
| 44 | capture_output=True, |
| 45 | text=True, |
| 46 | check=False, |
| 47 | ) |
| 48 | if result.returncode != 0: |
| 49 | pytest.fail( |
| 50 | f"docker compose config failed (exit {result.returncode}):\n" |
| 51 | f"--- stderr ---\n{result.stderr}\n" |
| 52 | f"--- stdout ---\n{result.stdout}" |
| 53 | ) |
| 54 | rendered = yaml.safe_load(result.stdout) |
| 55 | cmd = (rendered.get("services") or {}).get("langgraph", {}).get("command") |
| 56 | if cmd is None: |
| 57 | pytest.fail("langgraph service has no `command` after compose render") |
| 58 | return cmd if isinstance(cmd, str) else " ".join(cmd) |
| 59 | |
| 60 | |
| 61 | def test_default_command_includes_allow_blocking(): |
no test coverage detected