Repository navigation
test: cover SSH-based commands - #240
Conversation
`ssh --all` lists the SSH URLs of every app, but it selected a container
first, so it failed in non-interactive mode in a project with several
apps ("Specifying the --app or --worker is required").
Add integration tests for `ssh --pipe`, `--all`, and app and worker
selection, with helpers to serve the layout project over the mock SSH
server.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Test certificate generation and reuse, --new, --new-key, --refresh-only, the SSH configuration files, and ssh-cert:info --no-refresh with missing, expired and mismatched certificates. The mock auth server's certificate key ID and lifetime are now configurable, as the CLI only reuses a certificate whose key ID is the user ID and which expires in more than 2 minutes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run the commands against the mock SSH server, with fake remote clients (shell scripts on the remote PATH) which print their arguments: - db:dump: default and --file names, --gzip, --stdout, --directory, table and schema options, MariaDB and PostgreSQL, and remote failures - db:sql: queries, --raw, --schema, and piped input - db:size: PostgreSQL and MariaDB usage - mount:size: df and du output parsing - mount:upload and mount:download with rsync: --exclude and --delete - service:redis-cli and service:mongo:* commands Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Warning
Changes suggested — 🟡 1 warning · 🔵 1 minor point
🔍 Full review · 9 files reviewed
Verification
SelectorConfig::$selectRemoteContainerexists (default true), andSelector::getSelectionskips container selection only when it is false, so non---allpaths still go throughgetRemoteContainer().nextSSHCertificatefalls back to "test-key-id" and one minute when unset, soTestSSHCertsand the other existing tests still get the old certificate values.remoteEnvappends a secondPATHafteros.Environ().ExecHandlerpasses that toexec.Cmd.Env, whose dedup keeps the last value, so the fake binaries take precedence.- Certificate counts in
TestSSHCertLoadgo 1 (--refresh-only), 2 (--newwith the wrong key ID), 3 (the regeneratinginfo), then stay at 3 on reuse, then 4 (--new) and 5 (--new-key). Each count matches one issuing step.
The PR consists mostly of new integration tests in integration-tests/, which skip on Windows; the rsync tests also skip when rsync is missing. TestSSHAppSelection covers the PHP --all fix in a multi-app project. No test covers --all on an inactive or paused environment.
Review details
- Commit: 6127436
- Model: claude-opus-5-5
Review 1 of 10 for this pull request · View the full run
Skipping the container selection for `ssh --all` also skipped the deployment lookup that reported paused and inactive environments, so the command printed the SSH URLs and exited successfully. Also assert the app-not-found message in TestSSHAppSelection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
📋 PR Summary This PR adds integration tests for CLI commands that run over SSH: Changes
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Integration tests for commands that run over SSH, using the mock SSH server's
ExecHandlerwith fake remote clients (shell scripts on the remotePATHthat print their arguments).ssh:--pipe,--all, and app and worker selection in a multi-app projectssh-cert:load(--new,--new-key,--refresh-only, SSH config files) andssh-cert:info(--no-refreshwith missing, expired and mismatched certificates, expiry)db:dump,db:sql,db:sizemount:size, andmount:upload/mount:downloadvia rsync (skipped if rsync is missing)service:redis-cliandservice:mongo:*Fix:
ssh --allselected an app before listing all SSH URLs, so it failed in non-interactive mode in multi-app projects.The mock auth server's SSH certificate key ID and lifetime are now configurable: the CLI only reuses a certificate whose key ID is the user ID and which expires in more than 2 minutes, which the previous fixed values never satisfied.
SFTP (
scp) and port forwarding (tunnel:*,environment:xdebug) need mock SSH server changes, and will follow separately.🤖 Generated with Claude Code