nats-server
nats-server copied to clipboard
Use testing.TempDir() where possible
Rather than relying on manual deferred cleanup of files, switch most tests to use testing.TempDir() which is automatically cleaned up.
- [ ] Link to issue, e.g.
Resolves #NNN
- [ ] Documentation added (if applicable)
- [x] Tests added
- [x] Branch rebased on top of current main (
git pull --rebase origin main
) - [x] Changes squashed to a single commit (described here)
- [ ] Build is green in Travis CI
- [x] You have certified that the contribution is your original work and that you license the work to the project under the Apache 2 license
Resolves #
Changes proposed in this pull request:
- Change test utility methods to use
testing.TempDir()
- Remove (now superfluous) deferred directory and file cleanup
/cc @nats-io/core
@kozlovic holding until after 2.9 sounds good (PR is still marked draft
, I only opened to see if Travis would surface any error I wasn't seeing locally (it did, fixed)