Fix #2984: run the Citrus itests against the Kamelets in this working tree - #2987
Conversation
…orking 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 apache#2978 originally
carried now makes kafka-router-pipe-test FAIL, where it passed before
this change
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
First regression the restored gate catches, and it was already on main. apache#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) <noreply@anthropic.com>
The stricter gate immediately caught a live regression on
|
Correction, and this PR is more urgent than I saidIn my previous comment I described
and the failure there is the same one, with the same shape: The first failure follows What the gap actually hidesRefining the #2984 diagnosis rather than retracting it. The evidence together:
So the catalog under test tracks That is still exactly what this PR fixes, and it is why Practical consequenceEvery open PR is currently red through no fault of its own - #2988, #2989 and #2990 all fail on Merging this unblocks Claude Code on behalf of Andrea Cosentino |
Fixes #2984.
The Citrus integration tests were resolving the Kamelet catalog from a released
camel-kameletsartifact rather than the one built in the same run. The suite is the catalog's only behavioural gate, so in practice every Kamelet change was going through CI untested.How it was found
PR #2978 briefly added this to
kafka-sink:tests/.../kafka/kafka-router-pipe.yamlis a Pipe of the shapewebhook-source → timestamp-router-action → … → kafka-sink (topic: dummy), and its Citrus assertion consumes from the overridden topic —dummyis deliberately a throwaway. That strip nullifies the override, so the test should have failed. It reportedTEST SUCCESS.Cause
citrus-application.propertiessets:citrus.camel.cli.kamelets.version=${project.version}Citrus turns that into the JBang system property
camel-kamelets.versionviaProcessLauncher.withSystemProperty. But Camel JBang consumes that name as a JBang script property, substituted into the//DEPSline ofCamelJBang.java://DEPS org.apache.camel.kamelets:camel-kamelets:${camel-kamelets.version:4.21.0}A JVM system property never reaches that substitution, so the declared version had no effect and the run fell back to the released catalog. The integration dumps show it plainly — Kamelets loading from
classpath:kamelets/<name>.kamelet.yaml.Fix
Citrus 5.0.0 also exposes
citrus.camel.cli.kamelets.local.dir, which it turns into the Camel CLI's--local-kamelet-dirargument. Pointing that at the repositorykamelets/directory makes catalog resolution deterministic and independent of artifact resolution — Camel orders thefile:location ahead of the classpath one, so the working tree always wins.citrus.camel.cli.kamelets.local.dir=${kamelets.local.dir}citrus.camel.cli.kamelets.versionis left in place — it still declares intent for thecamel-kameletsartifact on the JBang classpath, it simply is not what selects the templates.Verification
Ran
KafkaITlocally, both ways.1. The catalog under test is now the working tree. Integration dumps changed from
classpath:kamelets/…to:All 3 KafkaIT tests still pass against the working-tree catalog.
2. The gate now catches the regression it previously missed. Re-introducing the exact
CamelKafkaOverrideTopicstrip from #2978:That is the same test, on the same Pipe, that reported success on #2978's head. Working tree restored afterwards — the diff here is two files, 9 added lines.
mvn clean installpasses from the repository root.Note for reviewers
This makes CI stricter, so the first run may surface pre-existing Kamelet/test drift that the released catalog was masking. That would be a real finding rather than a fault of this change, but worth watching on the first green.
Claude Code on behalf of Andrea Cosentino