From ae3c04a76b0b82597b63989e1a97ae919af03168 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 4 Sep 2023 17:53:32 +0200 Subject: [PATCH] apt: tests: allow re-running digest test without clean-up Files inside CARGO_TARGET_TMPDIR are only cleaned on `cargo clean`, so tests that expect files to not exist need to cleanup themselves. Signed-off-by: Thomas Lamprecht --- proxmox-apt/tests/repositories.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/proxmox-apt/tests/repositories.rs b/proxmox-apt/tests/repositories.rs index be6aafff..7ed2f110 100644 --- a/proxmox-apt/tests/repositories.rs +++ b/proxmox-apt/tests/repositories.rs @@ -130,6 +130,9 @@ fn test_digest() -> Result<(), Error> { assert!(file.write().is_err()); + // best-effort cleanup for re-builds without a `cargo clean` in between + let _ = std::fs::remove_dir_all(&write_dir); + Ok(()) }