@@ -2675,12 +2675,15 @@ def establish_original_code_baseline(
26752675 logger .debug (
26762676 f"[PIPELINE] Test file { idx } : behavior={ tf .instrumented_behavior_file_path } , perf={ tf .benchmarking_file_path } "
26772677 )
2678+ total_looping_time = (
2679+ TOTAL_LOOPING_TIME_EFFECTIVE / 2 if is_subagent_mode () else TOTAL_LOOPING_TIME_EFFECTIVE
2680+ )
26782681 behavioral_results , coverage_results = self .run_and_parse_tests (
26792682 testing_type = TestingMode .BEHAVIOR ,
26802683 test_env = test_env ,
26812684 test_files = self .test_files ,
26822685 optimization_iteration = 0 ,
2683- testing_time = TOTAL_LOOPING_TIME_EFFECTIVE ,
2686+ testing_time = total_looping_time ,
26842687 enable_coverage = True ,
26852688 code_context = code_context ,
26862689 )
@@ -2689,33 +2692,6 @@ def establish_original_code_baseline(
26892692 self .write_code_and_helpers (
26902693 self .function_to_optimize_source_code , original_helper_code , self .function_to_optimize .file_path
26912694 )
2692- # Instrument codeflash capture
2693- with progress_bar ("Running tests to establish original code behavior..." ):
2694- try :
2695- self .instrument_capture (file_path_to_helper_classes )
2696-
2697- total_looping_time = (
2698- TOTAL_LOOPING_TIME_EFFECTIVE / 2 if is_subagent_mode () else TOTAL_LOOPING_TIME_EFFECTIVE
2699- )
2700- logger .debug (f"[PIPELINE] Establishing baseline with { len (self .test_files )} test files" )
2701- for idx , tf in enumerate (self .test_files ):
2702- logger .debug (
2703- f"[PIPELINE] Test file { idx } : behavior={ tf .instrumented_behavior_file_path } , perf={ tf .benchmarking_file_path } "
2704- )
2705- behavioral_results , coverage_results = self .run_and_parse_tests (
2706- testing_type = TestingMode .BEHAVIOR ,
2707- test_env = test_env ,
2708- test_files = self .test_files ,
2709- optimization_iteration = 0 ,
2710- testing_time = total_looping_time ,
2711- enable_coverage = True ,
2712- code_context = code_context ,
2713- )
2714- finally :
2715- # Remove codeflash capture
2716- self .write_code_and_helpers (
2717- self .function_to_optimize_source_code , original_helper_code , self .function_to_optimize .file_path
2718- )
27192695 if not behavioral_results :
27202696 logger .warning (
27212697 f"force_lsp|Couldn't run any tests for original function { self .function_to_optimize .function_name } . Skipping optimization."
0 commit comments