-
Notifications
You must be signed in to change notification settings - Fork 950
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
Conversation
Signed-off-by: Zou Rui <[email protected]>
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
@@ -329,3 +329,97 @@ func Test_parseDeviceMappings(t *testing.T) { | |||
}) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) | ||
} |
There was a problem hiding this comment.
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.
LGTM |
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