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