dimas-b commented on code in PR #1934: URL: https://github.com/apache/polaris/pull/1934#discussion_r2165219003
########## runtime/service/src/test/java/org/apache/polaris/service/quarkus/it/QuarkusRestCatalogAwsIntegrationTest.java: ########## @@ -0,0 +1,38 @@ +/* + * 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.quarkus.it; + +import io.quarkus.test.junit.QuarkusTest; +import io.quarkus.test.junit.QuarkusTestProfile; +import io.quarkus.test.junit.TestProfile; +import java.util.Map; +import org.apache.polaris.service.it.test.PolarisRestCatalogAwsIntegrationTest; + +@QuarkusTest +@TestProfile(QuarkusRestCatalogAwsIntegrationTest.Profile.class) +public class QuarkusRestCatalogAwsIntegrationTest extends PolarisRestCatalogAwsIntegrationTest { + + public static class Profile implements QuarkusTestProfile { + + @Override + public Map<String, String> getConfigOverrides() { + return Map.of("polaris.features.\"SUPPORTED_CATALOG_STORAGE_TYPES\"", "[\"S3\"]"); Review Comment: `S3` is enabled by default. What's the rationale for redefining `SUPPORTED_CATALOG_STORAGE_TYPES` in this test? ########## integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogIntegrationBase.java: ########## @@ -214,14 +212,17 @@ public void before(TestInfo testInfo) { Method method = testInfo.getTestMethod().orElseThrow(); currentCatalogName = client.newEntityName(method.getName()); - AwsStorageConfigInfo awsConfigModel = - AwsStorageConfigInfo.builder() - .setRoleArn(TEST_ROLE_ARN) - .setExternalId("externalId") - .setUserArn("a:user:arn") - .setStorageType(StorageConfigInfo.StorageTypeEnum.S3) - .setAllowedLocations(List.of("s3://my-old-bucket/path/to/data")) - .build(); + StorageConfigInfo storageConfig = getStorageConfigInfo(); + catalogBaseLocation = + storageConfig.getAllowedLocations().getFirst() + + "/" + + System.getenv("USER") Review Comment: I know this logic existed before, but since we're touching this code... WDYT about making a new dedicated env. var for this (e.g. `POLARIS_TEST_CATALOG_LOCATION_SUBPATH`) and defaulting to something simple like `test`? I do not think exposing `$USER` to external systems is a good idea in general, and in cases it is used to customize locations a dedicated env. var. is probably cleaner. ########## integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogAwsIntegrationTest.java: ########## @@ -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.it.test; + +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 PolarisRestCatalogIntegrationBase test on AWS. */ +public class PolarisRestCatalogAwsIntegrationTest extends PolarisRestCatalogIntegrationBase { + public static final String ROLE_ARN = + Optional.ofNullable(System.getenv("INTEGRATION_TEST_ROLE_ARN")) + .or(() -> Optional.ofNullable(System.getenv("INTEGRATION_TEST_S3_ROLE_ARN"))) + .orElse("arn:aws:iam::123456789012:role/my-role"); + 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); Review Comment: nit: `ROLE_ARN` is never empty per line 33, is it? ########## runtime/service/src/test/java/org/apache/polaris/service/quarkus/it/QuarkusRestCatalogAwsIntegrationTest.java: ########## @@ -0,0 +1,38 @@ +/* + * 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.quarkus.it; + +import io.quarkus.test.junit.QuarkusTest; +import io.quarkus.test.junit.QuarkusTestProfile; +import io.quarkus.test.junit.TestProfile; +import java.util.Map; +import org.apache.polaris.service.it.test.PolarisRestCatalogAwsIntegrationTest; + +@QuarkusTest +@TestProfile(QuarkusRestCatalogAwsIntegrationTest.Profile.class) +public class QuarkusRestCatalogAwsIntegrationTest extends PolarisRestCatalogAwsIntegrationTest { Review Comment: This test looks a bit redundant to me given that we have `QuarkusRestCatalogAwsIT`. The latter is a proper integration test that runs a pre-compiled server from a jar. This test runs the server inside a Quarkus test ClassLoader in the local (JUnit) JVM. `@QuarkusTest` is good for local debugging, but debugging is possible in `@QuarkusIntegrationTest` too (just a little less convenient).... All in all, I'm not sure we gain much by having this test. Would you mind keeping only `QuarkusRestCatalogAwsIT`? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@polaris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org