You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2021/12/02 10:16:03 UTC

[GitHub] [sling-org-apache-sling-models-integration-tests] stefanseifert commented on a change in pull request #1: SLING-10954 Update Models Integration Tests to Sling 11 and Parent 46

stefanseifert commented on a change in pull request #1:
URL: https://github.com/apache/sling-org-apache-sling-models-integration-tests/pull/1#discussion_r760947304



##########
File path: pom.xml
##########
@@ -165,117 +76,102 @@
                 </configuration>
             </plugin>
             <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-dependency-plugin</artifactId>
+                <!-- Find free ports to run our server -->
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>reserve-server-port</id>
+                        <goals>
+                            <goal>reserve-network-port</goal>
+                        </goals>
+                        <phase>pre-integration-test</phase>
+                        <configuration>
+                            <portNames>
+                                <!-- reserved port must be stored in property because it must be passed to the slingstart-maven-plugin -->
+                                <portName>http.port</portName>
+                            </portNames>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <!-- the Sling instance is provisioned from the model in src/main/provisioning/model.txt -->
+                <groupId>org.apache.sling</groupId>
+                <artifactId>slingstart-maven-plugin</artifactId>
+                <extensions>true</extensions>
                 <executions>
                     <execution>
-                        <id>copy-runnable-jar</id>
+                        <id>prepare-launchpad-package</id>
+                        <goals>
+                            <goal>prepare-package</goal>
+                        </goals>
+                        <phase>pre-integration-test</phase>
+                    </execution>
+                    <execution>
+                        <id>build-launchpad-package</id>
                         <goals>
-                            <goal>copy-dependencies</goal>
+                            <goal>package</goal>
                         </goals>
-                            <phase>process-resources</phase>
+                        <phase>pre-integration-test</phase>
                         <configuration>
-                            <includeArtifactIds>org.apache.sling.launchpad</includeArtifactIds>
-                            <excludeTransitive>true</excludeTransitive>
-                            <overWriteReleases>false</overWriteReleases>
-                            <overWriteSnapshots>false</overWriteSnapshots>
+                            <attachArtifact>false</attachArtifact>
                         </configuration>
                     </execution>
                     <execution>
-                        <!-- 
-                            Consider all dependencies as candidates to be installed
-                            as additional bundles. We use system properties to define
-                            which bundles to install in which order.  
-                        -->
-                        <id>copy-additional-bundles</id>
+                        <id>start-container-before-IT</id>
                         <goals>
-                            <goal>copy-dependencies</goal>
+                            <goal>start</goal>
                         </goals>
-                            <phase>process-resources</phase>
                         <configuration>
-                            <outputDirectory>${project.build.directory}</outputDirectory>
-                            <excludeTransitive>true</excludeTransitive>
-                            <overWriteReleases>false</overWriteReleases>
-                            <overWriteSnapshots>false</overWriteSnapshots>
                         </configuration>
                     </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <!-- Find free ports to run our server -->
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>build-helper-maven-plugin</artifactId>
-                <executions>
                     <execution>
-                        <id>reserve-server-port</id>
+                        <id>stop-container-after-IT</id>
                         <goals>
-                            <goal>reserve-network-port</goal>
+                            <goal>stop</goal>
                         </goals>
-                        <phase>process-resources</phase>
                         <configuration>
-                            <portNames>
-                                <portName>http.port</portName>
-                            </portNames>
+                            <shouldBlockUntilKeyIsPressed>${keepITServerRunning}</shouldBlockUntilKeyIsPressed>
                         </configuration>
                     </execution>
                 </executions>
+                <configuration>
+                    <servers>
+                        <!-- this configuration applies to both 'start' and 'stop' -->
+                        <server>
+                            <id>singleinstance</id>
+                            <port>${http.port}</port>
+                            <vmOpts>${sling.vm.options}</vmOpts>
+                            <stdOutFile>sling/logs/stdout.log</stdOutFile>
+                        </server>
+                    </servers>
+                    <!-- this configuration only applies to 'prepare-package' and 'package' -->
+                    <disableExtendingMavenClasspath>true</disableExtendingMavenClasspath>
+                    <usePomDependencies>true</usePomDependencies>
+                </configuration>
             </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-failsafe-plugin</artifactId>
                 <executions>
                     <execution>
-                        <id>integration-test</id>
                         <goals>
                             <goal>integration-test</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>verify</id>
-                        <goals>
                             <goal>verify</goal>
                         </goals>
+                        <configuration>
+                            <systemProperties>
+                                <http.port>${http.port}</http.port>
+                            </systemProperties>
+                        </configuration>
                     </execution>
                 </executions>
                 <configuration>
-                    <debugForkedProcess>${maven.surefire.debug}</debugForkedProcess>
                     <systemPropertyVariables>
-                        <test.server.url>${test.server.url}</test.server.url>
-                        <test.server.hostname>${test.server.hostname}</test.server.hostname>
-                        <test.server.username>${test.server.username}</test.server.username>
-                        <test.server.password>${test.server.password}</test.server.password>
-                        <jar.executor.server.port>${http.port}</jar.executor.server.port>
-                        <jar.executor.vm.options>${jar.executor.vm.options}</jar.executor.vm.options>
-                        <jar.executor.jar.folder>${project.basedir}/target/dependency</jar.executor.jar.folder>
-                        <jar.executor.jar.name.regexp>org.apache.sling.launchpad.*jar$</jar.executor.jar.name.regexp>
-                        <jar.executor.work.folder>${jar.executor.work.folder}</jar.executor.work.folder>
-                        <jar.executor.jar.options>${jar.executor.jar.options}</jar.executor.jar.options>
-                        <additional.bundles.path>${project.basedir}/target,${project.basedir}/target/sling/additional-bundles</additional.bundles.path>
-                        <keepJarRunning>${keepJarRunning}</keepJarRunning>
+                        <launchpad.http.server.url>http://localhost:${http.port}</launchpad.http.server.url>
                         <server.ready.timeout.seconds>60</server.ready.timeout.seconds>
-                        <sling.testing.timeout.multiplier>${sling.testing.timeout.multiplier}</sling.testing.timeout.multiplier>
-                        <server.ready.path.1>/:script src="system/sling.js"</server.ready.path.1>
-                        <server.ready.path.2>/.explorer.html:href="/libs/sling/explorer/css/explorer.css"</server.ready.path.2>
-                        <server.ready.path.3>/sling-test/sling/sling-test.html:Sling client library tests</server.ready.path.3>
-                        <start.bundles.timeout.seconds>30</start.bundles.timeout.seconds>
-                        <bundle.install.timeout.seconds>20</bundle.install.timeout.seconds>
-                        
-                        <!-- 
-                            Define additional bundles to install by specifying the beginning of their artifact name.
-                            The bundles are installed in lexical order of these property names.
-                            All bundles must be listed as dependencies in this pom, or they won't be installed. 
-                        -->
-                        <sling.additional.bundle.1>org.apache.sling.junit.core</sling.additional.bundle.1>
-                        <sling.additional.bundle.3>org.apache.sling.commons.johnzon</sling.additional.bundle.3>
-                        <sling.additional.bundle.4>commons-lang3</sling.additional.bundle.4>
-                        <sling.additional.bundle.10>org.apache.sling.models.api</sling.additional.bundle.10>
-                        <sling.additional.bundle.11>org.apache.sling.models.impl</sling.additional.bundle.11>
-                        <sling.additional.bundle.12>org.apache.sling.models.jacksonexporter</sling.additional.bundle.12>
-                        <sling.additional.bundle.13>jackson-annotations</sling.additional.bundle.13>
-                        <sling.additional.bundle.14>jackson-core</sling.additional.bundle.14>
-                        <sling.additional.bundle.15>jackson-databind</sling.additional.bundle.15>
-                        <sling.additional.bundle.16>commons-lang3</sling.additional.bundle.16>
-                        <sling.additional.bundle.17>${project.build.finalName}.jar</sling.additional.bundle.17>
+                        <server.ready.path.1>/starter/index.html:Getting Started</server.ready.path.1>

Review comment:
       i think it's valuable to have this generic check in place - no IT should run before the sling start page is displayed with this content and not the wait screen which already does some system ready check.
   i will check if we can put in additional checks for the services/components we required for our integration tests.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org