7
7
8
8
namespace Magento \FunctionalTestingFramework \Console ;
9
9
10
+ use Magento \FunctionalTestingFramework \Exceptions \TestFrameworkException ;
10
11
use Magento \FunctionalTestingFramework \Util \Logger \LoggingUtil ;
11
12
use Symfony \Component \Console \Command \Command ;
12
13
use Symfony \Component \Console \Input \ArrayInput ;
@@ -94,14 +95,16 @@ protected function execute(InputInterface $input, OutputInterface $output)
94
95
$ process ->setWorkingDirectory (TESTS_BP );
95
96
$ process ->setIdleTimeout (600 );
96
97
$ process ->setTimeout (0 );
97
- $ process ->run (
98
+ $ codeceptReturnCode = $ process ->run (
98
99
function ($ type , $ buffer ) use ($ output ) {
99
- if ($ output ->isVerbose ()) {
100
- $ output ->write ($ buffer );
101
- }
100
+ $ output ->write ($ buffer );
102
101
}
103
102
);
104
103
104
+ if ($ codeceptReturnCode !== 0 ) {
105
+ throw new TestFrameworkException ("The codecept build command failed unexpectedly. Please see the above output for more details. " );
106
+ }
107
+
105
108
if ($ input ->getOption ('upgrade ' )) {
106
109
$ upgradeCommand = new UpgradeTestsCommand ();
107
110
$ upgradeOptions = new ArrayInput (['path ' => TESTS_MODULE_PATH ]);
@@ -133,9 +136,7 @@ private function generateConfigFiles(OutputInterface $output)
133
136
$ output ->writeln ("codeception.yml configuration successfully applied. " );
134
137
}
135
138
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 ' );
139
140
140
141
// copy the functional suite yml, will only copy if there are differences between the template the destination
141
142
$ fileSystem ->copy (
@@ -144,10 +145,8 @@ private function generateConfigFiles(OutputInterface $output)
144
145
);
145
146
$ output ->writeln ('functional.suite.yml configuration successfully applied. ' );
146
147
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 ' );
151
150
152
151
$ fileSystem ->copy (
153
152
FW_BP . '/etc/config/.credentials.example ' ,
0 commit comments