gnodet-bot commented on code in PR #29153:
URL: https://github.com/apache/camel/pull/29153#discussion_r4510902236
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Debug.java:
##########
@@ -579,6 +612,10 @@ protected int doRunDebug(KameletMain main) throws
Exception {
ProcessBuilder pb = new ProcessBuilder();
pb.command(cmds);
+ if (background) {
+ return runBackgroundProcess(pb, "Camel");
Review Comment:
💡 **Nit:** Use `"Camel Debug"` instead of `"Camel"` as the kind string to
match the command name and make process listings more identifiable.
```suggestion
return runBackgroundProcess(pb, "Camel Debug");
```
##########
dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/CommandInputErrorsTest.java:
##########
@@ -154,6 +154,31 @@ void debugNeedsATerminalBeforeAttaching() {
.extracting(e -> ((CliException)
e).getExitCode()).isEqualTo(CliExitCode.USAGE);
}
+ @Test
+ void debugSpringBootInTheBackground() throws Exception {
+ // Spring Boot registers stopOnExit hooks that kill the child when
this JVM exits; --background exits
+ // immediately and would stop the integration before it starts
+ Path pom = Files.writeString(dir.resolve("pom.xml"),
+ "<project><dependencyManagement><dependencies>"
+ +
"<dependency><groupId>org.apache.camel.springboot</groupId>"
+ +
"<artifactId>camel-spring-boot-bom</artifactId><version>4.9.0</version>"
+ +
"<type>pom</type><scope>import</scope></dependency>"
+ +
"</dependencies></dependencyManagement></project>");
+
+ assertThatThrownBy(() -> call(new Debug(main), "--background",
pom.toString()))
+ .isInstanceOf(CliException.class)
+ .hasMessage("Debug Camel Spring Boot with --background is not
supported")
+ .extracting(e -> ((CliException)
e).getExitCode()).isEqualTo(CliExitCode.USAGE);
+ }
+
+ @Test
+ void debugBackgroundAndRemoteAttachAreMutuallyExclusive() {
+ assertThatThrownBy(() -> call(new Debug(main), "--background",
"--remote-attach"))
+ .isInstanceOf(CliException.class)
+ .hasMessage("--background and --remote-attach are mutually
exclusive")
+ .extracting(e -> ((CliException)
e).getExitCode()).isEqualTo(CliExitCode.USAGE);
Review Comment:
⚠️ **Missing happy-path test**: Both new tests assert error conditions only.
Consider adding a test that verifies `camel debug --background` on a standard
Camel route exits successfully (exit code 0), which is the primary use case
being enabled by this PR.
--
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]