Skip to content

🌱 Enable usetesting linter #12219

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sivchari
Copy link
Member

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #12179

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 15, 2025
@k8s-ci-robot k8s-ci-robot requested a review from elmiko May 15, 2025 14:00
@sivchari sivchari changed the title enable usetesting linter 🌱 Enable usetesting linter May 15, 2025
@k8s-ci-robot k8s-ci-robot requested a review from JoelSpeed May 15, 2025 14:00
@k8s-ci-robot k8s-ci-robot added do-not-merge/needs-area PR is missing an area label size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 15, 2025
Copy link
Contributor

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

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

Seems reasonable, just switched context.TODO/Background for t.Context across many files

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 15, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 9f4feb08815933df803ab6e77da92cf5d83d0aeb

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

/lgtm

@fabriziopandini
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

The full list of commands accepted by this bot can be found here.

The pull request process is described here

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 k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 16, 2025
@@ -17,7 +17,6 @@ limitations under the License.
package alpha

import (
"context"
"testing"
Copy link
Member

@sbueringer sbueringer May 16, 2025

Choose a reason for hiding this comment

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

Do we know how this will work in combination with ctrl.SetupSignalHandler() that we use in many places?

Which context will be cancelled first? Will the shutdown still be somewhat clean?

Copy link
Member

@sbueringer sbueringer May 16, 2025

Choose a reason for hiding this comment

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

+ should we use either t.Context() or ctrl.SetupSignalHandler() everywhere? Or continue to have that mix that we currently have? Or do we know in which cases we would want to use which one

Copy link
Member Author

Choose a reason for hiding this comment

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

t.Context() is canceled before t.Cleanup, then ctrl.SetupSignalHandler doesn't cancel until the signal is received. So it might be good to use properly. For example, how about is it ?

  • ctrl.SetupSignalHandler should be only used when it's suite test.
  • t.Context() should be only used other than suite test.

Copy link
Member

Choose a reason for hiding this comment

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

Sorry will get back to this eventually. Just a lot of other things going on

Copy link
Member

@sbueringer sbueringer Jun 12, 2025

Choose a reason for hiding this comment

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

(low priority at the moment) I wonder if we could/should get rid of ctrl.SetupSignalHandler() entirely.

I wonder what the difference is between using t.Context and ctrl.SetupSignalHandler in suite_test.go.

Is one more graceful then the other? Maybe let's test this manually?

Context:
ctrl.SetupSignalHandler will cancel the context on the first signal and os.Exit(1) on the second. I don't know how tests with t.Context behave when the test binary receives signals

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 26, 2025
Signed-off-by: sivchari <shibuuuu5@gmail.com>
@sivchari sivchari force-pushed the enable-usetesting branch from 7f41e53 to 6056d61 Compare May 29, 2025 08:24
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 29, 2025
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot k8s-ci-robot requested a review from JoelSpeed May 29, 2025 08:24
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 29, 2025
@sivchari
Copy link
Member Author

/area ci
/hold We discuss later

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. area/ci Issues or PRs related to ci and removed do-not-merge/needs-area PR is missing an area label labels May 29, 2025
@k8s-ci-robot
Copy link
Contributor

@sivchari: 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-cluster-api-test-main 6056d61 link true /test pull-cluster-api-test-main

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.

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.

@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/ci Issues or PRs related to ci cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable usetesting in golangci.yml
5 participants