chore: Add Java build directory cleanup to test runner

This commit is contained in:
Paul Gauthier (aider) 2025-01-03 14:16:51 -05:00
parent 98b0e88ace
commit c0be857f37

View file

@ -853,7 +853,8 @@ def run_test_real(
instructions = errors
instructions += prompts.test_failures.format(file_list=file_list)
# Clean up Rust target/debug directory after all attempts
# Clean up build directories after all attempts
# Rust target/debug
target_dir = testdir / "target" / "debug"
if target_dir.exists():
try:
@ -862,6 +863,15 @@ def run_test_real(
except Exception as e:
print(f"Failed to clean up Rust target/debug directory: {e}")
# Java build directories
java_build_dir = testdir / "build"
if java_build_dir.exists():
try:
shutil.rmtree(java_build_dir)
print(f"Cleaned up Java build directory: {java_build_dir}")
except Exception as e:
print(f"Failed to clean up Java build directory: {e}")
results = dict(
testdir=str(testdir),
testcase=testdir.name,