You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2026/09/06 12:09:05 UTC

(camel) branch quick-fix/spring-ai-image-ci-env-name created (now 5be9f508a52e)

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

davsclaus pushed a change to branch quick-fix/spring-ai-image-ci-env-name
in repository https://gitbox.apache.org/repos/asf/camel.git


      at 5be9f508a52e chore: propagate ci.env.name to forked test JVMs to fix spring-ai-image CI failure

This branch includes the following new commits:

     new 5be9f508a52e chore: propagate ci.env.name to forked test JVMs to fix spring-ai-image CI failure

The 1 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.



(camel) 01/01: chore: propagate ci.env.name to forked test JVMs to fix spring-ai-image CI failure

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

davsclaus pushed a commit to branch quick-fix/spring-ai-image-ci-env-name
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 5be9f508a52ee55a21f1b453945080f95e8da1b3
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Sep 6 14:08:48 2026 +0200

    chore: propagate ci.env.name to forked test JVMs to fix spring-ai-image CI failure
    
    Maven does not automatically forward user properties to forked surefire/failsafe
    JVMs, so @DisabledIfSystemProperty(named = "ci.env.name") conditions were never
    evaluated in CI and the tests ran instead of being skipped.
    
    Add a ci-env-name profile in parent/pom.xml that activates when ci.env.name is
    defined (e.g. via MVND_OPTS in GitHub Actions) and passes it as a systemProperty
    to both surefire and failsafe forked JVMs. This fixes the pattern used in ~99
    test files across the project.
    
    Also fix SpringAiImageOllamaIT to pull x/flux2-klein:4b (the image model under
    test) rather than the default granite4:3b chat model so the test works correctly
    when it does run locally with the model installed.
    
    Co-Authored-By: Claude Sonnet 4.6 <no...@anthropic.com>
    Signed-off-by: Claus Ibsen <cl...@gmail.com>
---
 .../springai/image/SpringAiImageOllamaIT.java      | 14 ++++++++-
 parent/pom.xml                                     | 34 ++++++++++++++++++++++
 2 files changed, 47 insertions(+), 1 deletion(-)

diff --git a/components/camel-spring-parent/camel-spring-ai/camel-spring-ai-image/src/test/java/org/apache/camel/component/springai/image/SpringAiImageOllamaIT.java b/components/camel-spring-parent/camel-spring-ai/camel-spring-ai-image/src/test/java/org/apache/camel/component/springai/image/SpringAiImageOllamaIT.java
index 55ed8c9d7a13..b3a6d9094c2d 100644
--- a/components/camel-spring-parent/camel-spring-ai/camel-spring-ai-image/src/test/java/org/apache/camel/component/springai/image/SpringAiImageOllamaIT.java
+++ b/components/camel-spring-parent/camel-spring-ai/camel-spring-ai-image/src/test/java/org/apache/camel/component/springai/image/SpringAiImageOllamaIT.java
@@ -27,6 +27,7 @@ import com.openai.core.ClientOptions;
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.test.infra.ollama.services.OllamaService;
+import org.apache.camel.test.infra.ollama.services.OllamaServiceConfiguration;
 import org.apache.camel.test.infra.ollama.services.OllamaServiceFactory;
 import org.apache.camel.test.junit6.CamelTestSupport;
 import org.junit.jupiter.api.Test;
@@ -67,7 +68,18 @@ public class SpringAiImageOllamaIT extends CamelTestSupport {
     Path tempDir;
 
     @RegisterExtension
-    static OllamaService OLLAMA = OllamaServiceFactory.createSingletonService();
+    static OllamaService OLLAMA = OllamaServiceFactory.createSingletonServiceWithConfiguration(
+            new OllamaServiceConfiguration() {
+                @Override
+                public String modelName() {
+                    return IMAGE_MODEL_NAME;
+                }
+
+                @Override
+                public String apiKey() {
+                    return "unused";
+                }
+            });
 
     private ImageModel imageModel;
 
diff --git a/parent/pom.xml b/parent/pom.xml
index c29ddebd4787..f986651075f7 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -4545,6 +4545,40 @@
                 </plugins>
             </build>
         </profile>
+        <profile>
+            <!-- Propagate ci.env.name to forked surefire/failsafe JVMs so that
+                 @DisabledIfSystemProperty(named = "ci.env.name") conditions work correctly.
+                 Maven does not automatically forward user properties to forked test JVMs; this
+                 profile ensures the property is available when it is set (e.g. in MVND_OPTS). -->
+            <id>ci-env-name</id>
+            <activation>
+                <property>
+                    <name>ci.env.name</name>
+                </property>
+            </activation>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-surefire-plugin</artifactId>
+                        <configuration combine.children="merge">
+                            <systemPropertyVariables>
+                                <ci.env.name>${ci.env.name}</ci.env.name>
+                            </systemPropertyVariables>
+                        </configuration>
+                    </plugin>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-failsafe-plugin</artifactId>
+                        <configuration combine.children="merge">
+                            <systemPropertyVariables>
+                                <ci.env.name>${ci.env.name}</ci.env.name>
+                            </systemPropertyVariables>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
         <profile>
             <id>nullcheck</id>
             <dependencies>