Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ sut/*
sut/drush/sites/*test.site.yml
/sandbox/
.env
# Test fixtures
sut/drush/sites/synctest.site.yml
2 changes: 1 addition & 1 deletion .scenarios.lock/php5/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"consolidation/filter-via-dot-access-data": "^1",
"consolidation/output-formatters": "^3.3.1",
"consolidation/robo": "^1.4.6",
"consolidation/site-alias": "^3.0.0-beta1",
"consolidation/site-alias": "^3.0.0-beta3",
"consolidation/site-process": "^2.0.0-beta5",
"grasmash/yaml-expander": "^1.1.1",
"league/container": "~2",
Expand Down
45 changes: 17 additions & 28 deletions .scenarios.lock/php5/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ shallow_clone: false
platform: 'x86'
clone_folder: C:\projects\work
branches:
except:
- gh-pages
only:
- master
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still tests PRs before they merge?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Without the branch limitation, pull requests are tested twice.


## Cache composer bits
cache:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"consolidation/filter-via-dot-access-data": "^1",
"consolidation/output-formatters": "^3.3.1",
"consolidation/robo": "^1.4.6",
"consolidation/site-alias": "^3.0.0-beta1",
"consolidation/site-alias": "^3.0.0-beta3",
"consolidation/site-process": "^2.0.0-beta5",
"grasmash/yaml-expander": "^1.1.1",
"league/container": "~2",
Expand Down
45 changes: 17 additions & 28 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions includes/backend.inc
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ function _drush_backend_integrate($data, $backend_options, $outputted) {
// Drush (version 4.x) that does not send backend packets, then we will
// not have processed the log entries yet, and must print them here.
$received_packets = drush_get_context('DRUSH_RECEIVED_BACKEND_PACKETS', FALSE);
if (is_array($data['log']) && $backend_options['log'] && (!$received_packets)) {
if (is_array($data['log']) && !empty($backend_options['log']) && (!$received_packets)) {
foreach($data['log'] as $log) {
$message = is_array($log['message']) ? implode("\n", $log['message']) : $log['message'];
if (isset($backend_options['#output-label'])) {
Expand All @@ -303,7 +303,7 @@ function _drush_backend_integrate($data, $backend_options, $outputted) {
if (drush_cmp_error('DRUSH_APPLICATION_ERROR') && !empty($data['output'])) {
drush_set_error("DRUSH_APPLICATION_ERROR", dt("Output from failed command :\n !output", ['!output' => $data['output']]));
}
elseif ($backend_options['output']) {
elseif (!empty($backend_options['output'])) {
_drush_backend_print_output($data['output'], $backend_options);
}
}
Expand Down
8 changes: 6 additions & 2 deletions src/Commands/sql/SqlSyncCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,14 @@ public function databaseName(SiteAlias $record)
return 'simulated_db';
}

$process = $this->processManager()->drush($record, 'core-status', ['db-name'], ['format' => 'string']);
$process = $this->processManager()->drush($record, 'core-status', ['db-name'], ['format' => 'json']);
$process->setSimulated(false);
$process->mustRun();
return trim($process->getOutput());
$data = $process->getOutputAsJson();
if (!isset($data['db-name'])) {
throw new \Exception('Could not look up database name for ' . $record->name());
}
return trim($data['db-name']);
}

/**
Expand Down
3 changes: 3 additions & 0 deletions sut/drush/sites/self.site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fake:
root: /path/to/fake/root
uri: https://fake.example.com
17 changes: 1 addition & 16 deletions tests/functional/RsyncTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @group commands
* @group slow
*/
class RsyncCase extends CommandUnishTestCase
class RsyncTest extends CommandUnishTestCase
{

public function setUp()
Expand All @@ -34,21 +34,6 @@ public function testRsyncSimulated()
'alias-path' => __DIR__ . '/resources/alias-fixtures',
];

// Test simulated simple rsync with two local sites
$this->drush('rsync', ['@example.stage', '@example.dev'], $options, null, null, self::EXIT_SUCCESS, '2>&1');
$expected = "[notice] Simulating: rsync -e 'ssh ' -akz /path/to/stage /path/to/dev";
$this->assertOutputEquals($expected);

// Test simulated rsync with relative paths
$this->drush('rsync', ['@example.dev:files', '@example.stage:files'], $options, null, null, self::EXIT_SUCCESS, '2>&1');
$expected = "[notice] Simulating: rsync -e 'ssh ' -akz /path/to/dev/files /path/to/stage/files";
$this->assertOutputEquals($expected);

// Test simulated rsync on local machine with a remote target
$this->drush('rsync', ['@example.dev:files', '@example.live:files'], $options, null, null, self::EXIT_SUCCESS, '2>&1');
$expected = "[notice] Simulating: rsync -e 'ssh -o PasswordAuthentication=example' -akz /path/to/dev/files [email protected]:/path/on/service-provider/files";
$this->assertOutputEquals($expected);

// Test simulated backend invoke.
// Note that command-specific options are not processed for remote
// targets. The aliases are not interpreted at all until they recache
Expand Down
Loading