summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2023-12-29 09:33:53 +0200
committerLars Wirzenius <liw@liw.fi>2023-12-29 09:33:53 +0200
commit3e560c049b4113c3f3ee69c0676ece2df4ce0d2d (patch)
tree9db5c75358fdc67d95a58f1cdb2c2ffa34aca599
parent57706f2acd6a1ce0905eba56cad068624aa9ca96 (diff)
downloadwumpus-hunter-3e560c049b4113c3f3ee69c0676ece2df4ce0d2d.tar.gz
fix: delete temporary files after a test run
Signed-off-by: Lars Wirzenius <liw@liw.fi>
-rwxr-xr-xwumpus-hunter10
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):