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

shuber pushed a commit to branch unomi-3-dev
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/unomi-3-dev by this push:
     new 065b1adba UNOMI-929 Improve test reliability and observability for 
profile import integration tests
065b1adba is described below

commit 065b1adba019c7a3a1f1638abca1dfb0a72fc289
Author: Serge Huber <[email protected]>
AuthorDate: Thu Jan 15 18:46:46 2026 +0100

    UNOMI-929 Improve test reliability and observability for profile import 
integration tests
    
    Enhance ProfileImportSurfersIT with proper waiting logic and Camel route
    status checking. Improve ProgressListener to track and display failed tests.
    Add disabled "parameters" field to Elasticsearch/OpenSearch mappings.
    
    Key improvements:
    - Add retry logic to wait for import configuration to be saved
    - Add Camel route status checking before waiting for data processing
    - Track and display failed test names in ProgressListener
    - Enhanced logging for better test debugging
    
    Additional changes:
    - Add disabled "parameters" field mapping to Elasticsearch/OpenSearch
    - Update docker-maven-plugin from 0.46.0 to 0.48.0
---
 .../unomi/itests/ProfileImportSurfersIT.java       | 40 ++++++++++++++++++++++
 .../org/apache/unomi/itests/ProgressListener.java  | 19 ++++++++++
 .../META-INF/cxs/mappings/systemItems.json         |  4 +++
 .../META-INF/cxs/mappings/systemItems.json         |  4 +++
 pom.xml                                            |  2 +-
 5 files changed, 68 insertions(+), 1 deletion(-)

diff --git 
a/itests/src/test/java/org/apache/unomi/itests/ProfileImportSurfersIT.java 
b/itests/src/test/java/org/apache/unomi/itests/ProfileImportSurfersIT.java
index 8c630879a..ac85c526c 100644
--- a/itests/src/test/java/org/apache/unomi/itests/ProfileImportSurfersIT.java
+++ b/itests/src/test/java/org/apache/unomi/itests/ProfileImportSurfersIT.java
@@ -90,9 +90,23 @@ public class ProfileImportSurfersIT extends BaseIT {
         importConfigSurfers.setActive(true);
 
         importConfigurationService.save(importConfigSurfers, true);
+        keepTrying("Failed waiting for surfers import configuration to be 
saved", 
+                () -> importConfigurationService.load(itemId1), 
+                Objects::nonNull, DEFAULT_TRYING_TIMEOUT, 
DEFAULT_TRYING_TRIES);
 
         LOGGER.info("ProfileImportSurfersIT setup successfully.");
 
+        // Wait for Camel route to be created and started (the timer runs 
every 1 second to process config refreshes)
+        // This gives us visibility into what Camel is doing instead of just 
waiting for results
+        boolean routeStarted = waitForCamelRouteStarted(itemId1, 1000, 10);
+        if (routeStarted) {
+            String routeInfo = getCamelRouteInfo(itemId1);
+            LOGGER.info("Camel Route Status: {}", routeInfo);
+        } else {
+            LOGGER.warn("Camel Route '{}' was not started within timeout", 
itemId1);
+            LOGGER.warn("All Camel routes with status: {}", 
getAllCamelRoutesWithStatus());
+        }
+
         //Wait for data to be processed
         keepTrying("Failed waiting for surfers initial import to complete",
                 () -> 
profileService.findProfilesByPropertyValue("properties.city", "surfersCity", 0, 
50, null),
@@ -145,9 +159,22 @@ public class ProfileImportSurfersIT extends BaseIT {
         importConfigSurfersOverwrite.setActive(true);
 
         importConfigurationService.save(importConfigSurfersOverwrite, true);
+        keepTrying("Failed waiting for surfers overwrite import configuration 
to be saved", 
+                () -> importConfigurationService.load(itemId2), 
+                Objects::nonNull, DEFAULT_TRYING_TIMEOUT, 
DEFAULT_TRYING_TRIES);
 
         LOGGER.info("ProfileImportSurfersOverwriteIT setup successfully.");
 
+        // Wait for Camel route to be created and started
+        boolean routeStarted2 = waitForCamelRouteStarted(itemId2, 1000, 10);
+        if (routeStarted2) {
+            String routeInfo = getCamelRouteInfo(itemId2);
+            LOGGER.info("Camel Route Status: {}", routeInfo);
+        } else {
+            LOGGER.warn("Camel Route '{}' was not started within timeout", 
itemId2);
+            LOGGER.warn("All Camel routes with status: {}", 
getAllCamelRoutesWithStatus());
+        }
+
         //Wait for data to be processed
         keepTrying("Failed waiting for surfers overwrite import to complete",
                 () -> 
profileService.findProfilesByPropertyValue("properties.city", "surfersCity", 0, 
50, null),
@@ -195,9 +222,22 @@ public class ProfileImportSurfersIT extends BaseIT {
         importConfigSurfersDelete.setActive(true);
 
         importConfigurationService.save(importConfigSurfersDelete, true);
+        keepTrying("Failed waiting for surfers delete import configuration to 
be saved", 
+                () -> importConfigurationService.load(itemId3), 
+                Objects::nonNull, DEFAULT_TRYING_TIMEOUT, 
DEFAULT_TRYING_TRIES);
 
         LOGGER.info("ProfileImportSurfersDeleteIT setup successfully.");
 
+        // Wait for Camel route to be created and started
+        boolean routeStarted3 = waitForCamelRouteStarted(itemId3, 1000, 10);
+        if (routeStarted3) {
+            String routeInfo = getCamelRouteInfo(itemId3);
+            LOGGER.info("Camel Route Status: {}", routeInfo);
+        } else {
+            LOGGER.warn("Camel Route '{}' was not started within timeout", 
itemId3);
+            LOGGER.warn("All Camel routes with status: {}", 
getAllCamelRoutesWithStatus());
+        }
+
         //Wait for data to be processed
         keepTrying("Failed waiting for surfers delete import to complete",
                 () -> 
profileService.findProfilesByPropertyValue("properties.city", "surfersCity", 0, 
50, null),
diff --git a/itests/src/test/java/org/apache/unomi/itests/ProgressListener.java 
b/itests/src/test/java/org/apache/unomi/itests/ProgressListener.java
index c0a826317..67f0388de 100644
--- a/itests/src/test/java/org/apache/unomi/itests/ProgressListener.java
+++ b/itests/src/test/java/org/apache/unomi/itests/ProgressListener.java
@@ -25,6 +25,9 @@ import java.time.Instant;
 import java.time.LocalDateTime;
 import java.time.ZoneId;
 import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
 import java.util.PriorityQueue;
 import java.util.concurrent.atomic.AtomicInteger;
 
@@ -121,6 +124,8 @@ public class ProgressListener extends RunListener {
     private final AtomicInteger successfulTests = new AtomicInteger(0);
     /** Thread-safe counter for failed tests */
     private final AtomicInteger failedTests = new AtomicInteger(0);
+    /** Thread-safe list to track failed test names */
+    private final List<String> failedTestNames = 
Collections.synchronizedList(new ArrayList<>());
     /** Priority queue to track the slowest tests (limited to top 10) */
     private final PriorityQueue<TestTime> slowTests;
     /** Flag indicating whether ANSI color codes are supported in the terminal 
*/
@@ -305,6 +310,8 @@ public class ProgressListener extends RunListener {
         successfulTests.decrementAndGet(); // Remove the previous success 
count for this test.
         failedTests.incrementAndGet();
         String testName = extractTestName(failure.getDescription());
+        // Add to failed tests list (thread-safe)
+        failedTestNames.add(testName);
         
System.out.println(colorize("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",
 RED));
         System.out.println(colorize("✗ FAILED: " + testName, RED));
         
System.out.println(colorize("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",
 RED));
@@ -477,6 +484,18 @@ public class ProgressListener extends RunListener {
                 ansiSupported ? RESET : "");
         System.out.println(colorize(separator, CYAN));
 
+        // Display failed tests list if any failures occurred
+        if (!failedTestNames.isEmpty()) {
+            System.out.println();
+            System.out.println(colorize("Failed Tests So Far (" + 
failedTestNames.size() + "):", RED));
+            synchronized (failedTestNames) {
+                for (int i = 0; i < failedTestNames.size(); i++) {
+                    System.out.println(colorize("  " + (i + 1) + ". " + 
failedTestNames.get(i), RED));
+                }
+            }
+            System.out.println();
+        }
+
         if (completed % Math.max(1, totalTests / 10) == 0 && completed < 
totalTests) {
             String quote = QUOTES[completed % QUOTES.length];
             System.out.println(colorize("Motivational Quote: " + quote, 
YELLOW));
diff --git 
a/persistence-elasticsearch/core/src/main/resources/META-INF/cxs/mappings/systemItems.json
 
b/persistence-elasticsearch/core/src/main/resources/META-INF/cxs/mappings/systemItems.json
index 2cc4f89b6..d4b001a44 100644
--- 
a/persistence-elasticsearch/core/src/main/resources/META-INF/cxs/mappings/systemItems.json
+++ 
b/persistence-elasticsearch/core/src/main/resources/META-INF/cxs/mappings/systemItems.json
@@ -118,6 +118,10 @@
         }
       }
     },
+    "parameters": {
+      "type": "object",
+      "enabled": false
+    },
     "elements": {
       "properties": {
         "condition": {
diff --git 
a/persistence-opensearch/core/src/main/resources/META-INF/cxs/mappings/systemItems.json
 
b/persistence-opensearch/core/src/main/resources/META-INF/cxs/mappings/systemItems.json
index 76175a266..1ef3223b3 100644
--- 
a/persistence-opensearch/core/src/main/resources/META-INF/cxs/mappings/systemItems.json
+++ 
b/persistence-opensearch/core/src/main/resources/META-INF/cxs/mappings/systemItems.json
@@ -118,6 +118,10 @@
         }
       }
     },
+    "parameters": {
+      "type": "object",
+      "enabled": false
+    },
     "elements": {
       "properties": {
         "condition": {
diff --git a/pom.xml b/pom.xml
index 026c1a15e..ac978935b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -156,7 +156,7 @@
         <maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>
         <exec-maven-plugin.version>3.1.0</exec-maven-plugin.version>
         
<maven-remote-resources-plugin.version>3.0.0</maven-remote-resources-plugin.version>
-        <docker-maven-plugin.version>0.46.0</docker-maven-plugin.version>
+        <docker-maven-plugin.version>0.48.0</docker-maven-plugin.version>
         <jacoco-maven-plugin.version>0.8.13</jacoco-maven-plugin.version>
         <maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
         <frontend-maven-plugin.version>1.12.1</frontend-maven-plugin.version>

Reply via email to