radicle-heartwood-lfs/radicle
Lars Wirzenius 1a0221f726
radicle: fix tests to not leave temporary files behind
In radicle/src/test.rs, we have a helper type for a Node, which
creates a temporary directory using tempfile::tempdir, which creates a
TempDir. When the TempDir is dropped, it deletes its associated
directory. Before that happens, the Node has already stored the path.
Right after that the TempDir is dropped, and the directory deleted.
When the test code later opens the repository, using Storage::open,
it recreates the directory. As a result, there is nothing that would
delete the directory when the test finishes.

This means tests that use the helper Node type leave temporary files
behind.

Fix this by storing the TempDir in the helper Node, not just its path.
This means the TempDir is only dropped at the end of the test its used
in, and no temporary files are left behind.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-04-24 11:47:14 +02:00
..
src radicle: fix tests to not leave temporary files behind 2024-04-24 11:47:14 +02:00
Cargo.toml Update radicle crates to 0.9.0 2024-03-26 11:56:27 +01:00