|
3 | 3 |
|
4 | 4 | from end_to_end_test_utilities import CoverageExpectation, TestConfig, run_codeflash_command, run_with_retries |
5 | 5 |
|
6 | | -# def run_test(expected_improvement_pct: int) -> bool: |
7 | | -# config = TestConfig( |
8 | | -# trace_mode=True, |
9 | | -# min_improvement_x=0.1, |
10 | | -# expected_unit_tests=1, |
11 | | -# coverage_expectations=[ |
12 | | -# CoverageExpectation(function_name="funcA", expected_coverage=100.0, expected_lines=[2, 3, 4, 6, 9]) |
13 | | -# ], |
14 | | -# ) |
15 | | -# cwd = ( |
16 | | -# pathlib.Path(__file__).parent.parent.parent / "code_to_optimize" / "code_directories" / "simple_tracer_e2e" |
17 | | -# ).resolve() |
18 | | -# return run_codeflash_command(cwd, config, expected_improvement_pct) |
19 | 6 |
|
20 | | - |
21 | | -def run_testbenchtest(expected_improvement_pct: int) -> bool: |
| 7 | +def run_test(expected_improvement_pct: int) -> bool: |
22 | 8 | config = TestConfig( |
23 | 9 | trace_mode=True, |
24 | 10 | min_improvement_x=0.1, |
| 11 | + expected_unit_tests=1, |
25 | 12 | coverage_expectations=[ |
26 | | - CoverageExpectation(function_name="add_numbers", expected_coverage=100.0, expected_lines=[2, 3, 4, 6, 9]) |
| 13 | + CoverageExpectation(function_name="funcA", expected_coverage=100.0, expected_lines=[2, 3, 4, 6, 9]), |
| 14 | + CoverageExpectation(function_name="add_numbers", expected_coverage=100.0, expected_lines=[2, 3, 4, 6, 9]), |
27 | 15 | ], |
28 | 16 | ) |
29 | 17 | cwd = ( |
30 | | - pathlib.Path(__file__).parent.parent.parent / "code_to_optimize" / "code_directories" / "testbench.py" |
| 18 | + pathlib.Path(__file__).parent.parent.parent / "code_to_optimize" / "code_directories" / "simple_tracer_e2e" |
31 | 19 | ).resolve() |
32 | 20 | return run_codeflash_command(cwd, config, expected_improvement_pct) |
33 | 21 |
|
34 | 22 |
|
35 | 23 | if __name__ == "__main__": |
36 | | - # tests = [run_test, run_testbenchtest] |
37 | | - tests = [run_testbenchtest] |
38 | | - for test in tests: |
39 | | - res = run_with_retries(test, int(os.getenv("EXPECTED_IMPROVEMENT_PCT", 10))) |
40 | | - exit(0 if res else 1) |
| 24 | + exit(run_with_retries(run_test, int(os.getenv("EXPECTED_IMPROVEMENT_PCT", 10)))) |
0 commit comments