SFT: avoid testing aggregator features 86/51386/4
authorStephen Kitt <skitt@redhat.com>
Fri, 3 Feb 2017 10:35:17 +0000 (11:35 +0100)
committerRobert Varga <nite@hq.sk>
Tue, 7 Feb 2017 12:27:05 +0000 (12:27 +0000)
Feature repositories built by the Karaf Maven plugin contain an
aggregator feature which pulls in all the features in the relevant
POM. It's pointless to test this, and very expensive, so we now skip
them: the rule is that, in repositories with more than one feature,
any feature with the same name as the repository is skipped.
(Repositories containing a single feature are tested, so that single
features can be checked in -Psft mode.)

Change-Id: I8ca11e9ff18663e62cee94e3203b5a0e0db17742
Signed-off-by: Stephen Kitt <skitt@redhat.com>
features4-test/src/main/java/org/opendaylight/odlparent/featuretest/PerRepoTestRunner.java

index b44ef832484aa0e361af1048064c48791f4044c4..ab4b7aa41b915279deab734f01533e495b43be59 100644 (file)
@@ -118,7 +118,14 @@ public class PerRepoTestRunner extends ParentRunner<PerFeatureRunner> {
         final List<PerFeatureRunner> runners = new ArrayList<>();
         final List<Feature> featureList = features.getFeature();
         for (final Feature f : featureList) {
-            runners.add(new PerFeatureRunner(repoUrl, f.getName(), f.getVersion(), testClass));
+            // If the features have more than one feature, ignore any feature with the same name as the
+            // repository — these are the aggregator features generated by the Karaf Maven plugin, and
+            // which are expensive to test
+            if (featureList.size() == 1 || !f.getName().equals(features.getName())) {
+                runners.add(new PerFeatureRunner(repoUrl, f.getName(), f.getVersion(), testClass));
+            } else {
+                LOG.warn("Skipping {}, it's an aggregator feature", f.getName());
+            }
         }
         return runners;
     }