fix: force non-interactive ssh for db push, add unit tests#11
Merged
Conversation
export_db() pipes gzip'd SQL through generate_ssh_command(), which requests a TTY (-t) when WP-CLI's STDOUT is a TTY. A forced PTY (e.g. an ssh_config `RequestTTY force`) corrupts that binary stream. New Alias::force_no_tty() rewrites -t to -T for plain ssh transports, applied inside generate_ssh_command() so both export_db() and run_command() are covered (docker/vagrant builders are left untouched). Adds the project's first PHPUnit suite (phpunit.xml.dist + tests/AliasTest.php) covering get_rsync_rsh(), get_rsync_location() -- including an empty-remote-host regression -- and force_no_tty().
d82e3fe to
7ef368e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
export_db()pipes gzip'd SQL throughgenerate_ssh_command(), which requests a TTY (-t) when WP-CLI's STDOUT is a TTY. A forced PTY (e.g. an ssh_configRequestTTY force) corrupts that binary stream.Alias::force_no_tty()rewrites-tto-Tfor plainsshtransports, applied insidegenerate_ssh_command()so bothexport_db()andrun_command()are covered.Also adds the project's first PHPUnit suite covering
get_rsync_rsh(),get_rsync_location()(including an empty-remote-host regression), andforce_no_tty().