snazy commented on code in PR #2375: URL: https://github.com/apache/polaris/pull/2375#discussion_r2283027080
########## runtime/test-common/build.gradle.kts: ########## @@ -32,6 +32,7 @@ configurations.all { } dependencies { + api(libs.s3mock.testcontainers) Review Comment: Not such a great fan of `api`, because it leaks into every transitive consumer. Maybe not a big issue in tests, but generally it is. More a fan of explicit dependencies, aka `implementation`. Given that this one is just for project-internal tests, I think it's fine to leave it as `api` ########## runtime/test-common/src/main/java/org/apache/polaris/test/commons/s3mock/S3Mock.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.test.commons.s3mock; + +import com.adobe.testing.s3mock.testcontainers.S3MockContainer; +import java.util.Map; +import org.apache.polaris.containerspec.ContainerSpecHelper; + +public class S3Mock extends S3MockContainer { + + public S3Mock() { + super(ContainerSpecHelper.containerSpecHelper("s3mock", S3Mock.class).dockerImageName(null)); Review Comment: Great! ########## runtime/test-common/src/main/resources/org/apache/polaris/test/commons/s3mock/Dockerfile-s3mock-version: ########## @@ -0,0 +1,22 @@ +# +# 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. +# + +# Dockerfile to provide the image name and tag to a test. +# Version is managed by Renovate - do not edit. +FROM adobe/s3mock:4.7.0 Review Comment: Nit: add the source registry there as well ```suggestion FROM docker.io/adobe/s3mock:4.7.0 ``` ########## runtime/test-common/src/main/java/org/apache/polaris/test/commons/s3mock/S3Mock.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.test.commons.s3mock; + +import com.adobe.testing.s3mock.testcontainers.S3MockContainer; +import java.util.Map; +import org.apache.polaris.containerspec.ContainerSpecHelper; + +public class S3Mock extends S3MockContainer { + + public S3Mock() { + super(ContainerSpecHelper.containerSpecHelper("s3mock", S3Mock.class).dockerImageName(null)); + } + + public S3Mock(String initialBuckets) { + this(); + this.withInitialBuckets(initialBuckets); + } + + public Map<String, String> getS3ConfigProperties(String accessKey, String secretKey) { Review Comment: Maybe add access-key and secret-access-key dummy defaults used by a convenience ``` public Map<String, String> getS3ConfigProperties() ``` and get rid of the "dummy defaults" in the test classes? -- 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