@@ -525,8 +525,9 @@ public function magentoCLI($command, $timeout = null, $arguments = null)
525525 {
526526 $ magentoBinary = realpath (MAGENTO_BP . DIRECTORY_SEPARATOR . 'bin ' . DIRECTORY_SEPARATOR . 'magento ' );
527527 $ valid = $ this ->validateCommand ($ magentoBinary , $ command );
528- // execute from shell when running tests from web root.
529- if ($ valid ) {
528+ // execute from shell when running tests from web root -- excluding cron
529+ //TODO: investigate why cron:run hangs with shell execution on pipeline
530+ if ($ valid && ($ command !== self ::COMMAND_CRON_RUN )) {
530531 return $ this ->shellExecMagentoCLI ($ magentoBinary , $ command , $ timeout , $ arguments );
531532 } else {
532533 return $ this ->curlExecMagentoCLI ($ command , $ timeout , $ arguments );
@@ -859,13 +860,11 @@ private function shellExecMagentoCLI($magentoBinary, $command, $timeout, $argume
859860 $ process ->setTimeout (0 );
860861 try {
861862 $ process ->run ();
862- if (strpos ($ command , self ::COMMAND_CRON_RUN ) === false ) {
863- $ output = $ process ->getOutput ();
864- if (!$ process ->isSuccessful ()) {
865- $ failureOutput = $ process ->getErrorOutput ();
866- if (!empty ($ failureOutput )) {
867- $ output = $ failureOutput ;
868- }
863+ $ output = $ process ->getOutput ();
864+ if (!$ process ->isSuccessful ()) {
865+ $ failureOutput = $ process ->getErrorOutput ();
866+ if (!empty ($ failureOutput )) {
867+ $ output = $ failureOutput ;
869868 }
870869 }
871870 if (empty ($ output )) {
0 commit comments