-
Notifications
You must be signed in to change notification settings - Fork 76
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
Create internal/net/http/client option test #831
Conversation
[CHATOPS:HELP] ChatOps commands.
|
/rebase |
[REBASE] Rebase triggered by kevindiu for branch: test/net/http/client |
[REBASE] Failed to rebase. |
name: "set header success", | ||
args: args{ | ||
header: http.Header( | ||
map[string][]string{"dummy": []string{"val"}}, |
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.
[golangci] reported by reviewdog 🐶
File is not gofmt
-ed with -s
(gofmt)
Codecov Report
@@ Coverage Diff @@
## master #831 +/- ##
==========================================
+ Coverage 18.15% 18.55% +0.39%
==========================================
Files 422 422
Lines 19554 19572 +18
==========================================
+ Hits 3550 3631 +81
+ Misses 15793 15733 -60
+ Partials 211 208 -3
Continue to review full report at Codecov.
|
/format |
[FORMAT] Updating license headers and formatting go codes triggered by kevindiu. |
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.
LGTM
@kevindiu |
@vankichi I think it is better to write transport comparator in |
{ | ||
name: "set timeout failed with empty value", | ||
args: args{ | ||
dur: "", |
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.
I think it is not needed.
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.
@vankichi Do you mean this line dur: ""
is not need?
I think it is more clear to write even if the value is the default value of the type, what do you think?
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.
but, as you know, the default value of string is ""
.
I do not care but it is not necessary, also your opinion is right.
It is the decision problem, any test rule in coding guideline?
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.
There are no such rule in the coding guideline.
I am not sure if I am correct, as all we know the default value of string is "" in golang, we can decide to write this definition or not by ourself (not standardize for everyone, but preference for each developer), what do you think?
Even if we decide to use this pattern, I think this rule only applies to test code, so I think it is better not to write it in coding guideline.
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.
I think it is clear creating test case with no input test case like as int
pattern.
And, I think we consider about the unit test practice and create new document for unit testing.
How about it?
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.
I think it is clear creating test case with no input test case like as int pattern.
I think users need to input the value in option (for example WithXXX("")
, so I think writing ""
is more realistic and easier to understand.
I think we consider about the unit test practice and create new document for unit testing.
I think both ok for me. If you think the code quality of test code is important then I think maybe it is better to create it
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.
well, so how about write the default value expressly in each test?
OK. Let's try it, but Not now
{ | ||
name: "set timeout failed with empty value", | ||
args: args{ | ||
dur: "", |
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.
I think it is not needed.
{ | ||
name: "set timeout failed with empty value", | ||
args: args{ | ||
dur: "", |
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.
I think it is not needed.
@kevindiu |
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.
LGTM
/rebase |
[REBASE] Rebase triggered by vankichi for branch: test/net/http/client |
Signed-off-by: vdaas-ci <ci@vdaas.org>
229806e
56d099b
to
229806e
Compare
[FORMAT] Updating license headers and formatting go codes triggered by vankichi. |
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.
[APPROVED] This PR is approved by vankichi.
Description:
This PR implements http client option test.
This PR also includes the following changes:
transport
to theclient_test.go
New()
Related Issue:
How Has This Been Tested?:
Environment:
Types of changes:
Changes to Core Features:
Checklist: