@@ -54,6 +54,11 @@ protected function configure()
54
54
*/
55
55
protected function execute (InputInterface $ input , OutputInterface $ output ): int
56
56
{
57
+ $ returnCode = $ this ->executeGenerateFailed ($ input , $ output );
58
+ if ($ returnCode !== 0 ) {
59
+ return $ returnCode ;
60
+ }
61
+
57
62
$ this ->testsFailedFile = $ this ->getTestsOutputDir () . self ::FAILED_FILE ;
58
63
$ this ->testsReRunFile = $ this ->getTestsOutputDir () . "rerun_tests " ;
59
64
@@ -85,6 +90,7 @@ function ($type, $buffer) use ($output) {
85
90
}
86
91
));
87
92
$ process ->__destruct ();
93
+ unset($ process );
88
94
}
89
95
90
96
if (file_exists ($ this ->testsFailedFile )) {
@@ -102,6 +108,35 @@ function ($type, $buffer) use ($output) {
102
108
return $ returnCode ;
103
109
}
104
110
111
+ /**
112
+ * @param OutputInterface $output
113
+ * @return mixed
114
+ */
115
+ private function executeGenerateFailed (InputInterface $ input , OutputInterface $ output )
116
+ {
117
+ $ returnCode = 0 ;
118
+ $ binMftf = PROJECT_ROOT . '/vendor/bin/mftf ' ;
119
+ if (file_exists ($ binMftf ) === false ) {
120
+ $ binMftf = PROJECT_ROOT . '/bin/mftf ' ;
121
+ }
122
+ $ forceGenerate = $ input ->getOption ('force ' ) ? ' -f ' : '' ;
123
+ $ mftfCommand = realpath ($ binMftf ) . ' generate:failed ' . $ forceGenerate ;
124
+
125
+ $ process = new Process ($ mftfCommand );
126
+ $ process ->setWorkingDirectory (TESTS_BP );
127
+ $ process ->setIdleTimeout (600 );
128
+ $ process ->setTimeout (0 );
129
+ $ returnCode = max ($ returnCode , $ process ->run (
130
+ function ($ type , $ buffer ) use ($ output ) {
131
+ $ output ->write ($ buffer );
132
+ }
133
+ ));
134
+ $ process ->__destruct ();
135
+ unset($ process );
136
+
137
+ return $ returnCode ;
138
+ }
139
+
105
140
/**
106
141
* Returns an array of run commands read from the manifest file created post generation
107
142
*
0 commit comments