etcd
etcd copied to clipboard
tests: add WaitLeader function to common framework
This PR relates to #14305
Codecov Report
Merging #14304 (b2726c4) into main (b2726c4) will not change coverage. The diff coverage is
n/a.
:exclamation: Current head b2726c4 differs from pull request most recent head b211a30. Consider uploading reports for the commit b211a30 to get more accurate results
@@ Coverage Diff @@
## main #14304 +/- ##
=======================================
Coverage 75.63% 75.63%
=======================================
Files 457 457
Lines 37048 37048
=======================================
Hits 28020 28020
Misses 7288 7288
Partials 1740 1740
| Flag | Coverage Δ | |
|---|---|---|
| all | 75.63% <0.00%> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more
Created amended version of your PR https://github.com/etcd-io/etcd/pull/14313 as an example. It's a draft to showcase possible solution. I'll close it out and we can keep working on this PR.
The idea is to convert WaitLeader and WaitMembersForLeader to helper functions that use Cluster interface. In integration/cluster.go, integrationCluster can be converted and we can use the same helper.
@serathius this might be a good use case for you to review. How do we share implementation of methods that only use Cluster interface? Instead of helper methods we can use embeddings, but that will change your original interface.
Created amended version of your PR #14313 as an example. It's a draft to showcase possible solution. I'll close it out and we can keep working on this PR.
The idea is to convert WaitLeader and WaitMembersForLeader to helper functions that use Cluster interface. In integration/cluster.go, integrationCluster can be converted and we can use the same helper.
@serathius this might be a good use case for you to review. How do we share implementation of methods that only use Cluster interface? Instead of helper methods we can use embeddings, but that will change your original interface.
It's a neat solution in a more idiomatic way. I really like it :)
cc @ahrtr @spzala as I'm on vacation.
@spzala This PR is good to go for me. Do you have any other comments or concerns? thx
Thanks @spzala
Great work! @clarkfw
Thanks to @ahrtr and @spzala for your help! This PR won't have gone so well without your collaboration.