diff --git a/java/serving/src/test/java/feast/serving/it/ServingEnvironment.java b/java/serving/src/test/java/feast/serving/it/ServingEnvironment.java index 43b82345c6..5489203856 100644 --- a/java/serving/src/test/java/feast/serving/it/ServingEnvironment.java +++ b/java/serving/src/test/java/feast/serving/it/ServingEnvironment.java @@ -63,6 +63,11 @@ static void globalSetup() { .withExposedService( "feast", 8080, Wait.forListeningPort().withStartupTimeout(Duration.ofSeconds(180))) .withTailChildContainers(true); + + if (System.getenv("FEAST_TESTCONTAINERS_LOCAL_COMPOSE") != null) { + environment = environment.withLocalCompose(true); + } + environment.start(); } @@ -136,7 +141,7 @@ ApplicationProperties applicationProperties() { server = injector.getInstance(Server.class); server.start(); - channel = ManagedChannelBuilder.forAddress("localhost", serverPort).usePlaintext().build(); + channel = ManagedChannelBuilder.forAddress("127.0.0.1", serverPort).usePlaintext().build(); servingStub = ServingServiceGrpc.newBlockingStub(channel) diff --git a/java/serving/src/test/java/feast/serving/it/ServingRedisAzureRegistryIT.java b/java/serving/src/test/java/feast/serving/it/ServingRedisAzureRegistryIT.java index 8ab658fc2a..0b1ecca7d2 100644 --- a/java/serving/src/test/java/feast/serving/it/ServingRedisAzureRegistryIT.java +++ b/java/serving/src/test/java/feast/serving/it/ServingRedisAzureRegistryIT.java @@ -50,8 +50,10 @@ private static BlobServiceClient createClient() { return new BlobServiceClientBuilder() .endpoint( String.format( - "http://localhost:%d/%s", - azureBlobMock.getMappedPort(BLOB_STORAGE_PORT), TEST_ACCOUNT_NAME)) + "http://%s:%d/%s", + azureBlobMock.getHost(), + azureBlobMock.getMappedPort(BLOB_STORAGE_PORT), + TEST_ACCOUNT_NAME)) .credential(CREDENTIAL) .buildClient(); } @@ -95,8 +97,10 @@ public BlobServiceClient awsStorage() { return new BlobServiceClientBuilder() .endpoint( String.format( - "http://localhost:%d/%s", - azureBlobMock.getMappedPort(BLOB_STORAGE_PORT), TEST_ACCOUNT_NAME)) + "http://%s:%d/%s", + azureBlobMock.getHost(), + azureBlobMock.getMappedPort(BLOB_STORAGE_PORT), + TEST_ACCOUNT_NAME)) .credential(CREDENTIAL) .buildClient(); } diff --git a/java/serving/src/test/java/feast/serving/it/ServingRedisGSRegistryIT.java b/java/serving/src/test/java/feast/serving/it/ServingRedisGSRegistryIT.java index 96aa2077c0..b3f185bbda 100644 --- a/java/serving/src/test/java/feast/serving/it/ServingRedisGSRegistryIT.java +++ b/java/serving/src/test/java/feast/serving/it/ServingRedisGSRegistryIT.java @@ -61,7 +61,7 @@ private static Storage createClient() { return StorageOptions.newBuilder() .setProjectId(TEST_PROJECT) .setCredentials(ServiceAccountCredentials.create(credential)) - .setHost("http://localhost:" + gcsMock.getMappedPort(GCS_PORT)) + .setHost(String.format("http://%s:%d", gcsMock.getHost(), gcsMock.getMappedPort(GCS_PORT))) .build() .getService(); } @@ -89,7 +89,8 @@ Storage googleStorage(ApplicationProperties applicationProperties) { return StorageOptions.newBuilder() .setProjectId(TEST_PROJECT) .setCredentials(ServiceAccountCredentials.create(credential)) - .setHost("http://localhost:" + gcsMock.getMappedPort(GCS_PORT)) + .setHost( + String.format("http://%s:%d", gcsMock.getHost(), gcsMock.getMappedPort(GCS_PORT))) .build() .getService(); } diff --git a/java/serving/src/test/java/feast/serving/it/ServingRedisS3RegistryIT.java b/java/serving/src/test/java/feast/serving/it/ServingRedisS3RegistryIT.java index 52e1af9065..67ba11128f 100644 --- a/java/serving/src/test/java/feast/serving/it/ServingRedisS3RegistryIT.java +++ b/java/serving/src/test/java/feast/serving/it/ServingRedisS3RegistryIT.java @@ -42,7 +42,8 @@ private static AmazonS3 createClient() { return AmazonS3ClientBuilder.standard() .withEndpointConfiguration( new AwsClientBuilder.EndpointConfiguration( - String.format("http://localhost:%d", s3Mock.getHttpServerPort()), TEST_REGION)) + String.format("http://%s:%d", s3Mock.getHost(), s3Mock.getHttpServerPort()), + TEST_REGION)) .withCredentials(credentials) .enablePathStyleAccess() .build(); @@ -89,7 +90,8 @@ public AmazonS3 awsStorage() { return AmazonS3ClientBuilder.standard() .withEndpointConfiguration( new AwsClientBuilder.EndpointConfiguration( - String.format("http://localhost:%d", s3Mock.getHttpServerPort()), TEST_REGION)) + String.format("http://%s:%d", s3Mock.getHost(), s3Mock.getHttpServerPort()), + TEST_REGION)) .withCredentials(credentials) .enablePathStyleAccess() .build();