-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Move the newClientCfg into clientv3 package so as to be reused by both etcdctl and v3discovery #13821
Conversation
54dd8cd
to
0419586
Compare
Codecov Report
@@ Coverage Diff @@
## main #13821 +/- ##
==========================================
- Coverage 72.63% 72.41% -0.23%
==========================================
Files 467 468 +1
Lines 38280 38273 -7
==========================================
- Hits 27806 27715 -91
- Misses 8686 8752 +66
- Partials 1788 1806 +18
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
Love the changes and I think we should go even further with them, however we need some tests.
This code seems simple at the first glance, however it's very fragile due to complicated dependencies.
Can you add a simple set of tests for newClientCfg
that guarantees we don't make unintentional changes during refactor?
0419586
to
48a0c8d
Compare
8e9d0ac
to
42d31d8
Compare
Added a unit test file, and all tests passed. PTAL, thanks. @serathius @spzala @ptabor |
Just to confirm, have you run the tests without the refactor to confirm that it change output? |
97a8462
to
bc91bbf
Compare
No. The function
|
d595f9b
to
b8104e0
Compare
After second thought, I decided to completely remove the original PTAL, thanks. @serathius @spzala @ptabor |
Just to clarify. A good rule about refactoring code is: don't refactor code that doesn't have tests. Add a test first, refactor, update test to new code. Problem with this PR is that it combines both adding test and refactor. This means that we are loosing the benefit of testing as we cannot verify if the refactor didn't change results. Refactor still needs to be human validated. If we are not adding the tests for the original code, I would double check the refactored code it to make sure there is no weird edge case. |
Thanks for the comment. I agree with you in principle. To eliminate your concern, I just added a unit test for the original
Note that the original Once the PR pull/13830 is merged, I will rebase this one. |
b8104e0
to
fa7db24
Compare
fa7db24
to
57d82c0
Compare
57d82c0
to
8089113
Compare
Just rebased this PR. PTAL, thanks. @serathius @spzala @ptabor |
8089113
to
a1935ac
Compare
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.
…h etcdctl and v3discovery
d5c6f00
to
bf6c69c
Compare
bf6c69c
to
49e9a14
Compare
Part of issues/13624, and it might be the last PR for this feature.