You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: mcp_server/server.py
+8-2Lines changed: 8 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@ def run_behavioral_tests(
19
19
run_id: str|None=None,
20
20
function_name: str|None=None,
21
21
module_path: str|None=None,
22
+
test_framework: str|None=None,
22
23
) ->dict[str, Any]:
23
24
"""Run tests and capture function return values + timing for each test invocation.
24
25
@@ -39,9 +40,10 @@ def run_behavioral_tests(
39
40
run_id: Identifier for this run. Use descriptive IDs like "baseline-exp-1". Auto-generated UUID if omitted.
40
41
function_name: Name of the function being optimized. When provided with module_path, enables automatic instrumentation of test files to capture return values and precise timing.
41
42
module_path: Absolute path to the source file containing the function being optimized. Required together with function_name for instrumentation.
43
+
test_framework: Optional test framework override. If omitted, codeflash will try to detect the framework automatically. For Python, the supported value is `pytest`. For JavaScript/TypeScript, supported values are `jest`, `vitest`, and `mocha`. For Java and Go, leave this unset because it is not used.
"""Run tests in multi-loop mode for stable timing, then compute speedup against a baseline.
103
107
@@ -132,9 +136,10 @@ def run_benchmarking_tests(
132
136
baseline_run_id: Run ID of a previous benchmark to compare against. Omit for baseline capture.
133
137
function_name: Name of the function being benchmarked. When provided with module_path, enables automatic instrumentation with performance-mode timing capture.
134
138
module_path: Absolute path to the source file containing the function. Required together with function_name.
139
+
test_framework: Optional test framework override. If omitted, codeflash will try to detect the framework automatically. For Python, the supported value is `pytest`. For JavaScript/TypeScript, supported values are `jest`, `vitest`, and `mocha`. For Java and Go, leave this unset because it is not used.
135
140
136
141
Returns:
137
-
run_id, total_runtime_ns, loops_executed, test_results, speedup (null if no baseline_run_id).
142
+
run_id, best_summed_runtime_ns, loops_executed, test_results, speedup (null if no baseline_run_id).
0 commit comments