File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -544,6 +544,7 @@ def rank_by_dependency_count(
544544
545545 def run (self ) -> None :
546546 from codeflash .code_utils .checkpoint import CodeflashRunCheckpoint
547+ from codeflash .discovery .discover_unit_tests import existing_unit_test_count
547548
548549 ph ("cli-optimize-run-start" )
549550 logger .info ("Running optimizer." )
@@ -664,14 +665,22 @@ def run(self) -> None:
664665 ref_count = callee_counts .get ((original_module_path , function_to_optimize .qualified_name ), 0 )
665666 ref_suffix = f" [{ ref_count } references]"
666667
668+ test_suffix = ""
669+ if function_to_tests :
670+ test_count = existing_unit_test_count (
671+ function_to_optimize , self .args .project_root , function_to_tests
672+ )
673+ if test_count > 0 :
674+ test_suffix = f" [{ test_count } tests]"
675+
667676 effort_override = None
668677 if i < HIGH_EFFORT_TOP_N :
669678 effort_override = EffortLevel .HIGH .value
670679
671680 effort_suffix = f" [effort={ effort_override } ]" if effort_override else ""
672681 logger .info (
673682 f"Optimizing function { function_iterator_count } of { len (globally_ranked_functions )} : "
674- f"{ function_to_optimize .qualified_name } (in { original_module_path .name } ){ ref_suffix } { effort_suffix } "
683+ f"{ function_to_optimize .qualified_name } (in { original_module_path .name } ){ test_suffix } { ref_suffix } { effort_suffix } "
675684 )
676685 console .rule ()
677686 function_optimizer = None
You can’t perform that action at this time.
0 commit comments