This is an automated email from the ASF dual-hosted git repository.
Croway pushed a commit to branch camel-4.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-4.18.x by this push:
new 9f221ee7bf09 ci: fix JBang IT tests on 4.18.x
9f221ee7bf09 is described below
commit 9f221ee7bf09d1623011fba7c9afa9b5ffd4b297
Author: Croway <[email protected]>
AuthorDate: Mon May 4 15:51:24 2026 +0200
ci: fix JBang IT tests on 4.18.x
Make `jbang version --update` non-fatal in the Dockerfile — when jbang
is already at the latest version, the update command returns exit code 1
which aborts the Docker image build entirely. Every test container fails
to build, causing all IT tests to error out.
Also add a null-guard for ExtensionContext in TestServiceUtil.logAndRethrow
(backport from main). AbstractTestSupport calls beforeAll(null), and when
the Docker build failure triggers the error logging path, the null context
causes a NullPointerException that masks the real error.
---
.../org/apache/camel/test/infra/cli/services/Dockerfile | 2 +-
.../test/infra/common/services/TestServiceUtil.java | 16 ++++++++++------
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git
a/test-infra/camel-test-infra-cli/src/test/resources/org/apache/camel/test/infra/cli/services/Dockerfile
b/test-infra/camel-test-infra-cli/src/test/resources/org/apache/camel/test/infra/cli/services/Dockerfile
index 39d22a292826..7fe89a9d5816 100644
---
a/test-infra/camel-test-infra-cli/src/test/resources/org/apache/camel/test/infra/cli/services/Dockerfile
+++
b/test-infra/camel-test-infra-cli/src/test/resources/org/apache/camel/test/infra/cli/services/Dockerfile
@@ -84,7 +84,7 @@ EXPOSE 22
USER jbang
RUN echo "Updating jbang" \
- && jbang version --update
+ && jbang version --update || true
RUN echo "Clearing JBang cache" \
&& jbang cache clear
diff --git
a/test-infra/camel-test-infra-common/src/test/java/org/apache/camel/test/infra/common/services/TestServiceUtil.java
b/test-infra/camel-test-infra-common/src/test/java/org/apache/camel/test/infra/common/services/TestServiceUtil.java
index de979691f9eb..ea40bb13e337 100644
---
a/test-infra/camel-test-infra-common/src/test/java/org/apache/camel/test/infra/common/services/TestServiceUtil.java
+++
b/test-infra/camel-test-infra-common/src/test/java/org/apache/camel/test/infra/common/services/TestServiceUtil.java
@@ -70,14 +70,18 @@ public final class TestServiceUtil {
*/
public static void logAndRethrow(TestService service, ExtensionContext
extensionContext, Exception exception)
throws Exception {
- final Object testInstance =
extensionContext.getTestInstance().orElse(null);
+ if (extensionContext != null) {
+ final Object testInstance =
extensionContext.getTestInstance().orElse(null);
- if (testInstance != null) {
- LOG.error("Failed to initialize service {} for test {} on ({})",
service.getClass().getSimpleName(),
- extensionContext.getDisplayName(),
testInstance.getClass().getName());
+ if (testInstance != null) {
+ LOG.error("Failed to initialize service {} for test {} on
({})", service.getClass().getSimpleName(),
+ extensionContext.getDisplayName(),
testInstance.getClass().getName());
+ } else {
+ LOG.error("Failed to initialize service {} for test {}",
service.getClass().getSimpleName(),
+ extensionContext.getDisplayName());
+ }
} else {
- LOG.error("Failed to initialize service {} for test {}",
service.getClass().getSimpleName(),
- extensionContext.getDisplayName());
+ LOG.error("Failed to initialize service {}",
service.getClass().getSimpleName());
}
throw exception;