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

Add some unit test for utils, storage, rafs, api and builder. #1475

Merged
merged 7 commits into from
Nov 9, 2023

Conversation

ZouTaooo
Copy link

@ZouTaooo ZouTaooo commented Nov 7, 2023

Relevant Issue (if applicable)

If there are Issues related to this PullRequest, please list it.

Details

Please describe the details of PullRequest.

Types of changes

What types of changes does your PullRequest introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

Checklist

Go over all the following points, and put an x in all the boxes that apply.

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

weizhen.zt added 5 commits November 7, 2023 16:55
Signed-off-by: weizhen.zt <wodemia@linux.alibaba.com>
Signed-off-by: weizhen.zt <wodemia@linux.alibaba.com>
Signed-off-by: weizhen.zt <wodemia@linux.alibaba.com>
Signed-off-by: weizhen.zt <wodemia@linux.alibaba.com>
Signed-off-by: weizhen.zt <wodemia@linux.alibaba.com>
@ZouTaooo ZouTaooo requested a review from a team as a code owner November 7, 2023 08:59
@ZouTaooo ZouTaooo requested review from imeoer, jiangliu and changweige and removed request for a team November 7, 2023 08:59
Copy link

codecov bot commented Nov 7, 2023

Codecov Report

Merging #1475 (c0350c0) into master (89882a4) will increase coverage by 7.63%.
Report is 1 commits behind head on master.
The diff coverage is 99.81%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1475      +/-   ##
==========================================
+ Coverage   54.86%   62.49%   +7.63%     
==========================================
  Files         123      123              
  Lines       40477    43132    +2655     
  Branches    40477    43132    +2655     
==========================================
+ Hits        22208    26956    +4748     
+ Misses      17033    14868    -2165     
- Partials     1236     1308      +72     
Files Coverage Δ
rafs/src/fs.rs 34.73% <100.00%> (+16.09%) ⬆️
rafs/src/metadata/cached_v5.rs 81.06% <100.00%> (+22.53%) ⬆️
rafs/src/metadata/chunk.rs 88.20% <100.00%> (+34.04%) ⬆️
rafs/src/metadata/direct_v6.rs 44.52% <100.00%> (+5.79%) ⬆️
rafs/src/metadata/inode.rs 95.39% <100.00%> (+26.84%) ⬆️
rafs/src/metadata/layout/v6.rs 85.19% <100.00%> (+13.73%) ⬆️
rafs/src/metadata/md_v5.rs 29.41% <100.00%> (+14.61%) ⬆️
rafs/src/metadata/mod.rs 70.99% <100.00%> (+14.67%) ⬆️
rafs/src/metadata/noop.rs 91.42% <100.00%> (+79.66%) ⬆️
rafs/src/mock/mock_chunk.rs 94.44% <100.00%> (+94.44%) ⬆️
... and 20 more

... and 14 files with indirect coverage changes

@imeoer
Copy link
Collaborator

imeoer commented Nov 7, 2023

Great work, thanks! @ZouTaooo
cc @jiangliu @adamqqqplay Let's take a look together.

@adamqqqplay
Copy link
Member

@ZouTaooo Thanks for your contribution! It looks really good.

@@ -35,6 +35,7 @@ url = { version = "2.1.1", optional = true }
vm-memory = "0.10"
fuse-backend-rs = "^0.10.3"
gpt = { version = "3.0.0", optional = true }
toml = "0.5"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe move it to [dev-dependencies].

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for your review. Now, I have fixed it with new commit.

weizhen.zt added 2 commits November 8, 2023 06:02
Signed-off-by: weizhen.zt <wodemia@linux.alibaba.com>
Signed-off-by: weizhen.zt <wodemia@linux.alibaba.com>
Copy link
Author

@ZouTaooo ZouTaooo left a comment

Choose a reason for hiding this comment

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

The Smoke-Test found a test-case error. And the commit fix it.
Two seconds is an edge-case, but there is a resolution problem in linux timer. So the data will be updated with different index sometimes. So the new test case with two changes, first using the normal argument rather than edge case, secondly considering the timer delta error.

@jiangliu jiangliu merged commit b572a0f into dragonflyoss:master Nov 9, 2023
24 checks passed
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.

None yet

4 participants