oscerd opened a new pull request, #3040:
URL: https://github.com/apache/camel-kamelets/pull/3040

   First tranche of #2873 — @davsclaus's point that the itests should use Camel 
YAML DSL routes rather than Pipes.
   
   ## Scope of the whole job, for context
   
   There are **40 Pipe based test resources**. By shape:
   
   | shape | count |
   |---|---|
   | `steps` + URI sink | 15 |
   | Kamelet sink, no steps | 10 |
   | `steps` + Kamelet sink | 9 |
   | URI sink, no steps | 5 |
   | Knative Broker | 2 |
   
   **38 of the 40 convert mechanically.** The two that do not are 
`aws/s3/aws-s3-to-knative-broker.yaml` and `aws/s3/knative-to-log.yaml`, which 
bind a Knative `Broker` rather than a Kamelet or a plain URI. Those exercise 
the Knative binding specifically, so converting them would change what is 
tested rather than how it is written — I would leave them as Pipes.
   
   Doing all 38 in one PR would be an 80 file diff validated by a 30 minute 
suite, so this splits it. This PR is the `transformation` directory: seven 
tests, the largest uniform group, all `steps` + URI sink.
   
   ## The conversion
   
   ```yaml
   # before
   spec:
     source:
       ref: { kind: Kamelet, name: timer-source }
       properties: { period: 10000, message: "{{input}}" }
     steps:
       - ref: { kind: Kamelet, name: extract-field-action }
         properties: { field: "{{field.name}}" }
     sink:
       uri: "{{http.sink.url}}/result"
   ```
   
   ```yaml
   # after
   - route:
       from:
         uri: "kamelet:timer-source"
         parameters:
           period: 10000
           message: "{{input}}"
         steps:
           - to:
               uri: "kamelet:extract-field-action"
               parameters:
                 field: "{{field.name}}"
           - to:
               uri: "{{http.sink.url}}/result"
   ```
   
   Naming follows what the route based tests in this module already use 
(`couchbase-source-route.yaml`, the Cassandra ones): `<name>-pipe.yaml` becomes 
`<name>-route.yaml`, the Citrus file is renamed to match, and the test name 
moves from `<name>-pipe-test` to `<name>-route-test`.
   
   Same Kamelet, same properties, same assertions — only the DSL changes.
   
   ## Verified
   
   ```
   TOTAL:    7
   PASSED:   7 (100.0%)
   ```
   
   Run as `./mvnw clean verify -pl :camel-kamelets-itest 
-Denable.integration.tests -Dit.test='CommonIT#transformation'`. The `clean` 
matters: without it the suite reports 14 tests, because `target/test-classes` 
still holds the deleted Pipe copies and the package scan picks up both.
   
   ## Reviewing the diff
   
   Git pairs these by content similarity, so the rename lines look scrambled — 
it reports things like `hoist-field-action-pipe.yaml => 
data-type-action-route.yaml` because the files differ by only a couple of 
words. The content is correctly matched; each `<name>-route.yaml` targets 
`kamelet:<name>`, which is worth checking with:
   
   ```
   for f in */*-route.yaml; do grep -oE 'kamelet:[a-z-]+' $f | sed -n 2p; done
   ```
   
   ## If this shape is right
   
   I would follow with the rest grouped by directory — avro, protobuf, kafka, 
jira, salesforce, slack, then the singles — in a few more PRs of comparable 
size.
   
   ---
   _Claude Code on behalf of Andrea Cosentino_
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to