Commit Graph

2 Commits

Author SHA1 Message Date
ad454cd909 refactor: send cmd verbatim, drop /bin/sh -c wrap
All checks were successful
ci/woodpecker/push/unit Pipeline was successful
commands.run / stream now forward the user-supplied command string as
`cmd` instead of repackaging it as `cmd=/bin/sh args=["-c", cmd]`.
Callers that want shell semantics or argv splitting handle it
themselves; stream still accepts an optional `args` list for explicit
argv. Updated docstrings and payload tests accordingly.
2026-06-26 17:33:32 +06:00
fce514c49c test: expand command/PTY/git coverage, fix WebSocket close handling
Some checks failed
ci/woodpecker/pr/check Pipeline failed
Tests:
- tests/test_commands.py: unit coverage for Commands/AsyncCommands —
  payload construction (cwd, envs, tag, timeout), background dispatch,
  base64 response decoding, stream-event parsing, stream/connect iterators.
- tests/test_integration_advanced.py: live tests for cwd/env handling,
  long-running commands (apt-get), PTY sessions, streaming exec,
  process connect, and git workflows including cloning wrennhq/wrenn.
- test_filesystem_pty.py: PTY ping/pong reply tests.
- test_integration.py: poll for async process-registry prune in
  test_kill_process instead of asserting on a zero-delay list().

Fixes:
- commands.py / pty.py: stream(), connect() and the PTY iterators only
  caught WebSocketDisconnect. The server closes exec/process streams
  abruptly, raising WebSocketNetworkError — a sibling under
  HTTPXWSException — which crashed connect() entirely. Both are now
  caught via _WS_CLOSED so abrupt closes end iteration cleanly.
- pty.py: reply to the server keepalive ping with a pong so idle PTY
  sessions stay open.
2026-05-19 17:12:52 +06:00