Skip to content

Conversation

@panzaiyu
Copy link
Contributor

Ⅰ. Describe what this PR did

Add unit-test for Volume Core's DetachVolume method

Ⅱ. Does this pull request fix one issue?

fixes #1761

Ⅲ. Describe how you did it

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@pouchrobot
Copy link
Collaborator

We found this is your first time to contribute to Pouch, @panzaiyu
👏 We really appreciate it.
Just remind that you have read the contribution guide: https://github.com/alibaba/pouch/blob/master/CONTRIBUTING.md
If you didn't, you should do that first. If done, welcome again and please enjoy hacking! 🍻

@panzaiyu panzaiyu changed the title fix #1761 baiji-group 264-2 fix issue #1761 baiji-group 264-2 Jul 24, 2018
}

//Mock data for TestDetachVolume
func mockVolumeCore(root string) (*Core, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this function is ok, but we already has a function to NewCore: createVolumeCore

@codecov-io
Copy link

Codecov Report

Merging #1824 into master will increase coverage by 0.07%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1824      +/-   ##
==========================================
+ Coverage    56.3%   56.38%   +0.07%     
==========================================
  Files         200      200              
  Lines       15657    15659       +2     
==========================================
+ Hits         8816     8829      +13     
+ Misses       5745     5738       -7     
+ Partials     1096     1092       -4
Flag Coverage Δ
#critest 33.54% <ø> (+0.06%) ⬆️
#integrationtest 37.65% <ø> (-0.01%) ⬇️
#unittest 20.42% <ø> (+0.08%) ⬆️
Impacted Files Coverage Δ
daemon/containerio/cio.go 62.5% <0%> (-1%) ⬇️
daemon/mgr/container.go 53.3% <0%> (+0.15%) ⬆️
cri/v1alpha2/cri.go 66.13% <0%> (+0.17%) ⬆️
storage/volume/core.go 60.48% <0%> (+0.97%) ⬆️
ctrd/container.go 50.17% <0%> (+1.37%) ⬆️
ctrd/image.go 78.71% <0%> (+1.98%) ⬆️


//create volume core

core, err := mockVolumeCore(dir)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use createVolumeCore

@HusterWan
Copy link
Contributor

@panzaiyu please update the code as comment, thanks a lot.

@pouchrobot
Copy link
Collaborator

@panzaiyu Thanks for your contribution. 🍻
Please sign off in each of your commits.

@HusterWan
Copy link
Contributor

lgtm

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Jul 24, 2018
@allencloud allencloud merged commit 8272bb3 into AliyunContainerService:master Jul 24, 2018
@allencloud allencloud changed the title fix issue #1761 baiji-group 264-2 test: Add unit-test for Volume Core's DetachVolume method Jul 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

areas/storage areas/test LGTM one maintainer or community participant agrees to merge the pull reuqest. size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[help wanted] add unit-test for DetachVolume

5 participants