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

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 617bdd855b26 CAMEL-27578: camel-exe - CamelExeBootstrapTest runs only 
when the native exe is built (#30890)
617bdd855b26 is described below

commit 617bdd855b266b2848e355e2f6458699c586b7a2
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu Nov 26 20:18:17 2026 +0100

    CAMEL-27578: camel-exe - CamelExeBootstrapTest runs only when the native 
exe is built (#30890)
    
    CamelExeBootstrapTest asserts that the native camel.exe exists, which only
    the build-native-exe profile builds. Every Windows build without it failed,
    such as the nightly Windows build. The test now runs only with
    -Dcamel.exe.test=true, which the Windows smoke test of the native exe
    workflow sets once it has put the exe in place, and there it still fails
    loudly when the exe is missing.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    Signed-off-by: Claus Ibsen <[email protected]>
---
 .github/workflows/camel-launcher-native-exe.yml                |  2 +-
 tooling/camel-exe/pom.xml                                      |  8 ++++++++
 .../org/apache/camel/tooling/exe/CamelExeBootstrapTest.java    | 10 ++++++++--
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/camel-launcher-native-exe.yml 
b/.github/workflows/camel-launcher-native-exe.yml
index 469439f49d9c..3b81e9d4468b 100644
--- a/.github/workflows/camel-launcher-native-exe.yml
+++ b/.github/workflows/camel-launcher-native-exe.yml
@@ -154,7 +154,7 @@ jobs:
         shell: bash
         run: |
           mvn -B -ntp -pl buildingtools,tooling/camel-exe -am test \
-            -Dtest=CamelExeBootstrapTest 
-Dsurefire.failIfNoSpecifiedTests=false
+            -Dtest=CamelExeBootstrapTest 
-Dsurefire.failIfNoSpecifiedTests=false -Dcamel.exe.test=true
 
   camel-launcher-native:
     needs: detect-changes
diff --git a/tooling/camel-exe/pom.xml b/tooling/camel-exe/pom.xml
index cb31bf45e36a..969065494b5b 100644
--- a/tooling/camel-exe/pom.xml
+++ b/tooling/camel-exe/pom.xml
@@ -36,6 +36,8 @@
     <properties>
         <camel-prepare-component>false</camel-prepare-component>
         <label>tooling</label>
+        <!-- set to true (-Dcamel.exe.test=true) to run CamelExeBootstrapTest 
against the built native exe on Windows -->
+        <camel.exe.test>false</camel.exe.test>
     </properties>
 
     <dependencies>
@@ -87,6 +89,12 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <systemPropertyVariables>
+                        <!-- CamelExeBootstrapTest runs only when the native 
exe is built and this is true -->
+                        <camel.exe.test>${camel.exe.test}</camel.exe.test>
+                    </systemPropertyVariables>
+                </configuration>
                 <executions>
                     <execution>
                         <id>default-test</id>
diff --git 
a/tooling/camel-exe/src/test/java/org/apache/camel/tooling/exe/CamelExeBootstrapTest.java
 
b/tooling/camel-exe/src/test/java/org/apache/camel/tooling/exe/CamelExeBootstrapTest.java
index ca29372f4eed..c4c0616a1507 100644
--- 
a/tooling/camel-exe/src/test/java/org/apache/camel/tooling/exe/CamelExeBootstrapTest.java
+++ 
b/tooling/camel-exe/src/test/java/org/apache/camel/tooling/exe/CamelExeBootstrapTest.java
@@ -27,6 +27,7 @@ import java.util.List;
 import java.util.concurrent.TimeUnit;
 
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
 import org.junit.jupiter.api.condition.EnabledOnOs;
 import org.junit.jupiter.api.condition.OS;
 import org.junit.jupiter.api.io.TempDir;
@@ -36,10 +37,15 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
 
 /**
  * Windows-only behavioral test for the native camel.exe bootstrap. Requires 
the build-native-exe profile to have
- * produced the platform-appropriate exe (target/camel-x64.exe on x86_64, 
target/camel-arm64.exe on aarch64); the test
- * fails loudly if it is missing so a broken native build does not pass 
silently.
+ * produced the platform-appropriate exe (target/camel-x64.exe on x86_64, 
target/camel-arm64.exe on aarch64).
+ * <p>
+ * The test only runs with {@code -Dcamel.exe.test=true}, which the native exe 
workflow sets once it has put the exe in
+ * place, so a regular Windows build (that does not build the exe) skips it. 
With the property set, the test fails
+ * loudly if the exe is missing, so a broken native build does not pass 
silently.
  */
 @EnabledOnOs(OS.WINDOWS)
+@EnabledIfSystemProperty(named = "camel.exe.test", matches = "true",
+                         disabledReason = "Needs the native camel.exe, run 
with -Dcamel.exe.test=true once it is built")
 class CamelExeBootstrapTest {
 
     private static final String EXE_ARCH = 
"aarch64".equals(System.getProperty("os.arch")) ? "arm64" : "x64";

Reply via email to