Migrate SFT from unit test to plugin implementation 74/109774/12
authorRuslan Kashapov <ruslan.kashapov@pantheon.tech>
Fri, 12 Jan 2024 08:00:56 +0000 (10:00 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 2 Mar 2024 15:15:41 +0000 (16:15 +0100)
JIRA: ODLPARENT-262
Change-Id: I47325fde0e5f3cc5395fe0ab9c948dbe440ae9ce
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
abstract-feature-parent/pom.xml
feature-repo-parent/pom.xml
odlparent-lite/pom.xml

index 36e7319964bb2e51ad1dd673c904d589fe56b81a..e1aaec5c15ebbdf44d26fa76472d9ea2db3906d2 100644 (file)
         <failOnDependencyChange>false</failOnDependencyChange>
 
         <jacoco.skip>true</jacoco.skip>
-        <skip.karaf.featureTest>false</skip.karaf.featureTest>
 
         <!-- We typically do not have code in feature artifacts, which throws off maven-dependency-plugin -->
         <odlparent.dependency.skip>true</odlparent.dependency.skip>
     </properties>
 
-    <dependencies>
-        <!-- Test the generated features.xml -->
-        <dependency>
-            <groupId>org.opendaylight.odlparent</groupId>
-            <artifactId>features-test</artifactId>
-            <version>13.1.0-SNAPSHOT</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.odlparent</groupId>
-            <artifactId>bundles-test-lib</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.karaf.bundle</groupId>
-            <artifactId>org.apache.karaf.bundle.core</artifactId>
-            <version>${karaf.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <!-- Force SLF4J to test scope -->
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
     <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.opendaylight.odlparent</groupId>
+                    <artifactId>features-test-plugin</artifactId>
+                    <version>${project.version}</version>
+                </plugin>
+            </plugins>
+        </pluginManagement>
         <plugins>
+            <!-- execute SFT -->
             <plugin>
-                <!-- This generates the META-INF/maven/dependencies.properties file
-                     which is required by the versionAsInProject() used in SingleFeatureTest -->
-                <groupId>org.apache.servicemix.tooling</groupId>
-                <artifactId>depends-maven-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <!-- Lists feature dependencies defined in test scope to be pre-installed in karaf when SFT is executed.
-                     Resolved dependencies also include absolute path to artifacts within local repository so
-                     feature names (required for feature:install) can be retrieved. -->
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-dependency-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <!-- execute before test phase -->
-                        <phase>test-compile</phase>
-                        <goals>
-                            <goal>list</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <skip>${skip.karaf.featureTest}</skip>
-                    <includeClassifiers>features</includeClassifiers>
-                    <includeTypes>xml</includeTypes>
-                    <excludeScope>compile</excludeScope>
-                    <!-- exclude SFT's own dependency features -->
-                    <excludeGroupIds>org.apache.karaf.features</excludeGroupIds>
-                    <outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
-                    <outputFile>${project.build.directory}/test-features</outputFile>
-                </configuration>
-            </plugin>
-            <plugin>
-                <artifactId>maven-surefire-plugin</artifactId>
+                <groupId>org.opendaylight.odlparent</groupId>
+                <artifactId>features-test-plugin</artifactId>
+                <extensions>false</extensions>
                 <configuration>
-                    <!-- Overridden to fix corruption with SFT, where the process would hang after test -->
-                    <forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
-                    <dependenciesToScan>
-                        <dependency>org.opendaylight.odlparent:features-test</dependency>
-                    </dependenciesToScan>
-                    <additionalClasspathElements>
-                        <additionalClasspathElement>${project.build.directory}/feature</additionalClasspathElement>
-                    </additionalClasspathElements>
-                    <skip>${skip.karaf.featureTest}</skip>
-                    <systemPropertyVariables>
-                        <!-- Use the same repository for Pax Exam as is used for Maven -->
-                        <org.ops4j.pax.url.mvn.localRepository>${settings.localRepository}</org.ops4j.pax.url.mvn.localRepository>
-                        <!-- Test scope features resolved by maven-dependency-plugin (above) -->
-                        <featureTest.dependencies.list>${project.build.directory}/test-features</featureTest.dependencies.list>
-                    </systemPropertyVariables>
-
-                    <!-- Disable argLine if present, but pass it to SFT -->
-                    <argLine>-DsftArgLine='@{argLine}'</argLine>
+                    <concurrent>false</concurrent>
                 </configuration>
                 <executions>
                     <execution>
             </activation>
 
             <properties>
-                <skip.karaf.featureTest>true</skip.karaf.featureTest>
+                <sft.skip>true</sft.skip>
             </properties>
 
             <build>
index 471b7a25323c6dfbab00c1295946870ebacfa248..ad57f14b319bc2b292bfef295fa0f3cb710b2b5e 100644 (file)
     <name>ODL :: odlparent :: ${project.artifactId}</name>
 
     <properties>
-        <skip.karaf.featureTest>true</skip.karaf.featureTest>
+        <sft.skip>true</sft.skip>
         <jacoco.skip>true</jacoco.skip>
 
         <!-- We typically do not have code in feature artifacts, which throws off maven-dependency-plugin -->
         <odlparent.dependency.skip>true</odlparent.dependency.skip>
     </properties>
 
-    <dependencies>
-        <!-- Test the generated features.xml -->
-        <dependency>
-            <groupId>org.opendaylight.odlparent</groupId>
-            <artifactId>features-test</artifactId>
-            <version>13.1.0-SNAPSHOT</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.opendaylight.odlparent</groupId>
-            <artifactId>bundles-test-lib</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.karaf.bundle</groupId>
-            <artifactId>org.apache.karaf.bundle.core</artifactId>
-            <version>${karaf.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <!-- Force SLF4J to test scope -->
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
     <build>
         <plugins>
+            <!-- execute SFT -->
             <plugin>
-                <!-- This generates the META-INF/maven/dependencies.properties file
-                     which is required by the versionAsInProject() used in SingleFeatureTest -->
-                <groupId>org.apache.servicemix.tooling</groupId>
-                <artifactId>depends-maven-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <artifactId>maven-surefire-plugin</artifactId>
+                <groupId>org.opendaylight.odlparent</groupId>
+                <artifactId>features-test-plugin</artifactId>
+                <extensions>false</extensions>
                 <configuration>
-                    <skip>${skip.karaf.featureTest}</skip>
-                    <dependenciesToScan>
-                        <dependency>org.opendaylight.odlparent:features-test</dependency>
-                    </dependenciesToScan>
-                    <additionalClasspathElements>
-                        <additionalClasspathElement>${project.build.directory}/feature</additionalClasspathElement>
-                    </additionalClasspathElements>
+                    <concurrent>false</concurrent>
                 </configuration>
                 <executions>
                     <execution>
                 </lifecycleMappingMetadata>
               </configuration>
             </plugin>
+              <plugin>
+                  <groupId>org.opendaylight.odlparent</groupId>
+                  <artifactId>features-test-plugin</artifactId>
+                  <version>${project.version}</version>
+              </plugin>
           </plugins>
         </pluginManagement>
     </build>
index 1326da7a689aa1f36d89741ffc00d6d0ed3e08c4..413ea7b644da5ae00fc2d964dab14a8c45523ad7 100644 (file)
                  particularly confusing when used in a project with maven-jar-plugin <goal>test-jar, so don't.)  -->
         <skipIT>true</skipIT>
         <skipITs>true</skipITs>
-        <skip.karaf.featureTest>true</skip.karaf.featureTest>
+        <sft.skip>true</sft.skip>
         <jacoco.skip>true</jacoco.skip>
         <maven.javadoc.skip>true</maven.javadoc.skip>
         <maven.source.skip>true</maven.source.skip>
       <properties>
         <checkstyle.skip>true</checkstyle.skip>
         <duplicate-finder.skip>true</duplicate-finder.skip>
-        <skip.karaf.featureTest>true</skip.karaf.featureTest>
+        <sft.skip>true</sft.skip>
         <maven.javadoc.skip>true</maven.javadoc.skip>
         <maven.source.skip>true</maven.source.skip>
       </properties>