Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aliyun: Add OSS integration test rule #3687

Merged
merged 6 commits into from
Dec 9, 2021
Merged

Aliyun: Add OSS integration test rule #3687

merged 6 commits into from
Dec 9, 2021

Conversation

openinx
Copy link
Member

@openinx openinx commented Dec 8, 2021

This PR addressed all the commented issues from the original one: #3596

I've tested the integration tests successfully in my local:

export ALIYUN_TEST_ACCESS_KEY_ID=******
export ALIYUN_TEST_ACCESS_KEY_SECRET=******

export ALIYUN_TEST_OSS_TEST_RULE_CLASS=org.apache.iceberg.aliyun.oss.OSSIntegrationTestRule
export ALIYUN_TEST_OSS_WAREHOUSE=oss://iceberg-test/ververica-iceberg-integration-tests/
export ALIYUN_TEST_OSS_ENDPOINT=oss-cn-hangzhou.aliyuncs.com

➜  apache-iceberg git:(aliyun-it-rule) ./gradlew iceberg-aliyun:build -x javadoc -Pquick=true

BUILD SUCCESSFUL in 53s
19 actionable tasks: 4 executed, 15 up-to-date

@@ -69,6 +70,9 @@ public void after() {

@Test
public void testBuckets() {
Assume.assumeTrue("Aliyun integration test cannot delete existing bucket from test environment.",
OSS_TEST_RULE.getClass() == AliyunOSSMockRule.class);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this sentence because we don't want to run this test cases for integration test, because it will delete the bucket from test environment, while the test environment may have other objects that were used by other tests.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In AWS we just assumes the bucket exists, and create a random prefix as the root for all tests. By doing that we don't deal with bucket deletion, which is quite dangerous as you say. Would that be better also for Aliyun?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In AWS we just assumes the bucket exists, and create a random prefix as the root for all tests.

The aliyun integration tests is using the same approach as you said. This suite case was designed to guarantee that the Aliyun Mock OSS Application will have the same semantics as the production aliyun OSS services. If both AliyunOSSMockRule and OSSIntegrationTestRule are successfully applied to this case, then we can ensure that all the unit tests which are built on top of the AliyunOSSMockRule are correctly designed.

As we iceberg FileIO won't depend any bucket creation or deletion interfaces , plus the dangerous bucket deletion behavior. So Here I disabled the buckets tests for integration tests.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, that makes sense to me, thanks for the explanation

@@ -17,25 +17,36 @@
* under the License.
*/

package org.apache.iceberg.aliyun.oss;
package org.apache.iceberg.aliyun;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this utility class out of the org.apache.iceberg.aliyun.oss because the utility will also be used for other aliyun services , such as the future aliyun dlf catalog etc.

Copy link
Contributor

@jackye1995 jackye1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly look good to me, one comment related to bucket deletion.

@openinx openinx merged commit c972a34 into apache:master Dec 9, 2021
@openinx
Copy link
Member Author

openinx commented Dec 9, 2021

Get this merged, Thanks @jackye1995 for the reviewing !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants