forked from apache/polaris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor PolarisRestCatalogViewIntegrationTest into per cloud provide…
…r tests (apache#410) * Update to be 1 test * Spotless * Go back to multiple files
- Loading branch information
1 parent
041a8ff
commit 121ae9a
Showing
5 changed files
with
208 additions
and
26 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
...est/java/org/apache/polaris/service/catalog/PolarisRestCatalogViewAwsIntegrationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.polaris.service.catalog; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
import java.util.stream.Stream; | ||
import org.apache.polaris.core.admin.model.AwsStorageConfigInfo; | ||
import org.apache.polaris.core.admin.model.StorageConfigInfo; | ||
import org.assertj.core.util.Strings; | ||
|
||
/** Runs PolarisRestCatalogViewIntegrationTest on AWS. */ | ||
public class PolarisRestCatalogViewAwsIntegrationTest | ||
extends PolarisRestCatalogViewIntegrationTest { | ||
public static final String ROLE_ARN = | ||
Optional.ofNullable(System.getenv("INTEGRATION_TEST_ROLE_ARN")) // Backward compatibility | ||
.orElse(System.getenv("INTEGRATION_TEST_S3_ROLE_ARN")); | ||
public static final String BASE_LOCATION = System.getenv("INTEGRATION_TEST_S3_PATH"); | ||
|
||
@Override | ||
protected StorageConfigInfo getStorageConfigInfo() { | ||
return AwsStorageConfigInfo.builder() | ||
.setRoleArn(ROLE_ARN) | ||
.setStorageType(StorageConfigInfo.StorageTypeEnum.S3) | ||
.setAllowedLocations(List.of(BASE_LOCATION)) | ||
.build(); | ||
} | ||
|
||
@Override | ||
protected boolean shouldSkip() { | ||
return Stream.of(BASE_LOCATION, ROLE_ARN).anyMatch(Strings::isNullOrEmpty); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
...t/java/org/apache/polaris/service/catalog/PolarisRestCatalogViewAzureIntegrationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.polaris.service.catalog; | ||
|
||
import java.util.List; | ||
import java.util.stream.Stream; | ||
import org.apache.polaris.core.admin.model.AzureStorageConfigInfo; | ||
import org.apache.polaris.core.admin.model.StorageConfigInfo; | ||
import org.assertj.core.util.Strings; | ||
|
||
/** Runs PolarisRestCatalogViewIntegrationTest on Azure. */ | ||
public class PolarisRestCatalogViewAzureIntegrationTest | ||
extends PolarisRestCatalogViewIntegrationTest { | ||
public static final String TENANT_ID = System.getenv("INTEGRATION_TEST_AZURE_TENANT_ID"); | ||
public static final String BASE_LOCATION = System.getenv("INTEGRATION_TEST_AZURE_PATH"); | ||
|
||
@Override | ||
protected StorageConfigInfo getStorageConfigInfo() { | ||
return AzureStorageConfigInfo.builder() | ||
.setTenantId(TENANT_ID) | ||
.setStorageType(StorageConfigInfo.StorageTypeEnum.AZURE) | ||
.setAllowedLocations(List.of(BASE_LOCATION)) | ||
.build(); | ||
} | ||
|
||
@Override | ||
protected boolean shouldSkip() { | ||
return Stream.of(BASE_LOCATION, TENANT_ID).anyMatch(Strings::isNullOrEmpty); | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...st/java/org/apache/polaris/service/catalog/PolarisRestCatalogViewFileIntegrationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.polaris.service.catalog; | ||
|
||
import java.util.List; | ||
import org.apache.polaris.core.admin.model.FileStorageConfigInfo; | ||
import org.apache.polaris.core.admin.model.StorageConfigInfo; | ||
|
||
/** Runs PolarisRestCatalogViewIntegrationTest on the local filesystem. */ | ||
public class PolarisRestCatalogViewFileIntegrationTest | ||
extends PolarisRestCatalogViewIntegrationTest { | ||
public static final String BASE_LOCATION = "file:///tmp/buckets/my-bucket"; | ||
|
||
@Override | ||
protected StorageConfigInfo getStorageConfigInfo() { | ||
return FileStorageConfigInfo.builder() | ||
.setStorageType(StorageConfigInfo.StorageTypeEnum.FILE) | ||
.setAllowedLocations(List.of(BASE_LOCATION)) | ||
.build(); | ||
} | ||
|
||
@Override | ||
protected boolean shouldSkip() { | ||
return false; | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...est/java/org/apache/polaris/service/catalog/PolarisRestCatalogViewGcpIntegrationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.polaris.service.catalog; | ||
|
||
import java.util.List; | ||
import java.util.stream.Stream; | ||
import org.apache.polaris.core.admin.model.GcpStorageConfigInfo; | ||
import org.apache.polaris.core.admin.model.StorageConfigInfo; | ||
import org.assertj.core.util.Strings; | ||
|
||
/** Runs PolarisRestCatalogViewIntegrationTest on GCP. */ | ||
public class PolarisRestCatalogViewGcpIntegrationTest | ||
extends PolarisRestCatalogViewIntegrationTest { | ||
public static final String SERVICE_ACCOUNT = | ||
System.getenv("INTEGRATION_TEST_GCS_SERVICE_ACCOUNT"); | ||
public static final String BASE_LOCATION = System.getenv("INTEGRATION_TEST_GCS_PATH"); | ||
|
||
@Override | ||
protected StorageConfigInfo getStorageConfigInfo() { | ||
return GcpStorageConfigInfo.builder() | ||
.setGcsServiceAccount(SERVICE_ACCOUNT) | ||
.setStorageType(StorageConfigInfo.StorageTypeEnum.GCS) | ||
.setAllowedLocations(List.of(BASE_LOCATION)) | ||
.build(); | ||
} | ||
|
||
@Override | ||
protected boolean shouldSkip() { | ||
return Stream.of(BASE_LOCATION, SERVICE_ACCOUNT).anyMatch(Strings::isNullOrEmpty); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters