From bbbb2ae018a9de1ad3b4f830e0b3157db377146c Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Sun, 9 Jun 2024 21:04:11 +0200 Subject: [PATCH 1/2] Bump supported API version check --- .../groovy/de/gesellix/docker/engine/TestConstants.groovy | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/integrationtest/src/test/groovy/de/gesellix/docker/engine/TestConstants.groovy b/integrationtest/src/test/groovy/de/gesellix/docker/engine/TestConstants.groovy index 8300c94c..a8193243 100644 --- a/integrationtest/src/test/groovy/de/gesellix/docker/engine/TestConstants.groovy +++ b/integrationtest/src/test/groovy/de/gesellix/docker/engine/TestConstants.groovy @@ -16,17 +16,16 @@ class TestConstants { imageName = "$imageRepo:$imageTag" versionDetails = [ - ApiVersion : { it in ["1.43", "1.44"] }, + ApiVersion : { it in ["1.43", "1.44", "1.45"] }, Arch : { it in ["amd64", "arm64"] }, BuildTime : { it =~ "\\d{4}-\\d{2}-\\d{2}T\\w+" }, GitCommit : { it =~ "\\w{6,}" }, GoVersion : { it =~ "go\\d+.\\d+.\\d+" }, KernelVersion: { it =~ "\\d.\\d{1,2}.\\d{1,2}\\w*" }, - MinAPIVersion: { it == "1.12" }, + MinAPIVersion: { it in ["1.12", "1.24"] }, Os : { it == "linux" }, Version : { it == "master" || it =~ "\\d{1,2}.\\d{1,2}.\\d{1,2}\\w*" }] if (LocalDocker.isNativeWindows()) { - versionDetails.MinAPIVersion = { it == "1.24" } versionDetails.Os = { it == "windows" } } } From a4dae81a00eeaeacc459c0a8e0ea6c81c2460bb8 Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Sun, 9 Jun 2024 21:25:35 +0200 Subject: [PATCH 2/2] Let the integration test succeed on Colima (macOS) Example DOCKER_HOST: /Users/runner/.colima/default/docker.sock --- .../engine/OkDockerClientIntegrationSpec.groovy | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/integrationtest/src/test/groovy/de/gesellix/docker/engine/OkDockerClientIntegrationSpec.groovy b/integrationtest/src/test/groovy/de/gesellix/docker/engine/OkDockerClientIntegrationSpec.groovy index f45560a1..341757ba 100644 --- a/integrationtest/src/test/groovy/de/gesellix/docker/engine/OkDockerClientIntegrationSpec.groovy +++ b/integrationtest/src/test/groovy/de/gesellix/docker/engine/OkDockerClientIntegrationSpec.groovy @@ -95,19 +95,23 @@ class OkDockerClientIntegrationSpec extends Specification { @Requires({ LocalDocker.isUnixSocket() }) def "should support unix socket connections (Linux native or Docker for Mac)"() { - def client = new OkDockerClient("unix:///var/run/docker.sock") + def client = new OkDockerClient() when: def response = client.request(new EngineRequest(GET, "/info")) then: + def dockerHost = client.getDockerClientConfig().getEnv().getDockerHost() + dockerHost.startsWith("unix://") response.status.code == 200 } @Requires({ LocalDocker.isNamedPipe() }) def "should support named pipe socket connections (Docker for Windows)"() { - def client = new OkDockerClient("npipe:////./pipe/docker_engine") + def client = new OkDockerClient() when: def response = client.request(new EngineRequest(GET, "/info")) then: + def dockerHost = client.getDockerClientConfig().getEnv().getDockerHost() + dockerHost.startsWith("npipe://") response.status.code == 200 } @@ -169,8 +173,7 @@ class OkDockerClientIntegrationSpec extends Specification { if (stdout.toString() == expectedOutput) { log.info("[attach (interactive)] consumed (complete: ${stdout.toString() == expectedOutput})\n${stdout.toString()}") onSourceConsumed.countDown() - } - else { + } else { log.info("[attach (interactive)] consumed (complete: ${stdout.toString() == expectedOutput})\n${stdout.toString()}") } }