-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #3046: Use correct target alias record when importing the sql d…
…atabase in sql:sync. (#3106)
- Loading branch information
1 parent
db093f0
commit ef052a0
Showing
2 changed files
with
14 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,18 +38,25 @@ public function testSimulatedSqlSync() { | |
'alias-path' => __DIR__ . '/resources/alias-fixtures', | ||
]; | ||
|
||
// Test simulated simple rsync with two local sites | ||
// Test simulated simple rsync remote-to-local | ||
$this->drush('sql:sync', ['@synctest.remote', '@synctest.local'], $options, '@synctest.local', NULL, self::EXIT_SUCCESS, '2>&1'); | ||
$output = $this->getSimplifiedOutput(); | ||
$this->assertContains("Simulating backend invoke: ssh -o PasswordAuthentication=whatever [email protected] '/path/to/drush --backend=2 --strict=0 --alias-path=__DIR__/resources/alias-fixtures:__SANDBOX__/etc/drush --root=__SUT__/web --uri=remote sql-dump --no-ansi --gzip --result-file", $output); | ||
$this->assertContains("Simulating backend invoke: __SUT__/vendor/drush/drush/drush --backend=2 --alias-path=__DIR__/resources/alias-fixtures:__SANDBOX__/etc/drush --root=__SUT__/web --uri=local core-rsync '@synctest.remote:/simulated/path/to/dump.tgz' '@synctest.local:__SANDBOX__/drush-tmp/dump.tgz' -- --remove-source-files", $output); | ||
$this->assertContains("Simulating backend invoke: __SUT__/vendor/drush/drush/drush --backend=2 --strict=0 --alias-path=__DIR__/resources/alias-fixtures:__SANDBOX__/etc/drush --root=__SUT__/web --uri=local sql-query --no-ansi --file=__SANDBOX__/drush-tmp/dump.tgz --file-delete", $output); | ||
|
||
// Test simulated backend invoke. | ||
// Note that command-specific options are not processed for remote | ||
// targets. The aliases are not interpreted at all until they recach | ||
// the remote side, at which point they will be evaluated & any needed | ||
// injection will be done. | ||
// Test simulated simple rsync local-to-remote | ||
$this->drush('sql:sync', ['@synctest.local', '@synctest.remote'], $options, '@synctest.local', NULL, self::EXIT_SUCCESS, '2>&1'); | ||
$output = $this->getSimplifiedOutput(); | ||
$this->assertContains("Simulating backend invoke: __SUT__/vendor/drush/drush/drush --backend=2 --strict=0 --alias-path=__DIR__/resources/alias-fixtures:__SANDBOX__/etc/drush --root=__SUT__/web --uri=local sql-dump --no-ansi --gzip --result-file", $output); | ||
$this->assertContains("Simulating backend invoke: __SUT__/vendor/drush/drush/drush --backend=2 --alias-path=__DIR__/resources/alias-fixtures:__SANDBOX__/etc/drush --root=__SUT__/web --uri=local core-rsync '@synctest.local:/simulated/path/to/dump.tgz' '@synctest.remote:/tmp/dump.tgz' -- --remove-source-files", $output); | ||
$this->assertContains("Simulating backend invoke: ssh -o PasswordAuthentication=whatever [email protected] '/path/to/drush --backend=2 --strict=0 --alias-path=__DIR__/resources/alias-fixtures:__SANDBOX__/etc/drush --root=__SUT__/web --uri=remote sql-query --no-ansi --file=/tmp/dump.tgz --file-delete", $output); | ||
|
||
|
||
// Test simulated backend invoke with a remote runner. | ||
// Note that the target aliases are not interpreted at all until they recach | ||
// the remote side. Injection for alias parameters is currently only done when | ||
// they are used with drush_invoke_process. | ||
$this->drush('sql:sync', ['@synctest.remote', '@synctest.local'], $options, 'user@server/path/to/drupal#sitename', NULL, self::EXIT_SUCCESS, '2>&1'); | ||
$output = $this->getSimplifiedOutput(); | ||
$this->assertContains("Simulating backend invoke: ssh -o PasswordAuthentication=no user@server 'drush --alias-path=__DIR__/resources/alias-fixtures:__SANDBOX__/etc/drush --root=/path/to/drupal --uri=sitename --no-ansi sql:sync '\''@synctest.remote'\'' '\''@synctest.local'\''", $output); | ||
|