77
88namespace Magento \FunctionalTestingFramework \Console ;
99
10+ use Magento \FunctionalTestingFramework \Exceptions \TestFrameworkException ;
1011use Magento \FunctionalTestingFramework \Util \Logger \LoggingUtil ;
1112use Symfony \Component \Console \Command \Command ;
1213use Symfony \Component \Console \Input \ArrayInput ;
@@ -94,14 +95,16 @@ protected function execute(InputInterface $input, OutputInterface $output)
9495 $ process ->setWorkingDirectory (TESTS_BP );
9596 $ process ->setIdleTimeout (600 );
9697 $ process ->setTimeout (0 );
97- $ process ->run (
98+ $ codeceptReturnCode = $ process ->run (
9899 function ($ type , $ buffer ) use ($ output ) {
99- if ($ output ->isVerbose ()) {
100- $ output ->write ($ buffer );
101- }
100+ $ output ->write ($ buffer );
102101 }
103102 );
104103
104+ if ($ codeceptReturnCode !== 0 ) {
105+ throw new TestFrameworkException ("The codecept build command failed unexpectedly. Please see the above output for more details. " );
106+ }
107+
105108 if ($ input ->getOption ('upgrade ' )) {
106109 $ upgradeCommand = new UpgradeTestsCommand ();
107110 $ upgradeOptions = new ArrayInput (['path ' => TESTS_MODULE_PATH ]);
@@ -133,9 +136,7 @@ private function generateConfigFiles(OutputInterface $output)
133136 $ output ->writeln ("codeception.yml configuration successfully applied. " );
134137 }
135138
136- if ($ output ->isVerbose ()) {
137- $ output ->writeln ("codeception.yml applied to " . TESTS_BP . DIRECTORY_SEPARATOR . 'codeception.yml ' );
138- }
139+ $ output ->writeln ("codeception.yml applied to " . TESTS_BP . DIRECTORY_SEPARATOR . 'codeception.yml ' );
139140
140141 // copy the functional suite yml, will only copy if there are differences between the template the destination
141142 $ fileSystem ->copy (
@@ -144,10 +145,8 @@ private function generateConfigFiles(OutputInterface $output)
144145 );
145146 $ output ->writeln ('functional.suite.yml configuration successfully applied. ' );
146147
147- if ($ output ->isVerbose ()) {
148- $ output ->writeln ("functional.suite.yml applied to " .
149- TESTS_BP . DIRECTORY_SEPARATOR . 'tests ' . DIRECTORY_SEPARATOR . 'functional.suite.yml ' );
150- }
148+ $ output ->writeln ("functional.suite.yml applied to " .
149+ TESTS_BP . DIRECTORY_SEPARATOR . 'tests ' . DIRECTORY_SEPARATOR . 'functional.suite.yml ' );
151150
152151 $ fileSystem ->copy (
153152 FW_BP . '/etc/config/.credentials.example ' ,
0 commit comments