Skip to content

magento/magento2#32679: setup:upgrade --dry-run does not work as expected by other dry-run-commands in Linux-environment #33332

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

Open
wants to merge 11 commits into
base: 2.4-develop
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public function disableModule($moduleName)
* @return void
* @throws LocalizedException
* @deprecated split database solution is deprecated and will be removed
* @see Nothing
*/
public function splitQuote()
{
Expand All @@ -141,6 +142,7 @@ public function splitQuote()
* @return void
* @throws LocalizedException
* @deprecated split database solution is deprecated and will be removed
* @see Nothing
*/
public function splitSales()
{
Expand Down Expand Up @@ -199,7 +201,9 @@ private function toCliArguments(array $params)
$result = [];

foreach ($params as $key => $value) {
if (!empty($value)) {
if ($value === $key) {
$result["--{$key}"] = null;
} elseif (!empty($value)) {
$result["--{$key}=%s"] = $value;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function testDryRunOnCleanDatabase()
$logFileName = TESTS_TEMP_DIR . '/var/log/' . DryRunLogger::FILE_NAME;
$this->cliCommad->install(
['Magento_TestSetupDeclarationModule1'],
['dry-run' => true]
['dry-run' => 'dry-run']
);
self::assertFileExists($logFileName);
$data = file_get_contents($logFileName);
Expand All @@ -64,7 +64,7 @@ public function testDryRunOnUpgrade()
'db_schema.xml',
'etc'
);
$this->cliCommad->upgrade(['dry-run' => true]);
$this->cliCommad->upgrade(['dry-run' => 'dry-run']);
self::assertFileExists($logFileName);
$data = file_get_contents($logFileName);
self::assertEquals($this->getData()[0], $data);
Expand Down
5 changes: 2 additions & 3 deletions setup/src/Magento/Setup/Console/Command/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,8 @@ protected function configure()
new InputOption(
DryRunLogger::INPUT_KEY_DRY_RUN_MODE,
null,
InputOption::VALUE_OPTIONAL,
'Magento Installation will be run in dry-run mode',
false
InputOption::VALUE_NONE,
'Magento Installation will be run in dry-run mode'
),
]);
$this->setName('setup:install')
Expand Down
5 changes: 2 additions & 3 deletions setup/src/Magento/Setup/Console/Command/UpgradeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,8 @@ protected function configure()
new InputOption(
DryRunLogger::INPUT_KEY_DRY_RUN_MODE,
null,
InputOption::VALUE_OPTIONAL,
'Magento Installation will be run in dry-run mode',
false
InputOption::VALUE_NONE,
'Magento Installation will be run in dry-run mode'
)
];
$this->setName('setup:upgrade')
Expand Down