Skip to content

Commit 702939d

Browse files
author
Codeflash Bot
committed
Merge branch 'lsp/init-flow' of github.com:codeflash-ai/codeflash into lsp/init-flow
2 parents b8d63c8 + db88777 commit 702939d

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

codeflash/code_utils/concolic_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,11 @@ def __init__(self) -> None:
7070

7171
def clean_concolic_tests(test_suite_code: str) -> str:
7272
try:
73-
can_parse = True
7473
tree = ast.parse(test_suite_code)
75-
except SyntaxError:
74+
can_parse = True
75+
except Exception:
7676
can_parse = False
77+
tree = None
7778

7879
if not can_parse:
7980
return AssertCleanup().transform_asserts(test_suite_code)
@@ -87,7 +88,6 @@ def clean_concolic_tests(test_suite_code: str) -> str:
8788
new_body.append(ast.Expr(value=stmt.test.left))
8889
else:
8990
new_body.append(stmt)
90-
9191
else:
9292
new_body.append(stmt)
9393
node.body = new_body

codeflash/optimization/function_optimizer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from rich.tree import Tree
2020

2121
from codeflash.api.aiservice import AiServiceClient, AIServiceRefinerRequest, LocalAiServiceClient
22-
from codeflash.api.cfapi import add_code_context_hash, create_staging, mark_optimization_success
22+
from codeflash.api.cfapi import CFAPI_BASE_URL, add_code_context_hash, create_staging, mark_optimization_success
2323
from codeflash.benchmarking.utils import process_benchmark_data
2424
from codeflash.cli_cmds.console import code_print, console, logger, lsp_log, progress_bar
2525
from codeflash.code_utils import env_utils
@@ -1472,7 +1472,7 @@ def process_review(
14721472
elif staging_review:
14731473
response = create_staging(**data)
14741474
if response.status_code == 200:
1475-
staging_url = f"https://app.codeflash.ai/review-optimizations/{self.function_trace_id[:-4] + exp_type if self.experiment_id else self.function_trace_id}"
1475+
staging_url = f"{CFAPI_BASE_URL}/review-optimizations/{self.function_trace_id[:-4] + exp_type if self.experiment_id else self.function_trace_id}"
14761476
console.print(
14771477
Panel(
14781478
f"[bold green]✅ Staging created:[/bold green]\n[link={staging_url}]{staging_url}[/link]",

codeflash/tracer.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ def main(args: Namespace | None = None) -> ArgumentParser:
103103
replay_test_paths = []
104104
if parsed_args.module and unknown_args[0] == "pytest":
105105
pytest_splits, test_paths = pytest_split(unknown_args[1:])
106+
if pytest_splits is None or test_paths is None:
107+
console.print(f"❌ Could not find test files in the specified paths: {unknown_args[1:]}")
108+
console.print(f"Current working directory: {Path.cwd()}")
109+
console.print("Please ensure the test directory exists and contains test files.")
110+
sys.exit(1)
106111

107112
if len(pytest_splits) > 1:
108113
processes = []

0 commit comments

Comments
 (0)