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

test: add parseSysctl and parseNetwork unit test #697

Merged
merged 1 commit into from
Feb 5, 2018
Merged

test: add parseSysctl and parseNetwork unit test #697

merged 1 commit into from
Feb 5, 2018

Conversation

ZouRui89
Copy link
Contributor

@ZouRui89 ZouRui89 commented Feb 5, 2018

Signed-off-by: Zou Rui [email protected]

Ⅰ. Describe what this PR did

add parseSysctl and parseNetwork unit test

Ⅱ. Does this pull request fix one issue?

NONE

Ⅲ. Describe how you did it

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@codecov-io
Copy link

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #697      +/-   ##
==========================================
+ Coverage   10.15%   10.71%   +0.55%     
==========================================
  Files          92       92              
  Lines        5375     5375              
==========================================
+ Hits          546      576      +30     
+ Misses       4779     4749      -30     
  Partials       50       50
Impacted Files Coverage Δ
cli/container.go 50% <0%> (+18.29%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d53ecb6...c66b8ba. Read the comment docs.

@@ -329,3 +329,97 @@ func Test_parseDeviceMappings(t *testing.T) {
})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@allencloud As you can see, in the unit test case generated by vscode, we can only detect the existence of an error, true or false.

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah, I think it has some drawbacks.

assert.Equal(t, testCase.expect.err, error)
assert.Equal(t, testCase.expect.network.name, name)
assert.Equal(t, testCase.expect.network.ip, ip)
}
Copy link
Contributor Author

@ZouRui89 ZouRui89 Feb 5, 2018

Choose a reason for hiding this comment

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

@allencloud However, we need to know whether or not the type of the error is the exact one we are expecting for. In this case, I don't think the unit test framework generated by vscode is good enough.

@Letty5411
Copy link
Contributor

LGTM

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Feb 5, 2018
@Letty5411 Letty5411 merged commit f5c7148 into AliyunContainerService:master Feb 5, 2018
@ZouRui89 ZouRui89 deleted the test2 branch February 5, 2018 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
areas/test LGTM one maintainer or community participant agrees to merge the pull reuqest. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants