Skip to content
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

ISSUE-696: Explore use of t.TempDir() #702

Merged
merged 1 commit into from
Mar 22, 2021

Conversation

Evalle
Copy link
Contributor

@Evalle Evalle commented Mar 15, 2021

PR Summary:

For the reviewers:
I'm not sure this is the right implementation, as @ahmetb asked to deprecate the implementation of testutil.NewTempDir(t) should I add some deprecation notice? Thanks in advance for the advices/reviews.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 15, 2021
@k8s-ci-robot
Copy link
Contributor

Welcome @Evalle!

It looks like this is your first PR to kubernetes-sigs/krew 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/krew has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 15, 2021
@ahmetb
Copy link
Member

ahmetb commented Mar 15, 2021

Ideally we'd get rid of this type.

@Evalle
Copy link
Contributor Author

Evalle commented Mar 17, 2021

@ahmetb thanks for the feedback! Just to be clear, you would like to get rid of NewTempDir completely or of type Tempdir I'm pretty new in golang so my question could sound strange. Thanks!

@corneliusweig
Copy link
Contributor

@Evalle Can you have a look how the methods on the TempDir type are used? If there are just a few usages, it would be nice to get rid of the tempdir.go file and move the methods as free functions elsewhere.

If there are a lot of usages, your current PR looks good to me.

@ahmetb
Copy link
Member

ahmetb commented Mar 22, 2021

Yeah I was expecting maybe we have simpler unit test usages that just do NewTestUtil() in a single test function. For those, t.TempDir() can be better. But right now, there's no reason to split the usage into two. We can just accept this.
/lgtm
/approve

Any developer/build system will need to update to go1.16 go1.15.

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahmetb, Evalle

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 Mar 22, 2021
@k8s-ci-robot k8s-ci-robot merged commit 2ca4cc2 into kubernetes-sigs:master Mar 22, 2021
@Evalle
Copy link
Contributor Author

Evalle commented Mar 22, 2021

Thanks @ahmetb and @corneliusweig for the reviews

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Explore use of t.TempDir()
4 participants