@@ -59,6 +59,10 @@ protected function configure()
59
59
*/
60
60
protected function execute (InputInterface $ input , OutputInterface $ output ): int
61
61
{
62
+ $ this ->testsFailedFile = $ this ->getTestsOutputDir () . self ::FAILED_FILE ;
63
+ $ this ->testsReRunFile = $ this ->getTestsOutputDir () . "rerun_tests " ;
64
+ $ failedTestList = $ this ->readFailedTestFile ($ this ->testsFailedFile );
65
+
62
66
$ this ->testsManifestFile = FilePathFormatter::format (TESTS_MODULE_PATH ) .
63
67
"_generated " .
64
68
DIRECTORY_SEPARATOR .
@@ -67,6 +71,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
67
71
$ testManifestList = $ this ->readTestManifestFile ();
68
72
$ returnCode = 0 ;
69
73
for ($ i = 0 ; $ i < count ($ testManifestList ); $ i ++) {
74
+ if (in_array ($ testManifestList [$ i ], $ failedTestList ) === false ) {
75
+ continue ;
76
+ }
70
77
if ($ this ->pauseEnabled ()) {
71
78
$ codeceptionCommand = self ::CODECEPT_RUN_FUNCTIONAL . $ testManifestList [$ i ] . ' --debug ' ;
72
79
if ($ i !== count ($ testManifestList ) - 1 ) {
@@ -86,6 +93,7 @@ function ($type, $buffer) use ($output) {
86
93
$ output ->write ($ buffer );
87
94
}
88
95
));
96
+ $ process ->__destruct ();
89
97
}
90
98
91
99
if (file_exists ($ this ->testsFailedFile )) {
@@ -121,7 +129,14 @@ private function readTestManifestFile()
121
129
*/
122
130
private function readFailedTestFile ($ filePath )
123
131
{
124
- return file ($ filePath , FILE_IGNORE_NEW_LINES );
132
+ $ failedTests = file ($ filePath , FILE_IGNORE_NEW_LINES );
133
+ if ($ failedTests !== false ) {
134
+ foreach ($ failedTests as $ key => $ failedTest ) {
135
+ list ($ filePath ) = explode (": " , $ failedTest );
136
+ $ failedTests [$ key ] = $ filePath ;
137
+ }
138
+ }
139
+ return $ failedTests ;
125
140
}
126
141
127
142
/**
0 commit comments