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

Use t.TempDir() in tests #7769

Merged
merged 6 commits into from
Nov 10, 2020
Merged

Use t.TempDir() in tests #7769

merged 6 commits into from
Nov 10, 2020

Conversation

farazdagi
Copy link
Contributor

What type of PR is this?

Other

What does this PR do? Why is it needed?

  • As of Go 1.15 support for temporary directories has been added (see t.TempDir()):

TempDir returns a temporary directory for the test to use. The directory is automatically removed by Cleanup when the test and all its subtests complete. Each subsequent call to t.TempDir returns a unique directory; if the directory creation fails, TempDir terminates the test by calling Fatal.

  • In several places we have number of different implementation allowing us to have a temporary directory, which is unique and removed after the test. All this is handled by the new t.TempDir().

Which issues(s) does this PR fix?

N/A

Other notes for review

@farazdagi farazdagi self-assigned this Nov 10, 2020
@farazdagi farazdagi marked this pull request as ready for review November 10, 2020 22:34
@farazdagi farazdagi requested a review from a team as a code owner November 10, 2020 22:34
@farazdagi farazdagi added OK to merge Ready For Review A pull request ready for code review labels Nov 10, 2020
@codecov
Copy link

codecov bot commented Nov 10, 2020

Codecov Report

Merging #7769 (303c4ad) into master (7f7d18e) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #7769      +/-   ##
==========================================
- Coverage   62.14%   62.12%   -0.02%     
==========================================
  Files         429      429              
  Lines       30370    30362       -8     
==========================================
- Hits        18873    18863      -10     
- Misses       8556     8561       +5     
+ Partials     2941     2938       -3     

@prylabs-bulldozer prylabs-bulldozer bot merged commit 2f11e55 into master Nov 10, 2020
@delete-merged-branch delete-merged-branch bot deleted the test-upd-tempdir branch November 10, 2020 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants