You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "ammachado (via GitHub)" <gi...@apache.org> on 2026/06/22 21:32:30 UTC

[PR] CAMEL-23688: camel-jbang - add unit tests for action reader CLI commands [camel]

ammachado opened a new pull request, #24189:
URL: https://github.com/apache/camel/pull/24189

   # Description
   
   Follow-up to #24188 (action-writer command tests, merged), continuing the
   [CAMEL-23688](https://issues.apache.org/jira/browse/CAMEL-23688) effort to build a regression
   safety net around the `camel-jbang` CLI `action` commands before refactoring.
   
   This batch covers the **request/response "reader" commands**: those that write an action request
   to `<pid>-action.json`, then poll `<pid>-output.json` for the running Camel's response and render
   it to the console.
   
   **New test infrastructure** (`ActionCommandTestSupport`):
   - `callWithResponse(command, response)` runs a reader command end to end. It starts a background
     "responder" thread that waits (via Awaitility, no `Thread.sleep`) for the command to write its
     action request, then writes the simulated output file. Waiting for the action file is what makes
     it deterministic: the reader commands delete any stale output file *before* writing the action
     request, so the simulated response can only land after that delete.
   
   **Commands covered** (one `*Test` each, all in `commands/action/`):
   
   | Command | Action verb | Kind |
   |---------|-------------|------|
   | `CamelGCAction` | `gc` | fire-and-forget writer |
   | `CamelRouteDumpAction` | `route-dump` | reader |
   | `CamelBeanDump` | `bean` | reader |
   | `CamelThreadDump` | `thread-dump` | reader |
   | `CamelSourceTop` | `top-processors` | reader |
   | `RouteControllerAction` | `route-controller` | reader |
   
   Each test asserts both the action-request payload the command writes **and** the rendered console
   output from a simulated response, plus a no-match path (no running process resolved). Process
   discovery is mocked with a static `ProcessHandle` mock, matching the existing tests in this package.
   
   This is a **test-only** change: no production code is touched and there is no user-visible behavior
   change, so no upgrade-guide entry is required.
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch)
   
   # Tracking
   - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful subject line and body.
   - [x] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes.
   
   ---
   
   _Claude Code on behalf of Adriano Machado_


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23688: camel-jbang - add unit tests for action reader CLI commands [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #24189:
URL: https://github.com/apache/camel/pull/24189#issuecomment-4775340731

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `dsl/camel-jbang/camel-jbang-core`
   
   :warning: **Some tests are disabled on GitHub Actions** (`@DisabledIfSystemProperty(named = "ci.env.name")`) and require manual verification:
   
   - `dsl/camel-jbang/camel-jbang-core`: 1 test(s) disabled on GitHub Actions
   
   :bulb: **Manual integration tests recommended:**
   
   > You modified `dsl/camel-jbang/camel-jbang-core`. The related integration tests in `dsl/camel-jbang/camel-jbang-it` are excluded from CI. Consider running them manually:
   > ```
   > mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
   > ```
   
   <details><summary>All tested modules (6 modules)</summary>
   
   - Camel :: JBang :: Core
   - Camel :: JBang :: MCP
   - Camel :: JBang :: Plugin :: Route Parser
   - Camel :: JBang :: Plugin :: TUI
   - Camel :: JBang :: Plugin :: Validate
   - Camel :: Launcher :: Container
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/27985470076)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23688: camel-jbang - add unit tests for action reader CLI commands [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #24189:
URL: https://github.com/apache/camel/pull/24189#issuecomment-4775239012

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23688: camel-jbang - add unit tests for action reader CLI commands [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #24189:
URL: https://github.com/apache/camel/pull/24189


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org