Skip to content
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

Migrate key value Get to common framework #13740

Merged
merged 7 commits into from
Mar 2, 2022
Merged

Conversation

serathius
Copy link
Member

@codecov-commenter
Copy link

codecov-commenter commented Feb 24, 2022

Codecov Report

Merging #13740 (623db60) into main (fd5cd9f) will decrease coverage by 0.04%.
The diff coverage is n/a.

❗ Current head 623db60 differs from pull request most recent head 49e9cb5. Consider uploading reports for the commit 49e9cb5 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #13740      +/-   ##
==========================================
- Coverage   72.61%   72.57%   -0.05%     
==========================================
  Files         467      467              
  Lines       38286    38286              
==========================================
- Hits        27802    27785      -17     
- Misses       8672     8685      +13     
- Partials     1812     1816       +4     
Flag Coverage Δ
all 72.57% <ø> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
api/version/version.go 77.77% <ø> (ø)
client/pkg/v3/tlsutil/tlsutil.go 83.33% <0.00%> (-8.34%) ⬇️
client/v3/leasing/util.go 91.66% <0.00%> (-6.67%) ⬇️
raft/rafttest/node.go 95.00% <0.00%> (-5.00%) ⬇️
client/v3/concurrency/session.go 88.63% <0.00%> (-4.55%) ⬇️
server/etcdserver/util.go 85.71% <0.00%> (-3.18%) ⬇️
server/etcdserver/api/rafthttp/msgappv2_codec.go 71.30% <0.00%> (-1.74%) ⬇️
client/v3/maintenance.go 54.71% <0.00%> (-1.26%) ⬇️
client/v3/op.go 74.32% <0.00%> (-1.15%) ⬇️
server/storage/mvcc/kvstore_txn.go 75.27% <0.00%> (-1.10%) ⬇️
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fd5cd9f...49e9cb5. Read the comment docs.

tests/framework/integration/cluster.go Outdated Show resolved Hide resolved
tests/framework/integration/cluster.go Show resolved Hide resolved
}
if o.CountOnly {
clientOpts = append(clientOpts, clientv3.WithCountOnly())
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use a for loop to process all the GetOptions? It would be better to follow the same logic as op.go#L326-L330, so as to make the code more readable and extensible.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was explicitly avoided when working on e2e implementation. Due to differences between e2e and integration code, one prefers using config as a struct and second options as a list of functions that can be applied on config. No matter what which approach we peak it will be always awkward in one of the approaches.

In the end I decided to go with configuration struct as it requires least amount of code making it more flexible to re-implementation. Implementing both interfaces would be even worse as it would double the required code without any benefits as having a clean interface is not as important for internal test framework.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

tests/framework/integration.go Outdated Show resolved Hide resolved
tests/framework/e2e/etcdctl.go Show resolved Hide resolved
tests/framework/config/cluster.go Show resolved Hide resolved
@serathius serathius force-pushed the common-get branch 3 times, most recently from 1d049bf to 95dc51a Compare February 25, 2022 10:26
tests/framework/config/cluster.go Show resolved Hide resolved
tests/framework/config/client.go Outdated Show resolved Hide resolved
Copy link
Member

@ahrtr ahrtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@spzala spzala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks @serathius

@@ -22,28 +22,14 @@ import (
"go.etcd.io/etcd/tests/v3/framework/e2e"
)

func TestCtlV3PutNoTLS(t *testing.T) { testCtl(t, putTest, withCfg(*e2e.NewConfigNoTLS())) }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@serathius I am curious why are we removing bunch of test functions? Thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the tests are moved into tests/common/kv_test.go.

Copy link
Member Author

@serathius serathius Mar 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this are exact tests that are migrated, as we are combining e2e and integration tests I remove test cases from both directories.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, cool. Thanks both!!

@serathius serathius merged commit 31de503 into etcd-io:main Mar 2, 2022
@nic-chen
Copy link
Contributor

Hi, serathius you need someone else to share the work? I would like to participate in etcd's contribution from the test. thanks.

@serathius serathius deleted the common-get branch June 15, 2023 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants