@@ -59,13 +59,13 @@ protected function configure()
59
59
*
60
60
* @param InputInterface $input
61
61
* @param OutputInterface $output
62
- * @return integer|null|void
62
+ * @return integer
63
63
* @throws \Exception
64
64
*
65
65
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
66
66
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
67
67
*/
68
- protected function execute (InputInterface $ input , OutputInterface $ output )
68
+ protected function execute (InputInterface $ input , OutputInterface $ output ): int
69
69
{
70
70
// Create Mftf Configuration
71
71
MftfApplicationConfig::create (
@@ -78,7 +78,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
78
78
$ testConfiguration = $ this ->getFailedTestList ();
79
79
80
80
if ($ testConfiguration === null ) {
81
- return null ;
81
+ // no failed tests found, run is a success
82
+ return 0 ;
82
83
}
83
84
84
85
$ command = $ this ->getApplication ()->find ('generate:tests ' );
@@ -87,7 +88,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
87
88
$ command ->run (new ArrayInput ($ args ), $ output );
88
89
89
90
$ testManifestList = $ this ->readTestManifestFile ();
90
-
91
+ $ returnCode = 0 ;
91
92
foreach ($ testManifestList as $ testCommand ) {
92
93
$ codeceptionCommand = realpath (PROJECT_ROOT . '/vendor/bin/codecept ' ) . ' run functional ' ;
93
94
$ codeceptionCommand .= $ testCommand ;
@@ -96,11 +97,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
96
97
$ process ->setWorkingDirectory (TESTS_BP );
97
98
$ process ->setIdleTimeout (600 );
98
99
$ process ->setTimeout (0 );
99
- $ process ->run (
100
+ $ returnCode = max ( $ returnCode , $ process ->run (
100
101
function ($ type , $ buffer ) use ($ output ) {
101
102
$ output ->write ($ buffer );
102
103
}
103
- );
104
+ )) ;
104
105
if (file_exists (self ::TESTS_FAILED_FILE )) {
105
106
$ this ->failedList = array_merge (
106
107
$ this ->failedList ,
@@ -111,6 +112,8 @@ function ($type, $buffer) use ($output) {
111
112
foreach ($ this ->failedList as $ test ) {
112
113
$ this ->writeFailedTestToFile ($ test , self ::TESTS_FAILED_FILE );
113
114
}
115
+
116
+ return $ returnCode ;
114
117
}
115
118
116
119
/**
0 commit comments