etcd
etcd copied to clipboard
tests: remaining errors.Is conversions
tests directory errors.Is conversions, as part of https://github.com/etcd-io/etcd/issues/18576
Hi @redwrasse. 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.
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.
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 68.75%. Comparing base (
54db7f0) to head (eabdc8d).
:exclamation: Current head eabdc8d differs from pull request most recent head 1c825ad
Please upload reports for the commit 1c825ad to get more accurate results.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
see 20 files with indirect coverage changes
@@ Coverage Diff @@
## main #18634 +/- ##
==========================================
- Coverage 68.79% 68.75% -0.05%
==========================================
Files 420 420
Lines 35493 35492 -1
==========================================
- Hits 24419 24403 -16
- Misses 9648 9660 +12
- Partials 1426 1429 +3
Continue to review full report in Codecov by Sentry.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 54db7f0...1c825ad. Read the comment docs.
Hi @redwrasse, thanks for opening this pull request. I know this is a draft, but I see the following instances that need to be updated:
tests/integration/v3_grpc_test.go:1565: if err != nil && err != context.DeadlineExceeded {tests/integration/v3_lease_test.go:1089: if terr != nil && terr != gofail.ErrDisabled {tests/integration/clientv3/maintenance_test.go:307: if err != nil && err != context.Canceled {tests/integration/clientv3/watch_test.go:812: if err := cli.Close(); err != nil && err != context.Canceled {
Added those is @ivanvc . Let me know if you see anymore, otherwise I'll mark this ready for review.
I suggest to address nil error before calling
errors.Is()By the way, have you considered activate errorlint with golangci, that can be very helpful.
You can see how I did that on prometheus if you need an idea on how to split the work
Thanks for the suggestions, @mmorel-35. I was looking for a linter rule but couldn't find one (refer to: https://github.com/etcd-io/etcd/pull/18510#issuecomment-2364184198). We're tracking the work in the parent task #18576.
Given the changes you suggested, it may be a good idea to revise the merged PRs. @redwrasse, are you okay with opening this to more contributors? @mmorel-35, would you be interested in working on this, too?
@ivanvc and @mmorel-35 - definitely open to more contributors! Let me know how you'd like to proceed.
I believe it can be splitted per module.
I'm starting with go.etcd.io/etcd/client/v2
Thank you so much, @mmorel-35 :bow: :star2:
It seems like nil testing is not really necessary as this already handled by errors.As and errors.Is
/test all
Hi @redwrasse, I enabled errorlint, as Matthieu suggested, and do see some issues comparing errors with ==. If you don't have the bandwidth to continue working on this right now, we could undraft this pull request, merge it, and work on the remaining issues in a follow-up pull request. What do you think?
Thanks again for your help!
Edit: If you mark it as ready for review, can you rebase it? The checks that failed should be working on the main branch now. Thanks.
@ivanvc apologies, I completely forgot about/lost track of this PR. Yes, let me rebase and open for review, and the remaining issues can be a separate PR.
Rebased, squashed, opened for review. Hopefully this one is good to go.
/cc @ahrtr
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: ahrtr, ivanvc, mmorel-35, redwrasse
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [ahrtr]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment