mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-06 21:57:54 +02:00
0d1301b47atest: functional: drop rmtree usage and add lint check (David Gumberg)8bfb422de8test: functional: drop unused --keepcache argument (David Gumberg)a7e4a59d6dqa: Remove all instances of `remove_all` except test cleanup (David Gumberg) Pull request description: Both `fs::remove_all` and `shutil::rmtree()` are a bit dangerous, and most of their uses are not necessary, this PR removes most instances of both. `remove_all()` is still used in in `src/test/util/setup_common.cpp` as part of `BasicTestingSetup::BasicTestingSetup`'s constructor and destructor, and it is used in the kernel test code's [`TestDirectory`](4ae00e9a71/src/test/kernel/test_kernel.cpp (L100-L112)):734899a4c4/src/test/kernel/test_kernel.cpp (L100-L112)In both cases, `remove_all` is likely necessary, but the kernel's test code is RAII, ideally `BasicTestingSetup` could be made similar in a follow-up or in this PR if reviewers think it is important. Similarly in the python code, most usage was unnecessary, but there are a few places where `rmtree()` was necessary, I have added sanity checks to make sure these are inside of the `tmpdir` before doing recursive delete there. ACKs for top commit: achow101: ACK0d1301b47ahodlinator: ACK0d1301b47asedited: ACK0d1301b47aTree-SHA512: da8ca23846b73eff0eaff61a5f80ba1decf63db783dcd86b25f88f4862ae28816fc9e2e9ee71283ec800d73097b1cfae64e3c5ba0e991be69c200c6098f24d6e