Skip to content

Conversation

@nwnt
Copy link
Member

@nwnt nwnt commented Dec 16, 2025

Adding a small unit test as a small start step for #20386

cc @serathius @joshjms

@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: nwnt
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

@codecov
Copy link

codecov bot commented Dec 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.12%. Comparing base (d99edb6) to head (67d8714).
⚠️ Report is 18 commits behind head on main.

Additional details and impacted files

see 22 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #21025      +/-   ##
==========================================
- Coverage   69.15%   69.12%   -0.04%     
==========================================
  Files         422      422              
  Lines       34841    34841              
==========================================
- Hits        24094    24083      -11     
- Misses       9346     9359      +13     
+ Partials     1401     1399       -2     

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 d99edb6...67d8714. Read the comment docs.

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

@nwnt nwnt force-pushed the add-txn-rangelimit-test branch from 2ae8ab1 to 7eb38a6 Compare December 16, 2025 14:40
@nwnt
Copy link
Member Author

nwnt commented Dec 16, 2025

The lint error is now fixed.

@serathius
Copy link
Member

serathius commented Dec 16, 2025

Tests should cover whole range execution, not just rangeLimit function that will be might not be used in the future.

For regression testing you want to run as high level test as possible to prove that changing implementation below doesn't change the output.

@nwnt
Copy link
Member Author

nwnt commented Dec 16, 2025

Yep, I can add the whole tests for range. Thought I was going to start adding them one by one to keep the PRs small, but I can do that too.

@serathius
Copy link
Member

We don't do testing to hardcode the reverse behavior of functions, we use them to prevent regressions. While doing small steps and small PRs is very good, we need to remember the goal test that ensures that the behavior of limit in range will not change. This test doesn't achieve this.

@nwnt
Copy link
Member Author

nwnt commented Dec 17, 2025

Totally understood. Still working on the unit tests for the Range function and will be sending that shortly.

@nwnt nwnt marked this pull request as draft December 18, 2025 03:49
@nwnt nwnt force-pushed the add-txn-rangelimit-test branch from 7eb38a6 to a07c5ba Compare December 19, 2025 06:13
@nwnt nwnt force-pushed the add-txn-rangelimit-test branch from a07c5ba to f65fb69 Compare December 19, 2025 06:14
@nwnt nwnt changed the title Add a unit test for range limit Add a unit test for *bucketBuffer.Range Dec 19, 2025
@nwnt nwnt marked this pull request as ready for review December 19, 2025 06:15
@nwnt
Copy link
Member Author

nwnt commented Dec 19, 2025

@serathius this should look better this time. I believe server's Range ultimately calls *bucketBuffer.Range which currently lacks any test coverage. This method of bucketBuffer is also where the values are returned together with the matched keys. If this is ok, I will have follow PRs for related functions until we have enough coverage before looking at adding the option for excluding the values.

Feel free to leave any comments.

@nwnt nwnt force-pushed the add-txn-rangelimit-test branch from f65fb69 to 7db9d95 Compare December 19, 2025 06:21
@nwnt nwnt force-pushed the add-txn-rangelimit-test branch from 7db9d95 to 67d8714 Compare December 19, 2025 06:34
@k8s-ci-robot
Copy link

@nwnt: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-etcd-coverage-report 67d8714 link true /test pull-etcd-coverage-report

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@serathius
Copy link
Member

Bucket buffer is just a buffer for a operations that have not been committed. While testing range should cover this buffer again testing it by itself is not enough

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.

3 participants