From c0be857f3776ae9b512a91b6623859d063d9f8d9 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 3 Jan 2025 14:16:51 -0500 Subject: [PATCH] chore: Add Java build directory cleanup to test runner --- benchmark/benchmark.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/benchmark/benchmark.py b/benchmark/benchmark.py index e72ae583e..c0b6f6b4c 100755 --- a/benchmark/benchmark.py +++ b/benchmark/benchmark.py @@ -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,