Skip to content

Commit c951fca

Browse files
[ACQE-4318] Reading files under groups folder
1 parent eed694b commit c951fca

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Magento/FunctionalTestingFramework/Suite/SuiteGenerator.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,16 @@ public function generateTestgroupmembership($testManifest)
169169

170170
// Path to groups folder
171171
$baseDir = FilePathFormatter::format(TESTS_MODULE_PATH);
172+
$path = $baseDir .'_generated/groups';
173+
174+
// Read all group files
175+
if (is_dir($path)) {
176+
$groupFiles = glob("$path/group*.txt");
177+
if ($groupFiles === false) {
178+
throw new RuntimeException("glob(): error with '$path'");
179+
}
180+
sort($groupFiles, SORT_NATURAL);
181+
}
172182

173183
// Read each file in the reverse order and form an array with groupId as key
174184
$groupNumber = 0;
@@ -181,7 +191,7 @@ public function generateTestgroupmembership($testManifest)
181191
// Output file path
182192
$memberShipFilePath = $baseDir.'_generated/testgroupmembership.txt';
183193

184-
file_put_contents($memberShipFilePath, "testing" . PHP_EOL, FILE_APPEND);
194+
file_put_contents($memberShipFilePath, "testing again" . PHP_EOL, FILE_APPEND);
185195

186196
}
187197

0 commit comments

Comments
 (0)