Skip to content

Commit 1ca312a

Browse files
authored
ACQE-5843 : Added Filter for excludeGroup
1 parent 34764af commit 1ca312a

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

src/Magento/FunctionalTestingFramework/Util/Script/TestDependencyUtil.php

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function getModuleName(string $filePath, array $moduleNameToPath): ?strin
147147
* @param array $extendedTestMapping
148148
* @return array
149149
*/
150-
public function mergeDependenciesForExtendingTests(array $testDependencies, array $extendedTestMapping = []): array
150+
public function mergeDependenciesForExtendingTests(array $testDependencies, $filterList, array $extendedTestMapping = []): array
151151
{
152152
$temp_array = array_reverse(array_column($testDependencies, "test_name"), true);
153153
if (!empty($extendedTestMapping)) {
@@ -165,19 +165,30 @@ public function mergeDependenciesForExtendingTests(array $testDependencies, arra
165165
}
166166
$testDependencies = [];
167167
foreach ($temp_array as $testDependencyArray) {
168-
$testDependencies[] = [
169-
"file_path" => array_column($testDependencyArray, 'file_path'),
170-
"full_name" => $testDependencyArray[0]["full_name"],
171-
"test_name" => $testDependencyArray[0]["test_name"],
172-
"test_modules" =>array_values(
173-
array_unique(
174-
call_user_func_array(
175-
'array_merge',
176-
array_column($testDependencyArray, 'test_modules')
168+
$filTerString = [];
169+
$contents = "";
170+
$flag = false;
171+
foreach ($filterList['excludeGroup'] as $filterListData) {
172+
$contents = file_get_contents($testDependencyArray[0]["file_path"]);
173+
if (str_contains($contents, $filterListData)) {
174+
$flag = true;
175+
}
176+
}
177+
if ($flag == false) {
178+
$testDependencies[] = [
179+
"file_path" => array_column($testDependencyArray, 'file_path'),
180+
"full_name" => $testDependencyArray[0]["full_name"],
181+
"test_name" => $testDependencyArray[0]["test_name"],
182+
"test_modules" => array_values(
183+
array_unique(
184+
call_user_func_array(
185+
'array_merge',
186+
array_column($testDependencyArray, 'test_modules')
187+
)
177188
)
178-
)
179-
),
180-
];
189+
),
190+
];
191+
}
181192
}
182193
return $testDependencies;
183194
}

0 commit comments

Comments
 (0)