Skip to content

Commit 0e22424

Browse files
authored
Merge pull request #31444 from jhanders34/branch3
Add product extensions to auto feature check
2 parents 49036cd + 13bd829 commit 0e22424

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

dev/fattest.simplicity/src/componenttest/rules/repeater/FeatureUtilities.java

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2022, 2024 IBM Corporation and others.
2+
* Copyright (c) 2022, 2025 IBM Corporation and others.
33
* All rights reserved. This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License 2.0
55
* which accompanies this distribution, and is available at
@@ -376,25 +376,34 @@ private static boolean isTestAutoFeature(File featureFile) throws IOException {
376376
return isAutoFeature && isTestFeature;
377377
}
378378

379+
/**
380+
* Removes any test auto features left around from earlier test runs.
381+
* Mostly this removing test auto features from when com.ibm.ws.ui_rest_fat times out.
382+
*
383+
* @param installRoot
384+
*/
379385
public static void removeTestAutoFeatures(File installRoot) {
380386

381-
// If there was a problem building projects before this test runs,
382-
// "lib/features" may not exist.
383-
384-
File featureDir = new File(installRoot, "lib/features");
385-
if (!featureDir.exists()) {
386-
return;
387-
}
387+
// Include Liberty install location and product extension locations
388+
File installParent = installRoot.getParentFile();
389+
File[] productDirs = installParent.listFiles((file) -> file.isDirectory());
390+
for (File productDir : productDirs) {
391+
// If there was a problem building projects before this test runs
392+
// or if a product extension doesn't have features, "lib/features" may not exist.
393+
File featureDir = new File(productDir, "lib/features");
394+
if (!featureDir.exists()) {
395+
continue;
396+
}
388397

389-
try {
390-
for (File featureFile : featureDir.listFiles()) {
391-
if (isTestAutoFeature(featureFile)) {
392-
featureFile.delete();
393-
continue;
398+
try {
399+
for (File featureFile : featureDir.listFiles()) {
400+
if (isTestAutoFeature(featureFile)) {
401+
featureFile.delete();
402+
}
394403
}
404+
} catch (Exception e) {
405+
throw new RuntimeException(e);
395406
}
396-
} catch (Exception e) {
397-
throw new RuntimeException(e);
398407
}
399408
}
400409
}

0 commit comments

Comments
 (0)