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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Magento Functional Testing Framework Changelog
================================================

2.3.14
-----
### Enhancements
* Maintainability
* `command.php` is now configured with an `idleTimeout` of `60` seconds, which will allow tests to continue execution if a CLI command is hanging indefinitely.

2.3.13
-----
### Enhancements
Expand Down
2 changes: 1 addition & 1 deletion bin/mftf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ try {
try {
$application = new Symfony\Component\Console\Application();
$application->setName('Magento Functional Testing Framework CLI');
$application->setVersion('2.3.13');
$application->setVersion('2.3.14');
/** @var \Magento\FunctionalTestingFramework\Console\CommandListInterface $commandList */
$commandList = new \Magento\FunctionalTestingFramework\Console\CommandList;
foreach ($commandList->getCommands() as $command) {
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magento/magento2-functional-testing-framework",
"description": "Magento2 Functional Testing Framework",
"type": "library",
"version": "2.3.13",
"version": "2.3.14",
"license": "AGPL-3.0",
"keywords": ["magento", "automation", "functional", "testing"],
"config": {
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

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

29 changes: 22 additions & 7 deletions etc/config/command.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,32 @@
$magentoBinary = $php . ' -f ../../../../bin/magento';
$valid = validateCommand($magentoBinary, $command);
if ($valid) {
exec(
escapeCommand($magentoBinary . " $command" . " $arguments") . " 2>&1",
$output,
$exitCode
);
if ($exitCode == 0) {
$process = new Symfony\Component\Process\Process($magentoBinary . " $command" . " $arguments");
$process->setIdleTimeout(60);
$process->setTimeout(0);
$idleTimeout = false;
try {
$process->run();
$output = $process->getOutput();
if (!$process->isSuccessful()) {
$output = $process->getErrorOutput();
}
if (empty($output)) {
$output = "CLI did not return output.";
}

} catch (Symfony\Component\Process\Exception\ProcessTimedOutException $exception) {
$output = "CLI command timed out, no output available.";
$idleTimeout = true;
}
$exitCode = $process->getExitCode();

if ($exitCode == 0 || $idleTimeout) {
http_response_code(202);
} else {
http_response_code(500);
}
echo implode("\n", $output);
echo $output;
} else {
http_response_code(403);
echo "Given command not found valid in Magento CLI Command list.";
Expand Down