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 19:03:50 UTC
[PR] CAMEL-23688: camel-jbang - add unit tests for action-writer CLI commands [camel]
ammachado opened a new pull request, #24188:
URL: https://github.com/apache/camel/pull/24188
# Description
Adds unit test coverage for the fire-and-forget **action** commands in `camel-jbang-core`, which previously had no tests. This is part of [CAMEL-23688](https://issues.apache.org/jira/browse/CAMEL-23688) (extensive test coverage of the jbang CLI commands, as a safety net ahead of refactoring), following the already-merged work on the `process` package (#23812, #23869).
These commands resolve a running Camel integration by name/pid and write an action request file (`<pid>-action.json`) for the integration to pick up. Commands covered:
- `start-route` / `stop-route` / `suspend-route` / `resume-route`
- `start-group` / `stop-group`
- `reload` / `reset-stats`
- `enable-processor` / `disable-processor`
### Test infrastructure
A new `ActionCommandTestSupport` base mirrors the proven `ProcessCommandTestSupport` pattern (`mockStatic` on `ProcessHandle`, status-file fixtures, recursive cleanup) and adds:
- `readActionFile(pid)` to assert the written action payload.
- `callWithSingleProcess(command)` which owns the `ProcessHandle` mock setup so each test stays focused on its assertions.
### What each test verifies
Tests assert intent, not just exit code:
- pid resolution by Camel context name,
- the exact written action payload (`action` / `command` / `id`, plus the `group` flag for group actions),
- that **no** action file is written when no process matches.
# 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.
---
_Test-only change (no production code touched). Verified locally: `mvn -pl dsl/camel-jbang/camel-jbang-core test` for the new `commands.action.*Test` classes runs 25 tests, 0 failures; `formatter:format impsort:sort` is clean._
_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-writer CLI commands [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #24188:
URL: https://github.com/apache/camel/pull/24188
--
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-writer CLI commands [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #24188:
URL: https://github.com/apache/camel/pull/24188#issuecomment-4772363611
: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-writer CLI commands [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #24188:
URL: https://github.com/apache/camel/pull/24188#issuecomment-4772563340
<!-- 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/27977001967)
--
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