Add lease test cases for TestKVGet #22477
@serathius as discussed I consolidated the test cases from the original PR to one loop. The test results still show that the lease is missing:
Error: Should be empty, but was (*etcdserverpb.RangeResponse)(Inverse(protocmp.Transform, protocmp.Message{
"@type": s"etcdserverpb.RangeResponse",
"count": int64(6),
"header": protocmp.Message{"@type": s"etcdserverpb.ResponseHeader", "cluster_id": uint64(17070641374114564978), "revision": int64(9)},
"kvs": []protocmp.Message{
{"@type": s"mvccpb.KeyValue", "create_revision": int64(2), "key": []uint8("a"), "mod_revision": int64(2), ...},
{"@type": s"mvccpb.KeyValue", "create_revision": int64(3), "key": []uint8("b"), "mod_revision": int64(3), ...},
{
"@type": s"mvccpb.KeyValue",
"create_revision": int64(4),
"key": []uint8("c"),
- "lease": int64(5034919775099428869),
"mod_revision": int64(6),
"version": int64(3),
},
{"@type": s"mvccpb.KeyValue", "create_revision": int64(7), "key": []uint8("foo"), "mod_revision": int64(7), ...},
{"@type": s"mvccpb.KeyValue", "create_revision": int64(8), "key": []uint8("foo/abc"), "mod_revision": int64(8), ...},
{"@type": s"mvccpb.KeyValue", "create_revision": int64(9), "key": []uint8("fop"), "mod_revision": int64(9), ...},
},
}))
Test: TestKVGet/NoTLS/blank_key_with_--prefix_option_->_all_KVs_--keys-only
Messages: -want, +got
--- FAIL: TestKVGet/NoTLS/blank_key_with_--prefix_option_->_all_KVs_--keys-only (0.01s)
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 73.09%. Comparing base (
d6af802) to head (ce035e6).:warning: Report is 15 commits behind head on main.
<details><summary>Additional details and impacted files</summary>
see 26 files with indirect coverage changes
@@ Coverage Diff @@
## main #22477 +/- ##
==========================================
+ Coverage 72.97% 73.09% +0.11%
==========================================
Files 448 448
Lines 31788 31792 +4
==========================================
+ Hits 23197 23237 +40
+ Misses 8588 8552 -36
Partials 3 3
------
Continue to review full report in Codecov by Harness.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered by Codecov. Last update d6af802...ce035e6. Read the comment docs.
</details>
<details><summary> :rocket: New features to boost your workflow: </summary>
</details>
Ok, can you make the test pass and mark one that uses --keys-only with TODO bug?
Sorry just saw this. How about now @serathius?
wantResponse *clientv3.GetResponse
skipForLease bool
{name: "blank key with --prefix option -> all KVs", begin: "", options: config.GetOptions{Prefix: true}, wantResponse: &clientv3.GetResponse{Header: currentHeader, Count: 6, Kvs: allKvs}, skipForLease: true},
Nit: Better name would be to skopForKeysOnly.
Yep, done. Renamed to skipForKeysOnly
/retest
Approved these changes.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: <a href="https://github.com/etcd-io/etcd/pull/22477#" title="Author self-approved">nwnt</a>, <a href="https://github.com/etcd-io/etcd/pull/22477#pullrequestreview-5393575049" title="Approved">serathius</a>
The full list of commands accepted by this bot can be found here.
The pull request process is described here
<details >
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
</details>
<!-- META={"approvers":[]} -->
serathius
nwnt
Breaking down and remove the additional loop from #22245
Related to #22209