codeflash/tests/scripts/end_to_end_test_java_void_optimization.py

18 lines
No EOL
624 B
Python

import os
import pathlib
from end_to_end_test_utilities import TestConfig, run_codeflash_command, run_with_retries
def run_test(expected_improvement_pct: int) -> bool:
config = TestConfig(
file_path="src/main/java/com/example/InPlaceSorter.java",
function_name="bubbleSortInPlace",
min_improvement_x=0.70,
)
cwd = (pathlib.Path(__file__).parent.parent.parent / "code_to_optimize" / "java").resolve()
return run_codeflash_command(cwd, config, expected_improvement_pct)
if __name__ == "__main__":
exit(run_with_retries(run_test, int(os.getenv("EXPECTED_IMPROVEMENT_PCT", 70))))