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

[MINOR] fix: allow mountPoint not containing '/' #607

Merged
merged 3 commits into from
Feb 16, 2023

Conversation

xianjingfeng
Copy link
Member

What changes were proposed in this pull request?

Allow mountPoint do not contains '/'

Why are the changes needed?

mountPoint is not always contains '/', such as rootfs

Does this PR introduce any user-facing change?

No

How was this patch tested?

No need.

@codecov-commenter
Copy link

codecov-commenter commented Feb 16, 2023

Codecov Report

Merging #607 (645f8d8) into master (7a8cdb0) will increase coverage by 0.02%.
The diff coverage is 75.00%.

@@             Coverage Diff              @@
##             master     #607      +/-   ##
============================================
+ Coverage     60.85%   60.88%   +0.02%     
- Complexity     1800     1802       +2     
============================================
  Files           214      214              
  Lines         12387    12388       +1     
  Branches       1044     1045       +1     
============================================
+ Hits           7538     7542       +4     
+ Misses         4444     4441       -3     
  Partials        405      405              
Impacted Files Coverage Δ
...le/storage/common/DefaultStorageMediaProvider.java 60.60% <75.00%> (+7.48%) ⬆️
.../apache/uniffle/coordinator/ClientConfManager.java 91.54% <0.00%> (-1.41%) ⬇️
...e/uniffle/server/storage/SingleStorageManager.java 73.52% <0.00%> (+2.94%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -40,4 +40,11 @@ public void testStorageProvider() {
// invalid uri should also be reported as HDD
assertEquals(StorageMedia.HDD, provider.getStorageMediaFor("file@xx:///path/to/a"));
}

@Test
public void getGetDeviceName() {
Copy link
Contributor

Choose a reason for hiding this comment

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

could you also add getStorageMediaFor for "rootfs" path and check its return media is HDD or not?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's not predictable. Depends on the CI environment.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't know how to do it. I don't know which path will return rootfs in CI environment.

Copy link
Contributor

Choose a reason for hiding this comment

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

how about mock the getDeviceName method?

Seems it was declared as static, maybe an instance method is easier to be mocked?

Copy link
Member Author

Choose a reason for hiding this comment

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

how about mock the getDeviceName method?

Seems it was declared as static, maybe an instance method is easier to be mocked?

I just tried, but failed. We need to specify the return value for getStorageMediaFor, otherwise null will be returned.

Copy link
Contributor

Choose a reason for hiding this comment

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

that doesn't make sense...

I'm ok with current status. Let's defer it.

@kaijchen kaijchen changed the title [MINOR] fix: Allow mountPoint do not contains '/' [MINOR] fix: allow mountPoint not containing '/' Feb 16, 2023
Copy link
Contributor

@kaijchen kaijchen left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @xianjingfeng.

@xianjingfeng xianjingfeng merged commit d0ef827 into apache:master Feb 16, 2023
@xianjingfeng xianjingfeng deleted the minor branch February 16, 2023 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants