G
YouTube TikTok Games
Skip to content

CAMEL-26933: camel-launcher - camel export from the launcher exports the Citrus tests - #29920

Open
davsclaus wants to merge 2 commits into
mainfrom
CAMEL-26933-export-embedded-tests
Open

davsclaus wants to merge 2 commits into
mainfrom
CAMEL-26933-export-embedded-tests

Conversation

@davsclaus

Copy link
Copy Markdown
Contributor

Item 1 of CAMEL-26933.

Problem

camel export from the launcher never exports the Citrus tests. CliExportContext takes the exporters from PluginHelper.getActivePlugins, which reads only ~/.camel-jbang-plugins.json. The launcher embeds the test plugin and calls plugin.customize (CamelLauncherMain) without registering it, so TestPluginExporter never runs: the export exits 0 and src/test is missing. After camel plugin add test the tests are exported, and camel-jbang-test.adoc says they are.

On the launcher from main, with hello.yaml and test/hello.citrus.it.yaml:

$ camel export hello.yaml test/hello.citrus.it.yaml --gav=com.acme:hello:1.0 --runtime=camel-main --dir=out
                                   # exit 0, out/src/test: 0 files

Change

  • CamelJBangMain.getEmbeddedPlugins(target) (new, none by default): the plugins built into the CLI that contribute to a command.
  • CamelLauncherMain returns its embedded plugins whose PluginType lists the command in appliesTo. Today that is the test plugin for export.
  • CliExportContext adds them to the plugins of the plugin configuration, unless the configuration has the same plugin (after camel plugin add test), so an exporter does not run twice.

After, on the launcher built from this branch:

$ camel export hello.yaml test/hello.citrus.it.yaml --gav=com.acme:hello:1.0 --runtime=camel-main --dir=out
out/src/test/resources/hello.citrus.it.yaml
out/src/test/java/com/acme/hello/HelloCitrusIT.java

Tests

  • CliExportContextEmbeddedPluginsTest: the export has the exporter of an embedded plugin; without embedded plugins, only those of the configuration.
  • CamelLauncherMainEmbeddedPluginsTest: the launcher's test plugin contributes to export with its exporter, and to run nothing.
  • End to end with the launcher distribution built from this branch, as above.
  • camel-jbang-run: 303 tests pass. camel-jbang-core: 3004 + 259 pass (DependencyUpdateTest failed once and passed on the rerun, as on other branches). camel-launcher: 416 pass.

Claude Code on behalf of davsclaus

🤖 Generated with Claude Code

…the Citrus tests

The export took its exporters from the plugin configuration only, and the launcher
embeds the test plugin without registering it there, so camel export from the
launcher never had the Citrus tests (src/test was missing), unlike after camel
plugin add test.

CamelJBangMain.getEmbeddedPlugins(target) gives the plugins built into the CLI that
contribute to a command: the launcher returns its embedded plugins whose PluginType
lists the command (the test plugin for export). CliExportContext adds them to the
plugins of the configuration, unless the configuration has the same plugin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>
@davsclaus davsclaus added this to the 4.24.0 milestone Nov 14, 2026
@davsclaus davsclaus added bug Something isn't working dsl labels Nov 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 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 have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@gnodet

gnodet commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

🔄 Backport Bot

This bugfix targets main and may need porting to:

  • camel-4.22.x

Add a port/<branch> label to automatically create a backport PR for that branch.

Backport PRs will be created automatically on merge (once a port label is added). Comment /port to create them immediately.

ℹ️ If you push additional commits after /port, use /port again to update the port PRs.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Javadoc for getEmbeddedPlugins was inserted between the existing postAddCommands Javadoc and the postAddCommands method itself, orphaning the original documentation:

/**
 * Called after default commands has been added
 */
// ← new method inserted here ↓
/**
 * The plugins that this CLI has built in...
 */
public Collection<Plugin> getEmbeddedPlugins(String target) { ... }

public void postAddCommands(...)   // ← lost its Javadoc

Java associates the closest preceding /** */ block with the declaration, so postAddCommands ends up undocumented. Move getEmbeddedPlugins (and its Javadoc) after postAddCommands, or move the postAddCommands Javadoc to just above postAddCommands.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

…which keeps its Javadoc

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Claus Ibsen <claus.ibsen@gmail.com>

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous finding addressed. ✅

The Javadoc for getEmbeddedPlugins is now correctly placed after postAddCommands — postAddCommands retains its Javadoc, and no documentation is orphaned. No new issues found.

LGTM.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@github-actions

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • dsl/camel-jbang/camel-jbang-core
  • dsl/camel-jbang/camel-launcher

🔁 1 test passed only after a retry on JDK 21 (1 retried attempt)

Recovered flaky tests on JDK 21 (1)
Module Test Failed attempts First failure
dsl/camel-jbang/camel-jbang-plugin-tui AiPanelAcpTest.aJsonRpcErrorKeepsTheSessionAlive 1 the second question reaches the same agent ==> expected: <2> but was: <1>

ℹ️ These tests did not fail the build. Surefire retried them and they passed.
Retries are enabled project-wide by surefire.rerunFailingTestsCount in parent/pom.xml.


🔬 Scalpel shadow comparison — Scalpel: 5 of 726 tested, 7 compile-only — current: 5 all tested

Maveniverse Scalpel detected 5 affected modules (current approach: 5).

Skip-tests mode would test 5 modules (2 direct + 5 downstream), skip tests for 7 (generated code, meta-modules)

Modules Scalpel would test (5)
  • camel-jbang-mcp ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-mcp ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-tui ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-validate ← downstream of org.apache.camel:camel-jbang-core
  • camel-launcher-container ← downstream of org.apache.camel:camel-launcher
Modules with tests skipped (7)
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • coverage

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • dsl/camel-jbang/camel-jbang-core: 2 test(s) disabled on GitHub Actions

💡 Manual integration tests recommended:

You modified dsl/camel-jbang/camel-jbang-core, dsl/camel-jbang/camel-launcher. 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
All tested modules (14 modules, 2m 24s total)

Total reactor time: 2m 24s

Module Duration Status
Camel :: JBang :: MCP 57.0s SUCCESS
Camel :: JBang :: Plugin :: Validate 28.6s SUCCESS
Camel :: JBang :: Plugin :: Kubernetes 20.8s SUCCESS
Camel :: JBang :: Plugin :: Testing 14.2s SUCCESS
Camel :: JBang :: Plugin :: Generate 9.0s SUCCESS
Camel :: Coverage 6.7s SUCCESS
Camel :: JBang :: Plugin :: MCP 2.4s SUCCESS
Camel :: JBang :: Plugin :: Edit 2.0s SUCCESS
Camel :: JBang :: Main 1.6s SUCCESS
Camel :: JBang :: Integration tests 1.3s SUCCESS
Camel :: Launcher :: Container 0.8s SUCCESS
Camel :: JBang :: Core n/a
Camel :: JBang :: Plugin :: TUI n/a
Camel :: Launcher n/a

Top 20 slowest modules:

  • Camel :: JBang :: MCP (57.0s)
  • Camel :: JBang :: Plugin :: Validate (28.6s)
  • Camel :: JBang :: Plugin :: Kubernetes (20.8s)
  • Camel :: JBang :: Plugin :: Testing (14.2s)
  • Camel :: JBang :: Plugin :: Generate (9.0s)
  • Camel :: Coverage (6.7s)
  • Camel :: JBang :: Plugin :: MCP (2.4s)
  • Camel :: JBang :: Plugin :: Edit (2.0s)
  • Camel :: JBang :: Main (1.6s)
  • Camel :: JBang :: Integration tests (1.3s)
  • Camel :: Launcher :: Container (0.8s)

⚙️ View full build and test results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dsl

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants