From 0a58119f27560abe81d743fee2dd9a6051d1445e Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Fri, 19 May 2023 10:27:03 +0200 Subject: [PATCH 1/2] Use nip.io domain in MinioExtension This commit also re-enables MinioExtension on macOS since the switch to nip.io fixes the localhost subdomain issue. --- .../java/org/projectnessie/minio/MinioContainer.java | 5 +++-- .../java/org/projectnessie/minio/MinioExtension.java | 10 +++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/testing/s3minio/src/main/java/org/projectnessie/minio/MinioContainer.java b/testing/s3minio/src/main/java/org/projectnessie/minio/MinioContainer.java index 348029bdc0b..54be92842f0 100644 --- a/testing/s3minio/src/main/java/org/projectnessie/minio/MinioContainer.java +++ b/testing/s3minio/src/main/java/org/projectnessie/minio/MinioContainer.java @@ -47,6 +47,7 @@ final class MinioContainer extends GenericContainer private static final String DEFAULT_STORAGE_DIRECTORY = "/data"; private static final String HEALTH_ENDPOINT = "/minio/health/ready"; + private static final String MINIO_DOMAIN_NIP = "minio.127-0-0-1.nip.io"; private final String accessKey; private final String secretKey; @@ -74,7 +75,7 @@ public MinioContainer(String image, String accessKey, String secretKey, String b withEnv(MINIO_ACCESS_KEY, this.accessKey); withEnv(MINIO_SECRET_KEY, this.secretKey); // S3 SDK encodes bucket names in host names - need to tell Minio which domain to use - withEnv(MINIO_DOMAIN, "localhost"); + withEnv(MINIO_DOMAIN, MINIO_DOMAIN_NIP); withCommand("server", DEFAULT_STORAGE_DIRECTORY); setWaitStrategy( new HttpWaitStrategy() @@ -149,7 +150,7 @@ public URI s3BucketUri(String path) { public void start() { super.start(); - this.hostPort = getHost() + ":" + getMappedPort(DEFAULT_PORT); + this.hostPort = MINIO_DOMAIN_NIP + ":" + getMappedPort(DEFAULT_PORT); this.s3endpoint = String.format("http://%s/", hostPort); this.bucketBaseUri = URI.create(String.format("s3://%s/", bucket())); diff --git a/testing/s3minio/src/main/java/org/projectnessie/minio/MinioExtension.java b/testing/s3minio/src/main/java/org/projectnessie/minio/MinioExtension.java index 602fa0fe7b2..cf8db1d497e 100644 --- a/testing/s3minio/src/main/java/org/projectnessie/minio/MinioExtension.java +++ b/testing/s3minio/src/main/java/org/projectnessie/minio/MinioExtension.java @@ -51,14 +51,10 @@ public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext con if (OS.current() == OS.LINUX) { return enabled("Running on Linux"); } - if (OS.current() == OS.MAC && System.getenv("CI_MAC") == null) { - // Disable tests on GitHub Actions - return enabled("Running on macOS locally"); + if (OS.current() == OS.MAC) { + return enabled("Running on macOS"); } - return disabled( - format( - "Disabled on %s, because it doesn't support wildcard localhost FQDNs.", - OS.current().name())); + return disabled(format("Disabled on %s", OS.current().name())); } @Override From f89cd8fddc28cd616f92af25d6615b09c95de4e8 Mon Sep 17 00:00:00 2001 From: Alexandre Dutra Date: Fri, 19 May 2023 14:07:20 +0200 Subject: [PATCH 2/2] Revert CI changes --- .../main/java/org/projectnessie/minio/MinioExtension.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/testing/s3minio/src/main/java/org/projectnessie/minio/MinioExtension.java b/testing/s3minio/src/main/java/org/projectnessie/minio/MinioExtension.java index cf8db1d497e..f552b0b87c5 100644 --- a/testing/s3minio/src/main/java/org/projectnessie/minio/MinioExtension.java +++ b/testing/s3minio/src/main/java/org/projectnessie/minio/MinioExtension.java @@ -51,8 +51,9 @@ public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext con if (OS.current() == OS.LINUX) { return enabled("Running on Linux"); } - if (OS.current() == OS.MAC) { - return enabled("Running on macOS"); + if (OS.current() == OS.MAC && System.getenv("CI_MAC") == null) { + // Disable tests on GitHub Actions + return enabled("Running on macOS locally"); } return disabled(format("Disabled on %s", OS.current().name())); }