publisher, deployer: report ssh failure instead of BrokenPipeError (0.9.8)
build / build (push) Successful in 21m56s
build / build (push) Successful in 21m56s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
@@ -175,3 +176,14 @@ def test_python_config_layout(tmp_path):
|
||||
plan.dest = "/home/user/app/docker/stack"
|
||||
plan.app = config.App(name="stack", kind="docker", src=str(tmp_path), dest="docker/stack")
|
||||
assert get("docker").config_items(plan) == [(".env", "/home/user/app/configs/docker/stack.env")]
|
||||
|
||||
|
||||
def test_ssh_exits_early(tmp_path, monkeypatch):
|
||||
# ssh dies at once (e.g. unresolvable host): the broken pipe must surface as RemoteError with its message
|
||||
fake = tmp_path / "ssh"
|
||||
fake.write_text("#!/bin/sh\necho \"ssh: Could not resolve hostname\" >&2\nexit 255\n")
|
||||
fake.chmod(0o755)
|
||||
monkeypatch.setenv("PATH", f"{tmp_path}:{os.environ['PATH']}")
|
||||
srv = config.Server(host="nohost.invalid", user="u")
|
||||
with pytest.raises(remote.RemoteError, match="Could not resolve"):
|
||||
remote.run(srv, "x" * 5_000_000, check=False)
|
||||
|
||||
Reference in New Issue
Block a user