Skip to content

Enable usetesting in golangci.yml #12179

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
sivchari opened this issue May 9, 2025 · 5 comments · May be fixed by #12219
Open

Enable usetesting in golangci.yml #12179

sivchari opened this issue May 9, 2025 · 5 comments · May be fixed by #12219
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@sivchari
Copy link
Member

sivchari commented May 9, 2025

usetesting linter is automatically enabled when Go 1.24 is used.

This linter diagnose the calls that can be replaced by functions defined in testing package. e.g. os.Setenv -> testing.Setenv.

It is what we're going to do after #12128 will be merged since the diff is very large.

The issue aims to enable usetesting linter and the fix all diagnostics to pass all.

/help

@k8s-ci-robot
Copy link
Contributor

@sivchari:
This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

usetesting linter is automatically enabled when Go 1.24 is used.

This linter diagnose the calls that can be replaced by functions defined in testing package. e.g. os.Setenv -> testing.Setenv.

It is what we're going to do after #12128 will be merged since the diff is very large.

The issue aims to enable usetesting linter and the fix all diagnostics to pass all.

/help

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 help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. needs-priority Indicates an issue lacks a `priority/foo` label and requires one. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels May 9, 2025
@sbueringer
Copy link
Member

sbueringer commented May 9, 2025

Thx for opening the issue!

/triage accepted
/priority backlog
/kind cleanup

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/backlog Higher priority than priority/awaiting-more-evidence. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates an issue lacks a `priority/foo` label and requires one. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels May 9, 2025
@mboersma
Copy link
Contributor

@sivchari isn't usetesting already enabled?

- usetesting # report function to be replace by testing

@sbueringer
Copy link
Member

sbueringer commented May 12, 2025

We're going to temporarily disable it in #12128 so the Go 1.24 bump PR doesn't become to big

@sivchari
Copy link
Member Author

/assign

@sivchari sivchari linked a pull request May 15, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants