Skip to content

Commit c787327

Browse files
committed
MQE-893: Add flag to robo generate: tests which accepts a specific set of tests to execute
- refactor the custom test configuration to use tests/suites in the global scope
1 parent 53629a0 commit c787327

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

dev/tests/acceptance/RoboFile.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function generateTests(array $tests, $opts = [
132132
if ($opts['tests'] != null) {
133133
$testConfigArray = json_decode($opts['tests'],true);
134134
$tests = $testConfigArray['tests'] ?? [];
135-
$suitesReferences = $testConfigArray['suites'] ?? [];
135+
$suitesReferences = $testConfigArray['suites'] ?? null;
136136
}
137137

138138
// stop execution if we have failed to properly parse any json
@@ -152,9 +152,16 @@ function generateTests(array $tests, $opts = [
152152
// maintain backwards compatability for devops
153153
$lines = $opts['lines'] ?? $opts ['nodes'];
154154

155-
$testsReferencedInSuites = \Magento\FunctionalTestingFramework\Suite\SuiteGenerator::getInstance($suitesReferences)->getTestsReferencedInSuites();
156-
$testManifest = \Magento\FunctionalTestingFramework\Util\TestGenerator::getInstance(null, $testObjects)->createAllTestFiles($opts['config'], $lines, $testsReferencedInSuites);
155+
// create our manifest file here
156+
$testManifest = \Magento\FunctionalTestingFramework\Util\Manifest\TestManifestFactory::makeManifest($opts['config'],$suitesReferences);
157+
\Magento\FunctionalTestingFramework\Util\TestGenerator::getInstance(null, $testObjects)->createAllTestFiles($testManifest);
158+
159+
if ($opts['config'] == 'parallel') {
160+
$testManifest->createTestGroups($lines);
161+
}
162+
157163
\Magento\FunctionalTestingFramework\Suite\SuiteGenerator::getInstance()->generateAllSuites($testManifest);
164+
$testManifest->generate();
158165

159166
$this->say("Generate Tests Command Run");
160167
}

0 commit comments

Comments
 (0)