Skip to content

Commit dd8b058

Browse files
committed
fix tests dir missing
1 parent 1ef954a commit dd8b058

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/scripts/end_to_end_test_utilities.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ def run_codeflash_command(
8585

8686
path_to_file = cwd / config.file_path
8787
file_contents = path_to_file.read_text("utf-8")
88-
test_root = cwd / "tests" / "pytest" # Always use pytest
88+
# Check if tests/pytest exists, otherwise use tests/ directly
89+
pytest_dir = cwd / "tests" / "pytest"
90+
test_root = pytest_dir if pytest_dir.is_dir() else cwd / "tests"
8991

9092
command = build_command(cwd, config, test_root, config.benchmarks_root if config.benchmarks_root else None)
9193
env = os.environ.copy()
@@ -187,7 +189,9 @@ def validate_stdout_in_candidate(stdout: str, expected_in_stdout: list[str]) ->
187189

188190

189191
def run_trace_test(cwd: pathlib.Path, config: TestConfig, expected_improvement_pct: int) -> bool:
190-
test_root = cwd / "tests" / "pytest" # Always use pytest
192+
# Check if tests/pytest exists, otherwise use tests/ directly
193+
pytest_dir = cwd / "tests" / "pytest"
194+
test_root = pytest_dir if pytest_dir.is_dir() else cwd / "tests"
191195
clear_directory(test_root)
192196
command = ["uv", "run", "--no-project", "-m", "codeflash.main", "optimize", "workload.py"]
193197
env = os.environ.copy()

0 commit comments

Comments
 (0)