From f6080e0c95ae59eeb8c0ca3584d562bff66cd119 Mon Sep 17 00:00:00 2001 From: Nicolas Pepin-Perreault Date: Sun, 29 Dec 2024 20:35:09 +0100 Subject: [PATCH] build: change TCC detection condition --- .github/workflows/test.yml | 4 ++++ .../java/io/zeebe/containers/util/TestcontainersSupport.java | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 13b46262..b291d3de 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,6 +28,8 @@ jobs: token: ${{ secrets.TC_CLOUD_TOKEN }} - name: Test timeout-minutes: 20 + env: + TCC_ENABLED: true run: > ./mvnw -B -Pparallel-tests -DforkCount=2C -DskipChecks -pl core verify - name: Terminate Testcontainers Cloud Client active sessions @@ -90,6 +92,8 @@ jobs: token: ${{ secrets.TC_CLOUD_TOKEN }} - name: Test timeout-minutes: 20 + env: + TCC_ENABLED: true run: > ./mvnw -B -Pparallel-tests -DforkCount=2C -DskipChecks -pl engine verify - name: Terminate Testcontainers Cloud Client active sessions diff --git a/core/src/test/java/io/zeebe/containers/util/TestcontainersSupport.java b/core/src/test/java/io/zeebe/containers/util/TestcontainersSupport.java index e5142d2f..2eef4621 100644 --- a/core/src/test/java/io/zeebe/containers/util/TestcontainersSupport.java +++ b/core/src/test/java/io/zeebe/containers/util/TestcontainersSupport.java @@ -26,6 +26,7 @@ import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.condition.DisabledIf; import org.testcontainers.DockerClientFactory; +import org.testcontainers.Testcontainers; @API(status = Status.INTERNAL) public final class TestcontainersSupport { @@ -37,7 +38,7 @@ private TestcontainersSupport() {} *

This isn't perfect as it's clearly breaking implementation details, but it works for now. */ public static boolean isCloudEnv() { - if (System.getenv().containsKey("TC_CLOUD_TOKEN")) { + if (System.getenv().getOrDefault("TCC_ENABLED", "false").equals("true")) { return true; }