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

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


The following commit(s) were added to refs/heads/main by this push:
     new 91e877b8f Fix #2984: run the Citrus itests against the Kamelets in 
this working tree (#2987)
91e877b8f is described below

commit 91e877b8f34a22ab70c89a0982de29599871084f
Author: Andrea Cosentino <[email protected]>
AuthorDate: Sun Aug 30 15:04:54 2026 +0200

    Fix #2984: run the Citrus itests against the Kamelets in this working tree 
(#2987)
    
    * Fix #2984: run the Citrus itests against the Kamelets in this working tree
    
    The integration tests were resolving the Kamelet catalog from a released
    camel-kamelets artifact instead of the one built in the same run, so a
    Kamelet change could not be caught by its own test.
    
    citrus.camel.cli.kamelets.version maps to the JBang system property
    camel-kamelets.version, which Camel JBang consumes as a *script* property
    via the //DEPS line in CamelJBang.java:
    
        //DEPS 
org.apache.camel.kamelets:camel-kamelets:${camel-kamelets.version:4.21.0}
    
    Citrus passes it with ProcessLauncher.withSystemProperty, which never
    reaches that substitution, so the run silently fell back to the released
    catalog and the integration dumps showed classpath:kamelets/*.kamelet.yaml.
    
    Citrus 5.0.0 also exposes citrus.camel.cli.kamelets.local.dir, which it
    turns into the Camel CLI's --local-kamelet-dir argument. Setting it to the
    repository kamelets/ directory makes catalog resolution deterministic and
    independent of artifact resolution: Camel puts the file: location ahead of
    the classpath one, so the working tree always wins.
    
    Verified locally with KafkaIT:
    - dumps now report file:<repo>/kamelets/<name>.kamelet.yaml instead of
      classpath:kamelets/<name>.kamelet.yaml
    - re-introducing the CamelKafkaOverrideTopic strip that #2978 originally
      carried now makes kafka-router-pipe-test FAIL, where it passed before
      this change
    
    Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
    
    * Fix #2984: pin the mail-sink test to plaintext SMTP
    
    First regression the restored gate catches, and it was already on main.
    
    #2956 changed mail-sink to default protocol: smtps (implicit TLS), which
    is right for real deployments. The Citrus mail server this test starts is
    plaintext, so the sink can no longer complete a handshake against it and
    the test times out waiting on mailServer.inbound.
    
    It went unnoticed because the itests were resolving the released catalog,
    where mail-sink still defaulted to smtp -- exactly the blind spot this
    branch removes.
    
    Pinning protocol: smtp in the Pipe keeps the secure default for users and
    makes the test's plaintext assumption explicit rather than accidental.
    
    MailIT passes locally with this change.
    
    Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
    
    ---------
    
    Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
---
 tests/camel-kamelets-itest/pom.xml                                 | 2 ++
 .../src/test/resources-filtered/citrus-application.properties      | 7 +++++++
 .../src/test/resources/mail/mail-sink-pipe.yaml                    | 5 +++++
 3 files changed, 14 insertions(+)

diff --git a/tests/camel-kamelets-itest/pom.xml 
b/tests/camel-kamelets-itest/pom.xml
index 922f4370c..4b734d8bc 100644
--- a/tests/camel-kamelets-itest/pom.xml
+++ b/tests/camel-kamelets-itest/pom.xml
@@ -35,6 +35,8 @@
 
     <properties>
         <enable.integration.tests>*IT</enable.integration.tests>
+        <!-- The Kamelets under test: this working tree, not a released 
artifact. See #2984. -->
+        
<kamelets.local.dir>${project.basedir}/../../kamelets</kamelets.local.dir>
     </properties>
 
     <dependencyManagement>
diff --git 
a/tests/camel-kamelets-itest/src/test/resources-filtered/citrus-application.properties
 
b/tests/camel-kamelets-itest/src/test/resources-filtered/citrus-application.properties
index 033b35468..cec34f39a 100644
--- 
a/tests/camel-kamelets-itest/src/test/resources-filtered/citrus-application.properties
+++ 
b/tests/camel-kamelets-itest/src/test/resources-filtered/citrus-application.properties
@@ -28,6 +28,13 @@ citrus.camel.cli.max.attempts=10
 citrus.camel.cli.version=${camel.version}
 # Kamelets version (should point to the current snapshot release version)
 citrus.camel.cli.kamelets.version=${project.version}
+# Load the Kamelets from this working tree rather than from a resolved
+# camel-kamelets artifact, so the tests actually exercise the catalog built in
+# the same run. The version property above is not sufficient on its own: Camel
+# JBang consumes camel-kamelets.version as a JBang script property (the //DEPS
+# line in CamelJBang.java), which Citrus' system property cannot reach, so the
+# run silently falls back to the released catalog. See #2984.
+citrus.camel.cli.kamelets.local.dir=${kamelets.local.dir}
 
 # Enable dump of Camel CLI integration output
 citrus.camel.cli.dump.integration.output=true
diff --git 
a/tests/camel-kamelets-itest/src/test/resources/mail/mail-sink-pipe.yaml 
b/tests/camel-kamelets-itest/src/test/resources/mail/mail-sink-pipe.yaml
index c021891a6..baba0f504 100644
--- a/tests/camel-kamelets-itest/src/test/resources/mail/mail-sink-pipe.yaml
+++ b/tests/camel-kamelets-itest/src/test/resources/mail/mail-sink-pipe.yaml
@@ -33,6 +33,11 @@ spec:
       kind: Kamelet
       name: mail-sink
     properties:
+      # The Citrus mail server this test starts is a plaintext SMTP server, so
+      # the protocol has to be pinned. mail-sink defaults to smtps (implicit
+      # TLS) since #2956, which is the right default for real deployments but
+      # cannot complete a handshake against the mock.
+      protocol: "smtp"
       connectionHost: "{{mail.host}}"
       connectionPort: "{{mail.port}}"
       username: "{{mail.username}}"

Reply via email to