We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc6f2cb commit a2337b8Copy full SHA for a2337b8
1 file changed
codeflash/optimization/optimizer.py
@@ -493,10 +493,10 @@ def rank_all_functions_globally(
493
if file_path:
494
globally_ranked.append((file_path, func))
495
496
- # Boost functions with existing unit tests — more tests ranks higher
+ # Boost functions with existing unit tests above untested ones, preserving addressable-time order within each tier
497
if function_to_tests:
498
globally_ranked.sort(
499
- key=lambda x: -existing_unit_test_count(x[1], self.args.project_root, function_to_tests)
+ key=lambda x: -(1 if existing_unit_test_count(x[1], self.args.project_root, function_to_tests) > 0 else 0)
500
)
501
502
console.rule()
0 commit comments