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

increate the code coverage of src process part2 #436

Conversation

tommady
Copy link
Collaborator

@tommady tommady commented Oct 25, 2021

#279
the process/container_init_process part 2

@codecov-commenter
Copy link

codecov-commenter commented Oct 25, 2021

Codecov Report

Merging #436 (61839f9) into main (4609abc) will increase coverage by 1.11%.
The diff coverage is 90.47%.

@@            Coverage Diff             @@
##             main     #436      +/-   ##
==========================================
+ Coverage   68.24%   69.35%   +1.11%     
==========================================
  Files          76       76              
  Lines        9887    10002     +115     
==========================================
+ Hits         6747     6937     +190     
+ Misses       3140     3065      -75     

@tommady tommady force-pushed the 279-increate-the-code-coverage-of-src-container-init-process-2 branch from ad1f724 to 62caaef Compare October 29, 2021 00:58
@tommady tommady changed the title [WIP] increate the code coverage of src process part2 increate the code coverage of src process part2 Oct 29, 2021
@tommady tommady marked this pull request as ready for review October 29, 2021 02:26
@@ -218,35 +218,35 @@ impl Syscall for LinuxSyscall {
) -> Result<()> {
match mount(source, target, fstype, flags, data) {
Ok(_) => Ok(()),
Err(e) => bail!("Failed to mount {:?}", e),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why this change?

Copy link
Collaborator Author

@tommady tommady Oct 29, 2021

Choose a reason for hiding this comment

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

because I found out by using bail!
the downcast_ref() will fail to parse out the source error,

if let Some(errno) = e.downcast_ref()

this condition will fail.
then the integration test will fail on the masked_path check.

please guide me if I am wrong.

crates/libcontainer/src/process/container_init_process.rs Outdated Show resolved Hide resolved
@Furisto
Copy link
Collaborator

Furisto commented Oct 29, 2021

Looks good.

@Furisto Furisto merged commit d35fb3c into youki-dev:main Oct 29, 2021
@tommady tommady deleted the 279-increate-the-code-coverage-of-src-container-init-process-2 branch October 29, 2021 11:50
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