-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add 'features' command to print available feature gates #6542
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6542 +/- ##
==========================================
- Coverage 96.05% 96.03% -0.03%
==========================================
Files 364 365 +1
Lines 20750 20767 +17
==========================================
+ Hits 19932 19944 +12
- Misses 622 626 +4
- Partials 196 197 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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 add a unit test
For the unit test, I am thinking the following:
Is this methodology correct? Otherwise, can you suggest a suitable testing mechanism? |
Signed-off-by: cs-308-2023 <[email protected]>
} | ||
|
||
func TestDisplay(t *testing.T) { | ||
internal.Command() |
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 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.
Without running internal.Command(), featuregate.GlobalRegistry() returns an empty array, so the output string is empty.
After running internal.Command(), I am able to get the flags.
if you are not getting any features during unit test, you can register a fake one just for the test, similar to this: jaeger/cmd/jaeger/internal/extension/remotesampling/config.go Lines 31 to 38 in 5c9f16d
|
Signed-off-by: cs-308-2023 <[email protected]>
Signed-off-by: cs-308-2023 <[email protected]>
@yurishkuro I have added a custom test. All the tests are being passed. |
if f == nil { | ||
return "" | ||
} | ||
out := "" |
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.
why use out +=
concatenation?
var buffer bytes.Buffer
w := io.StringWriter(&buffer)
// use fmt.Fprintf(w, format, values...)
return buffer.String()
Signed-off-by: cs-308-2023 <[email protected]>
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.
Thanks!
please resolve conflics |
Signed-off-by: cs-308-2023 <[email protected]>
did you not run the test locally?
|
Signed-off-by: cs-308-2023 <[email protected]>
Working on codecoverage |
How to check code coverage on local? |
go test -cover. I often use vscode package coverage command |
Signed-off-by: cs-308-2023 <[email protected]>
Head branch was pushed to by a user without write access
Which problem is this PR solving?
Description of the changes
How was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:npm run lint
andnpm run test