-
Notifications
You must be signed in to change notification settings - Fork 346
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
Increate the code coverage of crates/libcontainer/
to 75%
#279
Comments
Hi @utam0k , I am very inexperienced on both 1. the rust and 2. the container runtime. about the rust, I only have some small contributions to and a small project I owned about the container runtime, so hope you will accept my self-recommended and give me this chance to learn more 🙇🏻 |
@tommady Of cource! Can I ask you to try adding tests to it? If you want, I can prepare more difficult parts. |
@tommady Can I ask you to update the test coverage for this file? If you want something more difficult, I can ask for the most difficult, |
For hook.rs, there is a test that tests the timeout path, but it's skipped at the moment. The min timeout is 1 second, so the unit test would take at least 1 second to run. I wasn't sure if we should include that. Maybe remove the #[skip] and try again for the coverage first? |
hi @yihuaf from current is a better way. because:
What do you think? |
Go ahead. SGTM :)
…On Tue, Sep 14, 2021 at 6:04 PM tommady ***@***.***> wrote:
hi @yihuaf <https://github.com/yihuaf>
I have a chat with @utam0k <https://github.com/utam0k> ,
and we agreed that changing the timeout of oci_spec.Hook
from current
timeout: Option<int64>
to
timeout: Option<time::Duration>
is a better way.
because:
1. the naming and the type will not get confused by other people.
2. this way can make the timeout testing easier because we can define
our own Duration
What do you think?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#279 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEY66HTMUYQUUF2ZRA6LRW3UB7WKXANCNFSM5DSOT2BQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Hi, I'm a beginner of youki and I'd like to contribute. |
Sure! I look forward to your PR. I believe the following codes help you. |
Thanks! |
hi, as discussed with @utam0k
thanks! |
Hi, I'd love to try my hand at this. I don't have experience with youki, but I do have a tiny bit of experience with rust (few dozen hours maybe, a lot of that is documentation reading). Is there anything I could do? Thank you! Edit: I forgot to add, I don't know too much about container runtimes themselves, but I do know about running containers in practice (e.g. using docker, how container images are built in layers) and a bit about some syscalls/kernel facilities like seccomp, cgroups, etc. |
Welcome :) Since you are new, I would suggest take a look at https://app.codecov.io/gh/containers/youki and see where the coverage is low. Then read the code and see if you can help writing tests. Also let us know if any comments is not enough to understand what the code is doing. Once you are done with that, then let us know what function you would like to help write the test for. I would suggest writing one test at a time since we want to keep the PR as simple as possible. Let us know how we can help here, or on Discord :) |
@hle0 Hi! welcome. I'm sorry for the delay in getting back to you. How about this file? If you feel that this is too easy, please contact me. I can prepare a more difficult one for you. |
Coverage had dropped to 68%. Merging pull request that decrease code coverage should be blocked. |
It is possible for code coverage to drop as new files are added. There is a trade-off between that and increased test coverage. There are a few files that can easily increase code coverage. If you do that, you can easily reach 70%. |
src/
to 75%crates/youki/
to 75%
crates/youki/
to 75%crates/libcontainer/
to 75%
Hi! I would like to try my hand at this. I am intermediate in Rust. I don't know about container runtimes but I know about how containers work (cgroups, capability, unshare). Is there anything you could let me do? Thank you |
@chinzhiweiblank Thanks for your interest! I'm happy to hear that. |
No problem. I'll take this up. |
@chinzhiweiblank Thank you. I'm looking forward to seeing your PR. |
Since I am responsible for many of the decreasing the coverage in the recent PRs, I want to take a look at this next. |
@yihuaf The reason why I'm asking you to do #1348 is that this feature is a new challenge in the Cloud Native community. I asked you to do this issue because I trust your imagination and implementation skills. |
Why?
Since youki is a container runtime, it is software that should be security-sensitive. Therefore, it should be covered as much as possible by unit tests to avoid bugs as much as possible.
However, because it is a container runtime, it is difficult to write unit tests because it is difficult to handle mocks. In other words, this is a challenge. It is also a chance to design well.
https://app.codecov.io/gh/containers/youki
How to participate in this challenge
Please indicate that you would like to challenge this issue. I will look at the code coverage and recommend where to challenge. If you are new to youki development, it would be helpful if you could describe how familiar you are with Rust and container runtimes.
Notes
src/capabilities.rs
(@tommady)src/rootfs.rs
(@tommady)src/container/container.rs
(@tommady)src/rootles.rs
(@kenoss)The text was updated successfully, but these errors were encountered: