Skip to content

Aliyun: Add OSS integration test rule - #3687

Merged
openinx merged 6 commits into
apache:masterfrom
openinx:aliyun-it-rule
Dec 9, 2021
Merged

openinx merged 6 commits into
apache:masterfrom
openinx:aliyun-it-rule

Conversation

@openinx

@openinx openinx commented Dec 8, 2021

Copy link
Copy Markdown
Member

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

@openinx
openinx requested a review from jackye1995 December 8, 2021 10:51
@github-actions github-actions Bot added the ALIYUN label Dec 8, 2021
@Test
public void testBuckets() {
Assume.assumeTrue("Aliyun integration test cannot delete existing bucket from test environment.",
OSS_TEST_RULE.getClass() == AliyunOSSMockRule.class);

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

*/

package org.apache.iceberg.aliyun.oss;
package org.apache.iceberg.aliyun;

Copy link
Copy Markdown
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.

@jackye1995 jackye1995 left a comment

Copy link
Copy Markdown
Contributor

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

openinx commented Dec 9, 2021

Copy link
Copy Markdown
Member Author

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