Skip to content

Commit c31f837

Browse files
misrasaurabh1claude
andcommitted
fix: ensure src/test/java directory exists before config validation
Git doesn't track empty directories, so src/test/java must be created before process_pyproject_config validates tests-root exists. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0a83002 commit c31f837

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

tests/scripts/end_to_end_test_java_tracer.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@ def run_test(expected_improvement_pct: int) -> bool:
1111
logging.basicConfig(level=logging.INFO)
1212
fixture_dir = (pathlib.Path(__file__).parent.parent / "test_languages" / "fixtures" / "java_tracer_e2e").resolve()
1313

14+
# Ensure test directory exists (git doesn't track empty dirs)
15+
test_java_dir = fixture_dir / "src" / "test" / "java"
16+
test_java_dir.mkdir(parents=True, exist_ok=True)
17+
1418
# Clean up leftover replay tests from previous runs
15-
replay_dir = fixture_dir / "src" / "test" / "java" / "codeflash" / "replay"
19+
replay_dir = test_java_dir / "codeflash" / "replay"
1620
if replay_dir.exists():
1721
shutil.rmtree(replay_dir, ignore_errors=True)
18-
# Also clean up any instrumented test files
19-
test_java_dir = fixture_dir / "src" / "test" / "java"
20-
if test_java_dir.exists():
21-
for f in test_java_dir.rglob("*__perfinstrumented*.java"):
22-
f.unlink(missing_ok=True)
23-
for f in test_java_dir.rglob("*__perfonlyinstrumented*.java"):
24-
f.unlink(missing_ok=True)
22+
for f in test_java_dir.rglob("*__perfinstrumented*.java"):
23+
f.unlink(missing_ok=True)
24+
for f in test_java_dir.rglob("*__perfonlyinstrumented*.java"):
25+
f.unlink(missing_ok=True)
2526

2627
# Compile the workload
2728
classes_dir = fixture_dir / "target" / "classes"

0 commit comments

Comments
 (0)