Skip to content

Commit 8ac5662

Browse files
committed
MQE-1800: Allow generate:tests to continue running even if one test fails generation
1 parent a89e2b0 commit 8ac5662

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function generateAllSuites($testManifest)
102102
try {
103103
if (empty($suiteContent)) {
104104
LoggingUtil::getInstance()->getLogger(self::class)->notification(
105-
"NOTICE: Suite '" . $suiteName . "' contains no tests and won't be generated." . PHP_EOL,
105+
"Suite '" . $suiteName . "' contains no tests and won't be generated.",
106106
[],
107107
true
108108
);
@@ -182,7 +182,13 @@ private function generateSuiteFromTest($suiteName, $tests = [], $originalSuiteNa
182182

183183
if (empty($relevantTests)) {
184184
$exceptionCollector->reset();
185-
throw new TestFrameworkException("No relevant test found for suite \"{$suiteName}\"");
185+
// There are suites that include no test on purpose for certain Magento edition.
186+
// To keep backward compatibility, we will return with no error.
187+
// This might inevitably hide some suite errors that are resulted by real broken tests.
188+
if (file_exists($fullPath)) {
189+
DirSetupUtil::rmdirRecursive($fullPath);
190+
}
191+
return;
186192
}
187193

188194
try {

src/Magento/FunctionalTestingFramework/Util/TestGenerator.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -357,15 +357,12 @@ private function assembleAllTestPhp($testManifest, array $testsToIgnore)
357357
TestObjectHandler::getInstance()->sanitizeTests([$test->getName()]);
358358
$errMessage = "{$test->getName()} will not be generated. "
359359
. "Parent test {$test->getParentName()} not defined in xml.";
360+
// There are tests extend from non-existing parent on purpose on certain Magento editions.
361+
// To keep backward compatibility, we will skip the test and continue
360362
if (MftfApplicationConfig::getConfig()->verboseEnabled()) {
361-
print("ERROR: {$errMessage}");
363+
print("NOTICE: {$errMessage}");
362364
}
363-
LoggingUtil::getInstance()->getLogger(self::class)->error($errMessage);
364-
GenerationErrorHandler::getInstance()->addError(
365-
'test',
366-
$test->getName(),
367-
self::class . ': ' . $errMessage
368-
);
365+
LoggingUtil::getInstance()->getLogger(self::class)->warn($errMessage);
369366
continue;
370367
}
371368
}

0 commit comments

Comments
 (0)