@@ -515,15 +515,19 @@ public function scrollToTopOfPage()
515
515
* @return string
516
516
* @throws TestFrameworkException
517
517
*/
518
- public function magentoCLI ($ command , $ arguments = null )
518
+ public function magentoCLI ($ command , $ timeout = null , $ arguments = null )
519
519
{
520
- try {
520
+ //TODO: shellExecMagentoCLI is causing pipeline steps to fail, needs investigation
521
+ return $ this ->curlExecMagentoCLI ($ command , $ timeout , $ arguments , $ timeout );
522
+ /* try {
521
523
return $this->shellExecMagentoCLI($command, $arguments);
522
524
} catch (\Exception $exception) {
523
525
return $this->curlExecMagentoCLI($command, $arguments);
524
- }
526
+ }
527
+ */
525
528
}
526
529
530
+
527
531
/**
528
532
* Runs DELETE request to delete a Magento entity against the url given.
529
533
*
@@ -834,17 +838,18 @@ public function makeScreenshot($name = null)
834
838
*
835
839
* @param string $command
836
840
* @param string $arguments
841
+ * @param string $timeout
837
842
*
838
843
* @throws \RuntimeException
839
844
* @return string
840
845
*/
841
- private function shellExecMagentoCLI ($ command , $ arguments ): string
846
+ private function shellExecMagentoCLI ($ command , $ timeout ): string
842
847
{
843
848
$ php = PHP_BINDIR ? PHP_BINDIR . DIRECTORY_SEPARATOR . 'php ' : 'php ' ;
844
849
$ binMagento = realpath (MAGENTO_BP . DIRECTORY_SEPARATOR . 'bin ' . DIRECTORY_SEPARATOR . 'magento ' );
845
- $ command = $ php . ' -f ' . $ binMagento . ' ' . $ command . ' ' . $ arguments ;
850
+ $ command = $ php . ' -f ' . $ binMagento . ' ' . $ command ;
846
851
$ process = new Process (escapeshellcmd ($ command ), MAGENTO_BP );
847
- $ process ->setIdleTimeout (60 );
852
+ $ process ->setIdleTimeout ($ timeout );
848
853
$ process ->setTimeout (0 );
849
854
$ exitCode = $ process ->run ();
850
855
if ($ exitCode !== 0 ) {
@@ -859,10 +864,11 @@ private function shellExecMagentoCLI($command, $arguments): string
859
864
*
860
865
* @param string $command
861
866
* @param string $arguments
867
+ * @param string $timeout
862
868
* @return string
863
869
* @throws TestFrameworkException
864
870
*/
865
- private function curlExecMagentoCLI ($ command , $ arguments ): string
871
+ private function curlExecMagentoCLI ($ command , $ timeout , $ arguments ): string
866
872
{
867
873
// Remove index.php if it's present in url
868
874
$ baseUrl = rtrim (
@@ -879,6 +885,7 @@ private function curlExecMagentoCLI($command, $arguments): string
879
885
'token ' => $ restExecutor ->getAuthToken (),
880
886
getenv ('MAGENTO_CLI_COMMAND_PARAMETER ' ) => $ command ,
881
887
'arguments ' => $ arguments ,
888
+ 'timeout ' => $ timeout ,
882
889
],
883
890
CurlInterface::POST ,
884
891
[]
0 commit comments