-
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:supplement test cases for apis/opts/config/runtime.go #2603
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2603 +/- ##
==========================================
+ Coverage 69.46% 69.49% +0.02%
==========================================
Files 279 279
Lines 18825 18825
==========================================
+ Hits 13077 13082 +5
+ Misses 4281 4276 -5
Partials 1467 1467
|
We found this is your first time to contribute to Pouch, @scy1993 |
Signed-off-by: scy1993 <21851406@zju.edu.cn>
@@ -10,9 +10,11 @@ import ( | |||
func TestNewRuntime(t *testing.T) { | |||
assert := assert.New(t) | |||
|
|||
var tmp = map[string]types.Runtime(nil) |
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.
please not use tmp as var name, since it was meaningless
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.
Thank you for pointing out where I need to improve. I will pay attention to it in the future. Since there is a PR #2329 that has already add test cases, I will close my PR. Thanks for you advice anyway. Have a nice day.
@@ -23,3 +25,156 @@ func TestNewRuntime(t *testing.T) { | |||
assert.NoError(runtime.Set("foo=bar")) | |||
} | |||
} | |||
|
|||
func TestRuntime_Set(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.
keep the func name consistent, such as TestRuntimeSet
} | ||
} | ||
|
||
func TestRuntime_String(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.
same as above
} | ||
} | ||
|
||
func TestRuntime_Type(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.
same as above
} | ||
|
||
func TestRuntime_String(t *testing.T) { | ||
type fields struct { |
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.
this struct seems could be defined out of func?
Signed-off-by: scy1993 21851406@zju.edu.cn
Ⅰ. Describe what this PR did
test:supplement test cases for apis/opts/config/runtime.go
Ⅱ. Does this pull request fix one issue?
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews