Skip to content

Commit b4002b3

Browse files
authored
Merge pull request #311 from magento/develop
MFTF 2.3.14 - Merge develop to master
2 parents 2c8a4c3 + 7044b70 commit b4002b3

File tree

5 files changed

+31
-10
lines changed

5 files changed

+31
-10
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Magento Functional Testing Framework Changelog
22
================================================
33

4+
2.3.14
5+
-----
6+
### Enhancements
7+
* Maintainability
8+
* `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.
9+
410
2.3.13
511
-----
612
### Enhancements

bin/mftf

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ try {
2929
try {
3030
$application = new Symfony\Component\Console\Application();
3131
$application->setName('Magento Functional Testing Framework CLI');
32-
$application->setVersion('2.3.13');
32+
$application->setVersion('2.3.14');
3333
/** @var \Magento\FunctionalTestingFramework\Console\CommandListInterface $commandList */
3434
$commandList = new \Magento\FunctionalTestingFramework\Console\CommandList;
3535
foreach ($commandList->getCommands() as $command) {

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/magento2-functional-testing-framework",
33
"description": "Magento2 Functional Testing Framework",
44
"type": "library",
5-
"version": "2.3.13",
5+
"version": "2.3.14",
66
"license": "AGPL-3.0",
77
"keywords": ["magento", "automation", "functional", "testing"],
88
"config": {

composer.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

etc/config/command.php

+22-7
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,32 @@
2727
$magentoBinary = $php . ' -f ../../../../bin/magento';
2828
$valid = validateCommand($magentoBinary, $command);
2929
if ($valid) {
30-
exec(
31-
escapeCommand($magentoBinary . " $command" . " $arguments") . " 2>&1",
32-
$output,
33-
$exitCode
34-
);
35-
if ($exitCode == 0) {
30+
$process = new Symfony\Component\Process\Process($magentoBinary . " $command" . " $arguments");
31+
$process->setIdleTimeout(60);
32+
$process->setTimeout(0);
33+
$idleTimeout = false;
34+
try {
35+
$process->run();
36+
$output = $process->getOutput();
37+
if (!$process->isSuccessful()) {
38+
$output = $process->getErrorOutput();
39+
}
40+
if (empty($output)) {
41+
$output = "CLI did not return output.";
42+
}
43+
44+
} catch (Symfony\Component\Process\Exception\ProcessTimedOutException $exception) {
45+
$output = "CLI command timed out, no output available.";
46+
$idleTimeout = true;
47+
}
48+
$exitCode = $process->getExitCode();
49+
50+
if ($exitCode == 0 || $idleTimeout) {
3651
http_response_code(202);
3752
} else {
3853
http_response_code(500);
3954
}
40-
echo implode("\n", $output);
55+
echo $output;
4156
} else {
4257
http_response_code(403);
4358
echo "Given command not found valid in Magento CLI Command list.";

0 commit comments

Comments
 (0)