Skip to content

Commit 55e0bed

Browse files
committed
MQE-1800: Allow generate:tests to continue running even if one test fails generation
1 parent 09a579c commit 55e0bed

File tree

1 file changed

+29
-8
lines changed

1 file changed

+29
-8
lines changed

src/Magento/FunctionalTestingFramework/Util/GenerationErrorHandler.php

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,37 @@ public function reset()
108108
*/
109109
public function printErrorSummary()
110110
{
111+
111112
if (is_array(array_keys($this->errors))) {
112113
foreach (array_keys($this->errors) as $type) {
113-
print(
114-
PHP_EOL
115-
. 'ERROR: '
116-
. strval(count($this->getErrorsByType($type)))
117-
. ' '
118-
. ucfirst($type)
119-
. " failed to generate or generated but with annotation errors"
120-
);
114+
$totalErrors = count($this->getErrorsByType($type));
115+
$totalAnnotationErrors = 0;
116+
foreach ($this->getErrorsByType($type) as $entity => $error) {
117+
if ($error['generated'] == true) {
118+
$totalAnnotationErrors++;
119+
}
120+
}
121+
$totalNotGenErrors = $totalErrors - $totalAnnotationErrors;
122+
if ($totalNotGenErrors > 0) {
123+
print(
124+
PHP_EOL
125+
. 'ERROR: '
126+
. strval($totalNotGenErrors)
127+
. ' '
128+
. ucfirst($type)
129+
. " failed to generate"
130+
);
131+
}
132+
if ($totalAnnotationErrors > 0) {
133+
print(
134+
PHP_EOL
135+
. 'ERROR: '
136+
. strval($totalAnnotationErrors)
137+
. ' '
138+
. ucfirst($type)
139+
. " generated with annotation errors"
140+
);
141+
}
121142
}
122143
print(PHP_EOL);
123144
}

0 commit comments

Comments
 (0)