You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2020/10/02 13:05:51 UTC

[sling-org-apache-sling-starter] branch feature/SLING-9637 created (now 01ef450)

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a change to branch feature/SLING-9637
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-starter.git.


      at 01ef450  SLING-9637 - Re-enable Smoke IT, but only keep the repository available check

This branch includes the following new commits:

     new 2c41103  SLING-9637 - Re-enable Smoke IT, but only keep the repository available check
     new 01ef450  SLING-9637 - Re-enable Smoke IT, but only keep the repository available check

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[sling-org-apache-sling-starter] 01/02: SLING-9637 - Re-enable Smoke IT, but only keep the repository available check

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch feature/SLING-9637
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-starter.git

commit 2c41103daa42a23b71efa59dc21d99bb2da7ab29
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Fri Oct 2 14:59:29 2020 +0200

    SLING-9637 - Re-enable Smoke IT, but only keep the repository available check
    
    Configure the build to run the ITs
---
 pom.xml | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 70 insertions(+)

diff --git a/pom.xml b/pom.xml
index 0d0ad5e..56bd885 100644
--- a/pom.xml
+++ b/pom.xml
@@ -180,6 +180,76 @@
                     </execution>
                 </executions>
             </plugin>
+            <!-- reserve a network port for the integration tests -->
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>reserve-network-port</id>
+                        <goals>
+                            <goal>reserve-network-port</goal>
+                        </goals>
+                        <phase>pre-integration-test</phase>
+                        <configuration>
+                            <portNames>
+                                <portName>http.port</portName>
+                            </portNames>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <!-- launch the oak_tar aggregate for the integration tests -->
+            <plugin>
+                <groupId>org.apache.sling</groupId>
+                <artifactId>feature-launcher-maven-plugin</artifactId>
+                <version>0.1.0</version>
+                <configuration>
+                    <launches>
+                        <launch>
+                            <id>sling-12-oak-tar</id>
+                            <feature>
+                                <groupId>${project.groupId}</groupId>
+                                <artifactId>${project.artifactId}</artifactId>
+                                <version>${project.version}</version>
+                                <classifier>oak_tar</classifier>
+                                <type>slingosgifeature</type>
+                            </feature>
+                            <launcherArguments>
+                                <frameworkProperties>
+                                    <org.osgi.service.http.port>${http.port}</org.osgi.service.http.port>
+                                </frameworkProperties>
+                            </launcherArguments>
+                        </launch>
+                    </launches>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>start</goal>
+                            <goal>stop</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>                
+            <!-- run the ITs -->
+            <plugin>
+               <artifactId>maven-failsafe-plugin</artifactId>
+               <executions>
+                   <execution>
+                       <goals>
+                           <goal>integration-test</goal>
+                           <goal>verify</goal>
+                       </goals>
+                   </execution>
+               </executions>
+               <configuration>
+                   <systemPropertyVariables>
+                       <launchpad.http.port>${http.port}</launchpad.http.port>
+                       <IT.expected.bundles.count>${IT.expected.bundles.count}</IT.expected.bundles.count>
+                   </systemPropertyVariables>
+               </configuration>
+            </plugin>
         </plugins>
 
         <pluginManagement>


[sling-org-apache-sling-starter] 02/02: SLING-9637 - Re-enable Smoke IT, but only keep the repository available check

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch feature/SLING-9637
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-starter.git

commit 01ef45013e826d822fe9cbec5a1ddbae2adf14d2
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Fri Oct 2 15:02:31 2020 +0200

    SLING-9637 - Re-enable Smoke IT, but only keep the repository available check
    
    Naming changes, mostly from launchpad to starter
---
 pom.xml                                                |  6 +++---
 src/test/java/org/apache/sling/launchpad/SmokeIT.java  | 18 +++++++++---------
 .../{LaunchpadReadyRule.java => StarterReadyRule.java} |  6 +++---
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/pom.xml b/pom.xml
index 56bd885..375f926 100644
--- a/pom.xml
+++ b/pom.xml
@@ -38,7 +38,7 @@
 
     <properties>
         <sling.java.version>8</sling.java.version>
-        <IT.expected.bundles.count>126</IT.expected.bundles.count>
+        <starter.min.bundles.count>126</starter.min.bundles.count>
 
         <!-- versions to be replaced in the feature files -->
         <jackrabbit.version>2.20.0</jackrabbit.version>
@@ -245,8 +245,8 @@
                </executions>
                <configuration>
                    <systemPropertyVariables>
-                       <launchpad.http.port>${http.port}</launchpad.http.port>
-                       <IT.expected.bundles.count>${IT.expected.bundles.count}</IT.expected.bundles.count>
+                       <starter.http.port>${http.port}</starter.http.port>
+                       <starter.min.bundles.count>${starter.min.bundles.count}</starter.min.bundles.count>
                    </systemPropertyVariables>
                </configuration>
             </plugin>
diff --git a/src/test/java/org/apache/sling/launchpad/SmokeIT.java b/src/test/java/org/apache/sling/launchpad/SmokeIT.java
index 71676dc..26381fc 100644
--- a/src/test/java/org/apache/sling/launchpad/SmokeIT.java
+++ b/src/test/java/org/apache/sling/launchpad/SmokeIT.java
@@ -52,11 +52,11 @@ import org.w3c.dom.Node;
 
 public class SmokeIT {
 
-    private static final int LAUNCHPAD_PORT = Integer.getInteger("launchpad.http.port", 8080);
-    private static final int EXPECTED_BUNDLES_COUNT = Integer.getInteger("IT.expected.bundles.count", Integer.MAX_VALUE);
+    private static final int STARTER_HTTP_PORT = Integer.getInteger("starter.http.port", 8080);
+    private static final int STARTER_MIN_BUNDLES_COUNT = Integer.getInteger("starter.min.bundles.count", Integer.MAX_VALUE);
 
     @ClassRule
-    public static LaunchpadReadyRule LAUNCHPAD = new LaunchpadReadyRule(LAUNCHPAD_PORT);
+    public static StarterReadyRule LAUNCHPAD = new StarterReadyRule(STARTER_HTTP_PORT);
     private HttpClientContext httpClientContext;
 
     @Before
@@ -64,11 +64,11 @@ public class SmokeIT {
 
         CredentialsProvider credsProvider = new BasicCredentialsProvider();
         UsernamePasswordCredentials creds = new UsernamePasswordCredentials("admin", "admin");
-        credsProvider.setCredentials(new AuthScope("localhost", LAUNCHPAD_PORT), creds);
+        credsProvider.setCredentials(new AuthScope("localhost", STARTER_HTTP_PORT), creds);
 
         BasicAuthCache authCache = new BasicAuthCache();
         BasicScheme basicAuth = new BasicScheme();
-        authCache.put(new HttpHost("localhost", LAUNCHPAD_PORT, "http"), basicAuth);
+        authCache.put(new HttpHost("localhost", STARTER_HTTP_PORT, "http"), basicAuth);
 
         httpClientContext = HttpClientContext.create();
         httpClientContext.setCredentialsProvider(credsProvider);
@@ -87,7 +87,7 @@ public class SmokeIT {
 
         try ( CloseableHttpClient client = newClient() ) {
 
-            HttpGet get = new HttpGet("http://localhost:" + LAUNCHPAD_PORT + "/system/console/bundles.json");
+            HttpGet get = new HttpGet("http://localhost:" + STARTER_HTTP_PORT + "/system/console/bundles.json");
 
             // pass the context to ensure preemptive basic auth is used
             // https://hc.apache.org/httpcomponents-client-ga/tutorial/html/authentication.html
@@ -107,8 +107,8 @@ public class SmokeIT {
 
                 @SuppressWarnings("unchecked")
                 List<Object> bundles = (List<Object>) obj.get("data");
-                if(bundles.size() < EXPECTED_BUNDLES_COUNT) {
-                    fail("Expected at least " + EXPECTED_BUNDLES_COUNT + " bundles, got " + bundles.size());
+                if(bundles.size() < STARTER_MIN_BUNDLES_COUNT) {
+                    fail("Expected at least " + STARTER_MIN_BUNDLES_COUNT + " bundles, got " + bundles.size());
                 }
 
                 BundleStatus bs = new BundleStatus(status);
@@ -148,7 +148,7 @@ public class SmokeIT {
     public void ensureRepositoryIsStarted() throws Exception {
         try ( CloseableHttpClient client = newClient() ) {
 
-            HttpGet get = new HttpGet("http://localhost:" + LAUNCHPAD_PORT + "/server/default/jcr:root/content");
+            HttpGet get = new HttpGet("http://localhost:" + STARTER_HTTP_PORT + "/server/default/jcr:root/content");
 
             try ( CloseableHttpResponse response = client.execute(get) ) {
 
diff --git a/src/test/java/org/apache/sling/launchpad/LaunchpadReadyRule.java b/src/test/java/org/apache/sling/launchpad/StarterReadyRule.java
similarity index 94%
rename from src/test/java/org/apache/sling/launchpad/LaunchpadReadyRule.java
rename to src/test/java/org/apache/sling/launchpad/StarterReadyRule.java
index d6b6d6f..bffac80 100644
--- a/src/test/java/org/apache/sling/launchpad/LaunchpadReadyRule.java
+++ b/src/test/java/org/apache/sling/launchpad/StarterReadyRule.java
@@ -29,14 +29,14 @@ import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClients;
 import org.junit.rules.ExternalResource;
 
-public class LaunchpadReadyRule extends ExternalResource {
+public class StarterReadyRule extends ExternalResource {
 
     private static final int TRIES = 60;
     private static final int WAIT_BETWEEN_TRIES_MILLIS = 1000;
 
     private final List<Check> checks = new ArrayList<>();
 
-    public LaunchpadReadyRule(int launchpadPort) {
+    public StarterReadyRule(int launchpadPort) {
 
         checks.add(new Check("http://localhost:" + launchpadPort + "/server/default/jcr:root/content"));
         checks.add(new Check("http://localhost:" + launchpadPort + "/content/starter.html") {
@@ -93,7 +93,7 @@ public class LaunchpadReadyRule extends ExternalResource {
             Thread.sleep(WAIT_BETWEEN_TRIES_MILLIS);
         }
         
-        throw new RuntimeException(String.format("Launchpad not ready. Failed check for URL %s with message '%s'",
+        throw new RuntimeException(String.format("Starter not ready. Failed check for URL %s with message '%s'",
                 check.getUrl(), lastFailure));
     }