Skip to content

Commit

Permalink
Update feature flag handling for required features
Browse files Browse the repository at this point in the history
- Removed `null` statement from `required` feature check to ensure all required features are processed.
- Allows the code to continue checking all feature flags, even after finding a required flag in `testFlags`.
- Added test_not_arch_390_z15plus_0 into passed list for running TKG test PR in github actions as no microarch version is detected.

related:https://github.ibm.com/runtimes/backlog/issues/1525

Signed-off-by: Anna Babu Palathingal <[email protected]>
  • Loading branch information
annaibm committed Sep 25, 2024
1 parent f3d33ec commit bae4614
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion scripts/testTKG/test_platformRequirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,11 @@ def run_test():
skipped.add('test_not_arch_390_0')
else:
passed.add('test_not_arch_390_0')
passed.add('test_not_arch_390_z15plus_0')

if 'test_arch_390_z15_0' not in passed:
skipped.add('test_arch_390_z15_0')

if 'test_arch_390_z14_0' not in passed:
skipped.add('test_arch_390_z14_0')

Expand Down
12 changes: 9 additions & 3 deletions src/org/testKitGen/TestInfoParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,15 @@ public TestInfo parse() {
ti.addFeature(featElements[0].toLowerCase(), featElements[1].toLowerCase());
}
Set<String> testFlags = new HashSet<>(arg.getTestFlag());
boolean requiredFeatureFound = false;
boolean hasRequiredFeature = false;
for (Map.Entry<String,String> entry : ti.getFeatures().entrySet()) {
String featureOpt = entry.getValue().toLowerCase();
if (featureOpt.equals("required")) {
if (!isFeatureInTestFlags(testFlags, entry.getKey())) {
return null;
hasRequiredFeature = true;
if (isFeatureInTestFlags(testFlags, entry.getKey())) {
requiredFeatureFound = true;
break;
}
} else if (featureOpt.equals("nonapplicable")) {
// Do not generate make target if the test is not applicable for one feature defined in TEST_FLAG
Expand All @@ -106,7 +110,9 @@ public TestInfo parse() {
System.exit(1);
}
}

if (hasRequiredFeature && !requiredFeatureFound) {
return null;
}
if (testFlags.contains("aot")) {
for (Map.Entry<String,String> entry : ti.getFeatures().entrySet()) {
if (doesFeatureMatchTestFlag("aot", entry.getKey())) {
Expand Down

0 comments on commit bae4614

Please sign in to comment.