Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow integration tests to test commands that have confirmations #3823

Merged
merged 3 commits into from
Dec 11, 2018

Conversation

greg-1-anderson
Copy link
Member

Pass --yes to confirm.

@@ -133,7 +133,7 @@ protected function buildCommandLine($command, $args, $options)
}
// insert drush command options
foreach ($options as $key => $value) {
if (!isset($value)) {
if (!isset($value) || $value === true) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Usually, 'yes' => true gives --yes, and 'yes' => '1' gives --yes=1. I've always found the Unish-style 'yes' => null to be confusing. Would it be okay to switch to true everywhere? We should also support null for external unish clients.

Copy link
Member

Choose a reason for hiding this comment

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

Yes feel free to change that.

@greg-1-anderson greg-1-anderson force-pushed the integration-tests-with-confirmations branch from b6cbfc0 to a12175a Compare December 11, 2018 02:43
@greg-1-anderson
Copy link
Member Author

Just one trivial question before merging. We can stick with 'yes' => null if you feel strongly about it.

@@ -102,7 +102,7 @@ public function drush($command, array $args = [], array $options = [], $expected
protected function buildCommandLine($command, $args, $options)
{
$global_option_list = ['simulate', 'root', 'uri', 'include', 'config', 'alias-path', 'ssh-options', 'backend', 'cd'];
$options += ['root' => $this->webroot(), 'uri' => self::INTEGRATION_TEST_ENV]; // Default value.
$options += ['root' => $this->webroot(), 'uri' => self::INTEGRATION_TEST_ENV, 'strict' => 0]; // Default value.
Copy link
Member

Choose a reason for hiding this comment

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

Why disable strict mode?

Copy link
Member Author

Choose a reason for hiding this comment

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

Disabling strict mode bypasses argument validation. We can try without this.

{

public function testWatchdog()
{
$this->setUpDrupal(1, true);
$this->drush('pm-enable', ['dblog']);
$this->drush('pm-enable', ['dblog'], [], self::IGNORE_EXIT_CODE);
Copy link
Member

Choose a reason for hiding this comment

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

Why ignore exit code here?

Copy link
Member Author

Choose a reason for hiding this comment

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

We might enable modules again and again. I guess that enabling an already-enabled module is not an error, so we can remove this.

@greg-1-anderson
Copy link
Member Author

It worked to remove strict mode; it was also fine to remove the ignore errors flag.

@greg-1-anderson greg-1-anderson merged commit 5995adf into master Dec 11, 2018
@weitzman weitzman deleted the integration-tests-with-confirmations branch December 13, 2019 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants