diff options
author | Lars Wirzenius <liw@liw.fi> | 2023-12-29 09:33:53 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2023-12-29 09:33:53 +0200 |
commit | 3e560c049b4113c3f3ee69c0676ece2df4ce0d2d (patch) | |
tree | 9db5c75358fdc67d95a58f1cdb2c2ffa34aca599 | |
parent | 57706f2acd6a1ce0905eba56cad068624aa9ca96 (diff) | |
download | wumpus-hunter-3e560c049b4113c3f3ee69c0676ece2df4ce0d2d.tar.gz |
fix: delete temporary files after a test run
Signed-off-by: Lars Wirzenius <liw@liw.fi>
-rwxr-xr-x | wumpus-hunter | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/wumpus-hunter b/wumpus-hunter index fb85bc0..866c15d 100755 --- a/wumpus-hunter +++ b/wumpus-hunter @@ -3,7 +3,9 @@ import argparse import logging import os +import shutil import subprocess +import tempfile import time @@ -151,7 +153,13 @@ def build(dirname): def run_tests(dirname, cmd): logging.info(f"run tests in {dirname}: {cmd}") - run(["bash", "-c", cmd], cwd=dirname) + + # Radicle heartwood tests sometimes leave temporary files. This can fill + # the disk. Deal with this by explicitly removing them. + + tmp = tempfile.mkdtemp() + run(["env", f"TMPDIR={tmp}", "bash", "-c", cmd], cwd=dirname) + shutil.rmtree(tmp) def record_success(filename, commit): |