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

[#6131] feat (gvfs-fuse): Add integration test framework of gvfs-fuse #6160

Merged
merged 29 commits into from
Jan 14, 2025

Conversation

diqiu50
Copy link
Contributor

@diqiu50 diqiu50 commented Jan 9, 2025

What changes were proposed in this pull request?

Add integration test framework of gvfs-fuse
Integrate LocalStack into the gvfs-fuse integration test
Add ci pipeline for integration test

Why are the changes needed?

Fix: #6131

Does this PR introduce any user-facing change?

No

How was this patch tested?

IT

@diqiu50 diqiu50 changed the title [#6131] feat (gvfs-fuse): Integrate with localstack of gvfs-fuse integration test [#6131] feat (gvfs-fuse): Integrate localstack of gvfs-fuse integration test Jan 9, 2025
@diqiu50 diqiu50 changed the title [#6131] feat (gvfs-fuse): Integrate localstack of gvfs-fuse integration test [#6131] feat (gvfs-fuse): Integrate LocalStack into the GVFS-FUSE integration test Jan 9, 2025
@diqiu50 diqiu50 changed the title [#6131] feat (gvfs-fuse): Integrate LocalStack into the GVFS-FUSE integration test [#6131] feat (gvfs-fuse): Integrate LocalStack into the gvfs-fuse integration test Jan 9, 2025
@diqiu50 diqiu50 self-assigned this Jan 9, 2025
@jerryshao jerryshao requested a review from FANNG1 January 9, 2025 06:06
@diqiu50 diqiu50 changed the title [#6131] feat (gvfs-fuse): Integrate LocalStack into the gvfs-fuse integration test [#6131] feat (gvfs-fuse): Add integration test framework of gvfs-fuse Jan 9, 2025
@diqiu50 diqiu50 requested a review from xunliu January 9, 2025 08:18
run: |
./gradlew :clients:filesystem-fuse:build -PenableFuse=true
- name: Integration test
run: |
./gradlew bundles:aws-bundle:build -x :clients:client-python:build compileDistribution -x test -x web -PjdkVersion=${{ matrix.java-version }}
Copy link
Contributor

Choose a reason for hiding this comment

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

it's hard to use, use make prepare-it-env ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not good to let make call gradle again.
Currently, the integration test module does not automatically build the package, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, the current IT doesn't automatically build the package, but here you depends on bundles:aws-bundle:build, I wonder whether you could make it auto dependents. and There are separate actions in Gravitino IT, seems better make rust client keep consistent with it.

      - name: Package Gravitino
        if: ${{ inputs.test-mode == 'deploy' }}
        run: |
          ./gradlew compileDistribution -x test -PjdkVersion=${{ inputs.java-version }}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fix

@@ -334,13 +334,21 @@ impl<T: PathFileSystem> RawFileSystem for DefaultRawFileSystem<T> {
file.flush().await
}

async fn close_file(&self, _file_id: u64, fh: u64) -> Result<()> {
async fn close_file(&self, file_id: u64, fh: u64) -> Result<()> {
let file_entry = self.get_file_entry(file_id).await;
Copy link
Contributor

Choose a reason for hiding this comment

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

why adding this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Check if the file has been deleted.

Copy link
Contributor

Choose a reason for hiding this comment

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

If there is no file entry, is it expected not closing the open file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, closing deleted file may cause bugs.
This fix is not good. Add the todo comments to handle that case.

clients/filesystem-fuse/src/gravitino_client.rs Outdated Show resolved Hide resolved
clients/filesystem-fuse/src/gravitino_client.rs Outdated Show resolved Hide resolved
clients/filesystem-fuse/Makefile Show resolved Hide resolved
@diqiu50 diqiu50 requested a review from FANNG1 January 10, 2025 02:24
@jerryshao jerryshao added the branch-0.8 Automatically cherry-pick commit to branch-0.8 label Jan 10, 2025

#[tokio::test]
async fn s3_ut_test_s3_stat() {
test_enable_with!(RUN_TEST_WITH_S3);
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems hacks, could you refer other rust projects for more general way to control the tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can’t find a good way to mark the test tags and run them.

Copy link
Contributor

@FANNG1 FANNG1 Jan 13, 2025

Choose a reason for hiding this comment

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

try using this?
#[cfg(feature = "ENABLE_S3_TEST")], after using this macro, seems we could remove s3_ut prefix too.

Copy link
Contributor Author

@diqiu50 diqiu50 Jan 13, 2025

Choose a reason for hiding this comment

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

This is generally used to control whether a module participates in compilation, and I haven't seen any projects using it to control tests. People familiar with Rust might find this confusing, right?

It also cannot filter out tests that do not have feature = "ENABLE_S3_TEST" enabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There have a lib can mark tags for the testers. but it can not work with #[tokio::test]
https://docs.rs/tagrs/latest/tagrs/

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@diqiu50 diqiu50 Jan 14, 2025

Choose a reason for hiding this comment

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

The storage-s3 feature is used to enable that functionality for all code, not just for testing.

@jerryshao jerryshao requested a review from FANNG1 January 13, 2025 06:51
@diqiu50 diqiu50 requested a review from mchades January 13, 2025 08:17
@diqiu50
Copy link
Contributor Author

diqiu50 commented Jan 13, 2025

@yuqi1129 @mchades @xunliu Please take a review.

.github/workflows/gvfs-fuse-build-test.yml Outdated Show resolved Hide resolved
Comment on lines +80 to +81
./gradlew build -x :clients:client-python:build -x test -x web -PjdkVersion=${{ matrix.java-version }}
./gradlew compileDistribution -x :clients:client-python:build -x test -x web -PjdkVersion=${{ matrix.java-version }}
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe move this two line to the Build and test Gvfs-fuse may be more proper

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The one above builds gvfs-fuse, and the below builds the Gravitino server needed for testing.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK

@diqiu50 diqiu50 requested a review from yuqi1129 January 14, 2025 06:11
@FANNG1
Copy link
Contributor

FANNG1 commented Jan 14, 2025

LGTM, @yuqi1129 any other comments?

@yuqi1129
Copy link
Contributor

LGTM, @yuqi1129 any other comments?

I have reviewed again and no further comments.

@FANNG1 FANNG1 merged commit c6476b8 into apache:main Jan 14, 2025
28 checks passed
github-actions bot pushed a commit that referenced this pull request Jan 14, 2025
…#6160)

### What changes were proposed in this pull request?

Add integration test framework of gvfs-fuse
Integrate LocalStack into the gvfs-fuse integration test
Add ci pipeline for integration test

### Why are the changes needed?

Fix: #6131 

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

IT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch-0.8 Automatically cherry-pick commit to branch-0.8
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Subtask] Add integration test framework for Gvfs-fuse
4 participants