Skip to content

tests: migrate ctl_v3_kv_test.go to common testing framework#21333

Open
veeceey wants to merge 4 commits intoetcd-io:mainfrom
veeceey:fix/issue-20550-migrate-kv-test
Open

tests: migrate ctl_v3_kv_test.go to common testing framework#21333
veeceey wants to merge 4 commits intoetcd-io:mainfrom
veeceey:fix/issue-20550-migrate-kv-test

Conversation

@veeceey
Copy link
Copy Markdown

@veeceey veeceey commented Feb 20, 2026

Summary

  • Migrate PutIgnoreValue, PutIgnoreLease, Get (with rev, keys-only, count-only, min/max create/mod rev), and Delete tests from tests/e2e/ctl_v3_kv_test.go to the common testing framework in tests/common/kv_test.go
  • Add IgnoreValue and IgnoreLease fields to config.PutOptions and implement support in both e2e (etcdctl) and integration client backends
  • Retain e2e-specific tests (GetFormat, GetRevokedCRL, PutClientTLSFlagByEnv) that depend on etcdctl output format or TLS-specific behavior

Test plan

  • Verify TestKVPutIgnoreValue passes with both e2e and integration build tags
  • Verify TestKVPutIgnoreLease passes with both e2e and integration build tags
  • Verify remaining e2e-specific tests (TestCtlV3GetFormat, TestCtlV3GetRevokedCRL, TestCtlV3PutClientTLSFlagByEnv) still pass
  • Verify existing common tests (TestKVPut, TestKVGet, TestKVDelete) are unaffected

Fixes #20550

@k8s-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: veeceey
Once this PR has been reviewed and has the lgtm label, please assign serathius for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@k8s-ci-robot
Copy link
Copy Markdown

Hi @veeceey. Thanks for your PR.

I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@veeceey veeceey force-pushed the fix/issue-20550-migrate-kv-test branch from 8463187 to 1ceb0c2 Compare February 23, 2026 01:59
@serathius
Copy link
Copy Markdown
Member

/ok-to-test

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.46%. Comparing base (aea999d) to head (113319e).

Additional details and impacted files

see 23 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #21333      +/-   ##
==========================================
+ Coverage   68.38%   68.46%   +0.08%     
==========================================
  Files         428      428              
  Lines       35291    35291              
==========================================
+ Hits        24132    24162      +30     
+ Misses       9756     9734      -22     
+ Partials     1403     1395       -8     

Continue to review full report in Codecov by Sentry.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@veeceey
Copy link
Copy Markdown
Author

veeceey commented Feb 28, 2026

Hi, I noticed some CI checks haven't passed yet — I'm looking into whether they're related to my changes or are pre-existing/flaky. Will follow up once I have more details. In the meantime, would appreciate any feedback on the approach itself. Thanks!

@veeceey
Copy link
Copy Markdown
Author

veeceey commented Mar 12, 2026

/retest

1 similar comment
@veeceey
Copy link
Copy Markdown
Author

veeceey commented Mar 12, 2026

/retest

veeceey added 4 commits March 11, 2026 21:31
Migrate PutIgnoreValue, PutIgnoreLease, Get (with rev, keys-only,
count-only, min/max create/mod rev), and Delete tests from
tests/e2e/ctl_v3_kv_test.go to the common testing framework in
tests/common/kv_test.go, enabling them to run in both e2e and
integration modes.

Add IgnoreValue and IgnoreLease fields to config.PutOptions and
implement support in both e2e (etcdctl) and integration client
backends.

Retain e2e-specific tests (GetFormat, GetRevokedCRL,
PutClientTLSFlagByEnv) that depend on etcdctl output format or
TLS-specific behavior.

Fixes etcd-io#20550

Signed-off-by: Varun Chawla <varun_6april@hotmail.com>
Remove unused flags parameter from ctlV3Put since ignore-value and
ignore-lease tests have been migrated to the common framework. Remove
unused ctlV3LeaseRevoke function.

Signed-off-by: Varun Chawla <varun_6april@hotmail.com>
Signed-off-by: Varun Chawla <varun_6april@hotmail.com>
After rebasing on main, the upstream TestCtlV3PutDialTimeout test
uses context.DeadlineExceeded but the context package was not imported.

Signed-off-by: Varun Chawla <varun_6april@hotmail.com>
@veeceey veeceey force-pushed the fix/issue-20550-migrate-kv-test branch from a9e1266 to 113319e Compare March 12, 2026 04:31
@veeceey
Copy link
Copy Markdown
Author

veeceey commented Apr 9, 2026

hey, all CI checks are passing now. would appreciate a review when you get a chance - happy to address any feedback!

@serathius
Copy link
Copy Markdown
Member

Please squash commits

Comment on lines -42 to -45
func TestCtlV3GetRev(t *testing.T) { testCtl(t, getRevTest) }
func TestCtlV3GetMinMaxCreateModRev(t *testing.T) { testCtl(t, getMinMaxCreateModRevTest) }
func TestCtlV3GetKeysOnly(t *testing.T) { testCtl(t, getKeysOnlyTest) }
func TestCtlV3GetCountOnly(t *testing.T) { testCtl(t, getCountOnlyTest) }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Where those tests went?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Migrate tests/e2e/ctl_v3_kv_test.go to common testing framework

3 participants