kwin commented on a change in pull request #1:
URL:
https://github.com/apache/sling-org-apache-sling-models-integration-tests/pull/1#discussion_r760875856
##########
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:
Instead of this generic ready path I would rather wait for the relevant
services/components: https://issues.apache.org/jira/browse/SLING-7297. That
makes the ITs much more reliable.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]