Skip to content

Commit f17efa6

Browse files
committed
Addressing review comments, rebase
1 parent 0e1ec8a commit f17efa6

14 files changed

+49
-36
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
import org.apache.polaris.core.admin.model.StorageConfigInfo;
2424

2525
/** Runs PolarisRestCatalogIntegrationBase test on Azure. */
26-
public abstract class PolarisRestCatalogAzureIntegrationTestBase
26+
public abstract class PolarisRestCatalogAdlsIntegrationTestBase
2727
extends PolarisRestCatalogIntegrationBase {
28-
public static final String TENANT_ID = System.getenv("INTEGRATION_TEST_AZURE_TENANT_ID");
29-
public static final String BASE_LOCATION = System.getenv("INTEGRATION_TEST_AZURE_PATH");
28+
public static final String TENANT_ID = System.getenv("INTEGRATION_TEST_ADLS_TENANT_ID");
29+
public static final String BASE_LOCATION = System.getenv("INTEGRATION_TEST_ADLS_PATH");
3030

3131
@Override
3232
protected StorageConfigInfo getStorageConfigInfo() {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import org.apache.polaris.core.admin.model.StorageConfigInfo;
2424

2525
/** Runs PolarisRestCatalogIntegrationBase test on GCP. */
26-
public abstract class PolarisRestCatalogGcpIntegrationTestBase
26+
public abstract class PolarisRestCatalogGcsIntegrationTestBase
2727
extends PolarisRestCatalogIntegrationBase {
2828
public static final String SERVICE_ACCOUNT =
2929
System.getenv("INTEGRATION_TEST_GCS_SERVICE_ACCOUNT");
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.apache.polaris.core.admin.model.StorageConfigInfo;
2525

2626
/** Runs PolarisRestCatalogIntegrationBase test on AWS. */
27-
public abstract class PolarisRestCatalogAwsIntegrationTestBase
27+
public abstract class PolarisRestCatalogS3IntegrationTestBase
2828
extends PolarisRestCatalogIntegrationBase {
2929
public static final String ROLE_ARN =
3030
Optional.ofNullable(System.getenv("INTEGRATION_TEST_ROLE_ARN"))
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,22 @@
2323
import org.apache.hadoop.fs.Path;
2424
import org.apache.polaris.core.admin.model.AzureStorageConfigInfo;
2525
import org.apache.polaris.core.admin.model.StorageConfigInfo;
26+
import org.apache.polaris.core.storage.StorageUtil;
2627

2728
/** Runs PolarisRestCatalogViewIntegrationTest on Azure. */
28-
public abstract class PolarisRestCatalogViewAzureIntegrationTestBase
29+
public abstract class PolarisRestCatalogViewAdlsIntegrationTestBase
2930
extends PolarisRestCatalogViewIntegrationBase {
30-
public static final String TENANT_ID = System.getenv("INTEGRATION_TEST_AZURE_TENANT_ID");
31-
public static final String BASE_LOCATION = System.getenv("INTEGRATION_TEST_AZURE_PATH");
31+
public static final String TENANT_ID = System.getenv("INTEGRATION_TEST_ADLS_TENANT_ID");
32+
public static final String BASE_LOCATION = System.getenv("INTEGRATION_TEST_ADLS_PATH");
3233

3334
@Override
3435
protected StorageConfigInfo getStorageConfigInfo() {
3536
return AzureStorageConfigInfo.builder()
3637
.setTenantId(TENANT_ID)
3738
.setStorageType(StorageConfigInfo.StorageTypeEnum.AZURE)
38-
.setAllowedLocations(List.of(new Path(BASE_LOCATION, POLARIS_IT_SUBDIR).toString()))
39+
.setAllowedLocations(
40+
List.of(
41+
StorageUtil.concatFilePrefixes(BASE_LOCATION, POLARIS_IT_SUBDIR, Path.SEPARATOR)))
3942
.build();
4043
}
4144

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323
import org.apache.hadoop.fs.Path;
2424
import org.apache.polaris.core.admin.model.GcpStorageConfigInfo;
2525
import org.apache.polaris.core.admin.model.StorageConfigInfo;
26+
import org.apache.polaris.core.storage.StorageUtil;
2627

2728
/** Runs PolarisRestCatalogViewIntegrationTest on GCP. */
28-
public abstract class PolarisRestCatalogViewGcpIntegrationTestBase
29+
public abstract class PolarisRestCatalogViewGcsIntegrationTestBase
2930
extends PolarisRestCatalogViewIntegrationBase {
3031
public static final String SERVICE_ACCOUNT =
3132
System.getenv("INTEGRATION_TEST_GCS_SERVICE_ACCOUNT");
@@ -36,7 +37,9 @@ protected StorageConfigInfo getStorageConfigInfo() {
3637
return GcpStorageConfigInfo.builder()
3738
.setGcsServiceAccount(SERVICE_ACCOUNT)
3839
.setStorageType(StorageConfigInfo.StorageTypeEnum.GCS)
39-
.setAllowedLocations(List.of(new Path(BASE_LOCATION, POLARIS_IT_SUBDIR).toString()))
40+
.setAllowedLocations(
41+
List.of(
42+
StorageUtil.concatFilePrefixes(BASE_LOCATION, POLARIS_IT_SUBDIR, Path.SEPARATOR)))
4043
.build();
4144
}
4245

integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewIntegrationBase.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323
import com.google.common.collect.ImmutableMap;
2424
import java.lang.reflect.Method;
25+
import java.nio.file.Path;
2526
import java.util.Map;
26-
import org.apache.hadoop.fs.Path;
2727
import org.apache.iceberg.catalog.TableIdentifier;
2828
import org.apache.iceberg.exceptions.ForbiddenException;
2929
import org.apache.iceberg.rest.RESTCatalog;
@@ -46,7 +46,6 @@
4646
import org.apache.polaris.service.it.env.PolarisClient;
4747
import org.apache.polaris.service.it.ext.PolarisIntegrationTestExtension;
4848
import org.assertj.core.api.AbstractBooleanAssert;
49-
import org.assertj.core.api.AbstractStringAssert;
5049
import org.assertj.core.api.Assertions;
5150
import org.assertj.core.api.Assumptions;
5251
import org.assertj.core.configuration.PreferredAssumptionException;
@@ -237,10 +236,15 @@ public void createViewWithCustomMetadataLocation() {
237236
.isTrue();
238237
Assertions.assertThat(view.properties())
239238
.containsEntry("write.metadata.path", baseCustomWriteMetadataLocation);
240-
((AbstractStringAssert)
241-
Assertions.assertThat(((BaseView) view).operations().current().metadataFileLocation())
242-
.isNotNull())
243-
.startsWith(new Path(baseCustomWriteMetadataLocation).toString());
239+
240+
Assertions.assertThat(((BaseView) view).operations().current().metadataFileLocation())
241+
.isNotNull();
242+
// Normalize paths, remove schema before comparing
243+
String metadataFileLocationPath =
244+
Path.of(((BaseView) view).operations().current().metadataFileLocation()).toUri().getPath();
245+
String baseCustomWriteMetadataLocationPath =
246+
Path.of(baseCustomWriteMetadataLocation).toUri().getPath();
247+
Assertions.assertThat(metadataFileLocationPath).startsWith(baseCustomWriteMetadataLocationPath);
244248
}
245249

246250
@Test
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@
2424
import org.apache.hadoop.fs.Path;
2525
import org.apache.polaris.core.admin.model.AwsStorageConfigInfo;
2626
import org.apache.polaris.core.admin.model.StorageConfigInfo;
27+
import org.apache.polaris.core.storage.StorageUtil;
2728

2829
/** Runs PolarisRestCatalogViewIntegrationTest on AWS. */
29-
public abstract class PolarisRestCatalogViewAwsIntegrationTestBase
30+
public abstract class PolarisRestCatalogViewS3IntegrationTestBase
3031
extends PolarisRestCatalogViewIntegrationBase {
3132
public static final String ROLE_ARN =
3233
Optional.ofNullable(System.getenv("INTEGRATION_TEST_ROLE_ARN")) // Backward compatibility
@@ -38,7 +39,9 @@ protected StorageConfigInfo getStorageConfigInfo() {
3839
return AwsStorageConfigInfo.builder()
3940
.setRoleArn(ROLE_ARN)
4041
.setStorageType(StorageConfigInfo.StorageTypeEnum.S3)
41-
.setAllowedLocations(List.of(new Path(BASE_LOCATION, POLARIS_IT_SUBDIR).toString()))
42+
.setAllowedLocations(
43+
List.of(
44+
StorageUtil.concatFilePrefixes(BASE_LOCATION, POLARIS_IT_SUBDIR, Path.SEPARATOR)))
4245
.build();
4346
}
4447

runtime/service/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ export INTEGRATION_TEST_S3_PATH="s3://bucket/subpath"
2929
export INTEGRATION_TEST_S3_ROLE_ARN="your-role-arn"
3030
./gradlew :polaris-runtime-service:cloudTest
3131
```
32-
For Azure:
32+
For ADLS:
3333
```shell
34-
export INTEGRATION_TEST_AZURE_PATH="abfss://bucket/subpath"
35-
export INTEGRATION_TEST_AZURE_TENANT_ID="your-tenant-id"
34+
export INTEGRATION_TEST_ADLS_PATH="abfss://bucket/subpath"
35+
export INTEGRATION_TEST_ADLS_TENANT_ID="your-tenant-id"
3636
./gradlew :polaris-runtime-service:cloudTest
3737
```
3838
For GCS:
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
package org.apache.polaris.service.it;
2020

2121
import io.quarkus.test.junit.QuarkusIntegrationTest;
22-
import org.apache.polaris.service.it.test.PolarisRestCatalogAzureIntegrationTestBase;
22+
import org.apache.polaris.service.it.test.PolarisRestCatalogAdlsIntegrationTestBase;
2323
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
2424

2525
@QuarkusIntegrationTest
26-
@EnabledIfEnvironmentVariable(named = "INTEGRATION_TEST_AZURE_PATH", matches = ".+")
27-
public class RestCatalogAzureIT extends PolarisRestCatalogAzureIntegrationTestBase {}
26+
@EnabledIfEnvironmentVariable(named = "INTEGRATION_TEST_ADLS_PATH", matches = ".+")
27+
public class RestCatalogAdlsIT extends PolarisRestCatalogAdlsIntegrationTestBase {}

runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogGcpIT.java renamed to runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogGcsIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
package org.apache.polaris.service.it;
2020

2121
import io.quarkus.test.junit.QuarkusIntegrationTest;
22-
import org.apache.polaris.service.it.test.PolarisRestCatalogGcpIntegrationTestBase;
22+
import org.apache.polaris.service.it.test.PolarisRestCatalogGcsIntegrationTestBase;
2323
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
2424

2525
@QuarkusIntegrationTest
2626
@EnabledIfEnvironmentVariable(named = "INTEGRATION_TEST_GCS_PATH", matches = ".+")
27-
public class RestCatalogGcpIT extends PolarisRestCatalogGcpIntegrationTestBase {}
27+
public class RestCatalogGcsIT extends PolarisRestCatalogGcsIntegrationTestBase {}

0 commit comments

Comments
 (0)