Skip to content

Commit 5d542d2

Browse files
committed
make easier to navigate
1 parent 69e5edf commit 5d542d2

8 files changed

+34
-32
lines changed

tests/scripts/end_to_end_test_async.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import os
2-
import pathlib
2+
from pathlib import Path
33

4-
from end_to_end_test_utilities import CoverageExpectation, TestConfig, run_codeflash_command, run_with_retries
4+
from tests.scripts.end_to_end_test_utilities import CoverageExpectation, TestConfig, run_codeflash_command, run_with_retries
55

66

77
def run_test(expected_improvement_pct: int) -> bool:
88
config = TestConfig(
9-
file_path="main.py",
9+
file_path=Path("main.py"),
1010
min_improvement_x=0.1,
1111
coverage_expectations=[
1212
CoverageExpectation(
@@ -17,7 +17,7 @@ def run_test(expected_improvement_pct: int) -> bool:
1717
],
1818
)
1919
cwd = (
20-
pathlib.Path(__file__).parent.parent.parent / "code_to_optimize" / "code_directories" / "async_e2e"
20+
Path(__file__).parent.parent.parent / "code_to_optimize" / "code_directories" / "async_e2e"
2121
).resolve()
2222
return run_codeflash_command(cwd, config, expected_improvement_pct)
2323

tests/scripts/end_to_end_test_benchmark_sort.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import os
2-
import pathlib
2+
from pathlib import Path
33

4-
from end_to_end_test_utilities import CoverageExpectation, TestConfig, run_codeflash_command, run_with_retries
4+
from tests.scripts.end_to_end_test_utilities import CoverageExpectation, TestConfig, run_codeflash_command, run_with_retries
55

66

77
def run_test(expected_improvement_pct: int) -> bool:
8-
cwd = (pathlib.Path(__file__).parent.parent.parent / "code_to_optimize").resolve()
8+
cwd = (Path(__file__).parent.parent.parent / "code_to_optimize").resolve()
99
config = TestConfig(
10-
file_path=pathlib.Path("bubble_sort.py"),
10+
file_path=Path("bubble_sort.py"),
1111
function_name="sorter",
1212
benchmarks_root=cwd / "tests" / "pytest" / "benchmarks",
1313
min_improvement_x=0.70,

tests/scripts/end_to_end_test_bubblesort_pytest.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import os
2-
import pathlib
2+
from pathlib import Path
33

4-
from end_to_end_test_utilities import CoverageExpectation, TestConfig, run_codeflash_command, run_with_retries
4+
5+
from tests.scripts.end_to_end_test_utilities import CoverageExpectation, TestConfig, run_codeflash_command, run_with_retries
56

67

78
def run_test(expected_improvement_pct: int) -> bool:
89
config = TestConfig(
9-
file_path="bubble_sort.py",
10+
file_path=Path("bubble_sort.py"),
1011
function_name="sorter",
1112
min_improvement_x=0.70,
1213
coverage_expectations=[
@@ -15,7 +16,7 @@ def run_test(expected_improvement_pct: int) -> bool:
1516
)
1617
],
1718
)
18-
cwd = (pathlib.Path(__file__).parent.parent.parent / "code_to_optimize").resolve()
19+
cwd = (Path(__file__).parent.parent.parent / "code_to_optimize").resolve()
1920
return run_codeflash_command(
2021
cwd, config, expected_improvement_pct, ['print("codeflash stdout: Sorting list")', 'print(f"result: {arr}")']
2122
)

tests/scripts/end_to_end_test_bubblesort_unittest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import os
2-
import pathlib
2+
from pathlib import Path
33

4-
from end_to_end_test_utilities import TestConfig, run_codeflash_command, run_with_retries
4+
from tests.scripts.end_to_end_test_utilities import TestConfig, run_codeflash_command, run_with_retries
55

66

77
def run_test(expected_improvement_pct: int) -> bool:
88
config = TestConfig(
9-
file_path="bubble_sort.py", function_name="sorter", min_improvement_x=0.30
9+
file_path=Path("bubble_sort.py"), function_name="sorter", min_improvement_x=0.30
1010
)
11-
cwd = (pathlib.Path(__file__).parent.parent.parent / "code_to_optimize").resolve()
11+
cwd = (Path(__file__).parent.parent.parent / "code_to_optimize").resolve()
1212
return run_codeflash_command(cwd, config, expected_improvement_pct)
1313

1414

tests/scripts/end_to_end_test_coverage.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
import os
2-
import pathlib
2+
from pathlib import Path
33

4-
from end_to_end_test_utilities import CoverageExpectation, TestConfig, run_codeflash_command, run_with_retries
4+
5+
from tests.scripts.end_to_end_test_utilities import CoverageExpectation, TestConfig, run_codeflash_command, run_with_retries
56

67

78
def run_test(expected_improvement_pct: int) -> bool:
89
config = TestConfig(
9-
file_path="bubble_sort.py",
10+
file_path=Path("bubble_sort.py"),
1011
function_name="sorter_one_level_depth",
1112
coverage_expectations=[
1213
CoverageExpectation(function_name="sorter_one_level_depth", expected_coverage=100.0, expected_lines=[2])
1314
],
1415
)
1516
cwd = (
16-
pathlib.Path(__file__).parent.parent.parent / "code_to_optimize" / "code_directories" / "my-best-repo"
17+
Path(__file__).parent.parent.parent / "code_to_optimize" / "code_directories" / "my-best-repo"
1718
).resolve()
1819
return run_codeflash_command(cwd, config, expected_improvement_pct)
1920

tests/scripts/end_to_end_test_init_optimization.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import os
2-
import pathlib
2+
from pathlib import Path
33

4-
from end_to_end_test_utilities import CoverageExpectation, TestConfig, run_codeflash_command, run_with_retries
4+
from tests.scripts.end_to_end_test_utilities import CoverageExpectation, TestConfig, run_codeflash_command, run_with_retries
55

66

77
def run_test(expected_improvement_pct: int) -> bool:
88
config = TestConfig(
9-
file_path="remove_control_chars.py",
9+
file_path=Path("remove_control_chars.py"),
1010
function_name="CharacterRemover.remove_control_characters",
1111
min_improvement_x=0.1,
1212
coverage_expectations=[
@@ -15,7 +15,7 @@ def run_test(expected_improvement_pct: int) -> bool:
1515
)
1616
],
1717
)
18-
cwd = (pathlib.Path(__file__).parent.parent.parent / "code_to_optimize").resolve()
18+
cwd = (Path(__file__).parent.parent.parent / "code_to_optimize").resolve()
1919
return run_codeflash_command(cwd, config, expected_improvement_pct)
2020

2121

tests/scripts/end_to_end_test_topological_sort_worktree.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import os
2-
import pathlib
2+
from pathlib import Path
33

4-
from end_to_end_test_utilities import CoverageExpectation, TestConfig, run_codeflash_command, run_with_retries
4+
from tests.scripts.end_to_end_test_utilities import CoverageExpectation, TestConfig, run_codeflash_command, run_with_retries
55

66

77
def run_test(expected_improvement_pct: int) -> bool:
88
config = TestConfig(
9-
file_path="topological_sort.py",
9+
file_path=Path("topological_sort.py"),
1010
function_name="Graph.topologicalSort",
1111
min_improvement_x=0.05,
1212
use_worktree=True,
@@ -17,9 +17,9 @@ def run_test(expected_improvement_pct: int) -> bool:
1717
expected_lines=[25, 26, 27, 28, 29, 30, 31],
1818
)
1919
],
20-
expected_unit_tests=13,
20+
expected_unit_tests=1,
2121
)
22-
cwd = (pathlib.Path(__file__).parent.parent.parent / "code_to_optimize").resolve()
22+
cwd = (Path(__file__).parent.parent.parent / "code_to_optimize").resolve()
2323
return_var = run_codeflash_command(cwd, config, expected_improvement_pct)
2424
return return_var
2525

tests/scripts/end_to_end_test_tracer_replay.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
2-
import pathlib
2+
from pathlib import Path
33

4-
from end_to_end_test_utilities import CoverageExpectation, TestConfig, run_codeflash_command, run_with_retries
4+
from tests.scripts.end_to_end_test_utilities import CoverageExpectation, TestConfig, run_codeflash_command, run_with_retries
55

66

77
def run_test(expected_improvement_pct: int) -> bool:
@@ -14,7 +14,7 @@ def run_test(expected_improvement_pct: int) -> bool:
1414
],
1515
)
1616
cwd = (
17-
pathlib.Path(__file__).parent.parent.parent / "code_to_optimize" / "code_directories" / "simple_tracer_e2e"
17+
Path(__file__).parent.parent.parent / "code_to_optimize" / "code_directories" / "simple_tracer_e2e"
1818
).resolve()
1919
return run_codeflash_command(cwd, config, expected_improvement_pct)
2020

0 commit comments

Comments
 (0)