|
21 | 21 | use Magento\FunctionalTestingFramework\Util\ConfigSanitizerUtil;
|
22 | 22 | use Yandex\Allure\Adapter\AllureException;
|
23 | 23 | use Magento\FunctionalTestingFramework\Util\Protocol\CurlTransport;
|
24 |
| -use Symfony\Component\Process\Process; |
25 | 24 | use Yandex\Allure\Adapter\Support\AttachmentSupport;
|
26 | 25 | use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException;
|
27 | 26 | use Magento\FunctionalTestingFramework\Config\MftfApplicationConfig;
|
@@ -522,13 +521,35 @@ public function scrollToTopOfPage()
|
522 | 521 | */
|
523 | 522 | public function magentoCLI($command, $timeout = null, $arguments = null)
|
524 | 523 | {
|
525 |
| - return $this->curlExecMagentoCLI($command, $timeout, $arguments); |
526 |
| - //TODO: calling bin/magento from pipeline is timing out, needs investigation (ref: MQE-1774) |
527 |
| -// try { |
528 |
| -// return $this->shellExecMagentoCLI($command, $arguments); |
529 |
| -// } catch (\Exception $exception) { |
530 |
| -// return $this->curlExecMagentoCLI($command, $arguments); |
531 |
| -// } |
| 524 | + // Remove index.php if it's present in url |
| 525 | + $baseUrl = rtrim( |
| 526 | + str_replace('index.php', '', rtrim($this->config['url'], '/')), |
| 527 | + '/' |
| 528 | + ); |
| 529 | + |
| 530 | + $apiURL = UrlFormatter::format( |
| 531 | + $baseUrl . '/' . ltrim(getenv('MAGENTO_CLI_COMMAND_PATH'), '/'), |
| 532 | + false |
| 533 | + ); |
| 534 | + |
| 535 | + $restExecutor = new WebapiExecutor(); |
| 536 | + $executor = new CurlTransport(); |
| 537 | + $executor->write( |
| 538 | + $apiURL, |
| 539 | + [ |
| 540 | + 'token' => $restExecutor->getAuthToken(), |
| 541 | + getenv('MAGENTO_CLI_COMMAND_PARAMETER') => $command, |
| 542 | + 'arguments' => $arguments, |
| 543 | + 'timeout' => $timeout, |
| 544 | + ], |
| 545 | + CurlInterface::POST, |
| 546 | + [] |
| 547 | + ); |
| 548 | + $response = $executor->read(); |
| 549 | + $restExecutor->close(); |
| 550 | + $executor->close(); |
| 551 | + |
| 552 | + return $response; |
532 | 553 | }
|
533 | 554 |
|
534 | 555 | /**
|
|
0 commit comments