taubyte / tau

Open source distributed Platform as a Service (PaaS). A self-hosted Vercel / Netlify / Cloudflare alternative.
https://tau.how
BSD 3-Clause "New" or "Revised" License
3.18k stars 85 forks source link

Replace MkdirTemp calls in tests with t.TempDir() #233

Closed samyfodil closed 1 month ago

samyfodil commented 1 month ago

Some test create temporary folders. Example: https://github.com/taubyte/tau/blob/2224d3f23b7689c81f0aec961e17ca5ffc85df7e/p2p/peer/pebble_peer_test.go#L14

Use t.TempDir() instead.

jjjclarke commented 1 month ago

Made these changes and testing that everything works. If all goes well, I'll submit a pull request soon.

jjjclarke commented 1 month ago

Talk about embarrassing! My apologies. Someone else can have a go ✋

samyfodil commented 1 month ago

@jjjclarke your PR https://github.com/taubyte/tau/pull/234 is almost there. TempDir takes no argument and returns one. check https://pkg.go.dev/testing#B.TempDir

jjjclarke commented 1 month ago

Changes have been made (and tested this time) and pull request has been updated.

samyfodil commented 1 month ago

merged. thanks @jjjclarke