Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add coverage on pkg/fileutils#12840

Merged
duglin merged 1 commit into
moby:masterfrom
vdemeester:11598-pkg-fileutils-tests
Apr 29, 2015
Merged

Add coverage on pkg/fileutils#12840
duglin merged 1 commit into
moby:masterfrom
vdemeester:11598-pkg-fileutils-tests

Conversation

@vdemeester

Copy link
Copy Markdown
Member

Related to #11598, adding coverage to pkg/fileutils, on the following methods :

  • CopyFile
  • Matches

I don't really know how to test easily GetTotalUsedFds though.. But the coverage is around 91%.

Signed-off-by: Vincent Demeester [email protected]

@vdemeester vdemeester force-pushed the 11598-pkg-fileutils-tests branch from ee187af to a4d38c0 Compare April 28, 2015 08:10
@vdemeester vdemeester changed the title Add coverage on fileutils Add coverage on pkg/fileutils Apr 28, 2015
@vdemeester vdemeester force-pushed the 11598-pkg-fileutils-tests branch from a4d38c0 to e4e046d Compare April 28, 2015 08:12
@duglin

duglin commented Apr 28, 2015

Copy link
Copy Markdown
Contributor

I'd prefer to let #12245 get merged in first because I think the new testcases in there for Matches could cover some of this already. @vdemeester can you see if there's an overlap?

@vdemeester

Copy link
Copy Markdown
Member Author

@duglin You're right, there is some testcases that will cover it, and from a really quick look there is a few (like 2 tests). I'll wait for this to be merged, and will rebase/update my tests then ;)

@vdemeester

Copy link
Copy Markdown
Member Author

@duglin Seems like #12245 has been merged, I removed overlapped tests :)

@cpuguy83

Copy link
Copy Markdown
Member

LGTM

Comment thread pkg/fileutils/fileutils_test.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would put something in the file so that its not "zero size" then when you check "bytes != 0" you can be sure that its zero because it didn't copy it and not because it copied an zero size file.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Completely agree, will do :)

@duglin

duglin commented Apr 29, 2015

Copy link
Copy Markdown
Contributor

Just a couple of minor comments.

@duglin duglin self-assigned this Apr 29, 2015
@vdemeester vdemeester force-pushed the 11598-pkg-fileutils-tests branch from 8c43684 to 961292e Compare April 29, 2015 14:25
Should fix moby#11598

Signed-off-by: Vincent Demeester <[email protected]>
@vdemeester vdemeester force-pushed the 11598-pkg-fileutils-tests branch from 961292e to 8454e1a Compare April 29, 2015 14:27
@vdemeester

Copy link
Copy Markdown
Member Author

@duglin Took care of your comments

@duglin

duglin commented Apr 29, 2015

Copy link
Copy Markdown
Contributor

@vdemeester great - thanks!
LGTM assuming janky is happy

duglin added a commit that referenced this pull request Apr 29, 2015
@duglin duglin merged commit 44f8c44 into moby:master Apr 29, 2015
@vdemeester vdemeester deleted the 11598-pkg-fileutils-tests branch April 29, 2015 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants