Files
bitcoin/test/functional/test_framework
Ava Chow 21da421b42 Merge bitcoin/bitcoin#34439: qa: Drop recursive deletes from test code, add lint checks.
0d1301b47a test: functional: drop rmtree usage and add lint check (David Gumberg)
8bfb422de8 test: functional: drop unused --keepcache argument (David Gumberg)
a7e4a59d6d qa: 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:
    ACK 0d1301b47a
  hodlinator:
    ACK 0d1301b47a
  sedited:
    ACK 0d1301b47a

Tree-SHA512: da8ca23846b73eff0eaff61a5f80ba1decf63db783dcd86b25f88f4862ae28816fc9e2e9ee71283ec800d73097b1cfae64e3c5ba0e991be69c200c6098f24d6e
2026-03-26 13:05:01 -07:00
..
2026-03-12 16:01:05 +01:00
2025-12-26 08:19:34 +01:00