-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
test: use T.TempDir
to create temporary test directory
#8295
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8295 +/- ##
==========================================
- Coverage 40.34% 40.31% -0.03%
==========================================
Files 679 679
Lines 73985 73958 -27
==========================================
- Hits 29846 29819 -27
- Misses 38900 38924 +24
+ Partials 5239 5215 -24
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the test storage in the sector storage manager this LGTM. It looks like you've been keeping the ioutil temp dirs around in places where the current test does not delete the dir 👍. However I am less familiar with these other tests so it's hard to be sure.
Please go through and double check there are no more places where this change will remove test directories the current tests wouldn't and then this will be good to go.
The directory created by `T.TempDir` is automatically removed when the test and all its subtests complete. Reference: https://pkg.go.dev/testing#T.TempDir Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Related Issues
A testing enhancement.
Proposed Changes
Replaces
ioutil.TempDir
withT.TempDir
function from thetesting
package to create temporary directory. The directory created byT.TempDir
is automatically removed when the test and all its subtests complete.Additional Info
Reference: https://pkg.go.dev/testing#T.TempDir
Checklist
Before you mark the PR ready for review, please make sure that:
<PR type>: <area>: <change being made>
fix: mempool: Introduce a cache for valid signatures
PR type
: fix, feat, INTERFACE BREAKING CHANGE, CONSENSUS BREAKING, build, chore, ci, docs,perf, refactor, revert, style, testarea
: api, chain, state, vm, data transfer, market, mempool, message, block production, multisig, networking, paychan, proving, sealing, wallet, deps