File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -898,8 +898,10 @@ def setup_and_establish_baseline(
898898 return Failure (baseline_result .failure ())
899899
900900 original_code_baseline , test_functions_to_remove = baseline_result .unwrap ()
901- if isinstance (original_code_baseline , OriginalCodeBaseline ) and not coverage_critic (
902- original_code_baseline .coverage_results , self .args .test_framework
901+ if (
902+ isinstance (original_code_baseline , OriginalCodeBaseline )
903+ and not coverage_critic (original_code_baseline .coverage_results , self .args .test_framework )
904+ and not quantity_of_tests_critic (original_code_baseline )
903905 ):
904906 if self .args .override_fixtures :
905907 restore_conftest (original_conftest_content )
Original file line number Diff line number Diff line change 1212from codeflash .models .models import TestType
1313
1414if TYPE_CHECKING :
15- from codeflash .models .models import CoverageData , OptimizedCandidateResult
15+ from codeflash .models .models import CoverageData , OptimizedCandidateResult , OriginalCodeBaseline
1616
1717
1818def performance_gain (* , original_runtime_ns : int , optimized_runtime_ns : int ) -> float :
@@ -50,7 +50,7 @@ def speedup_critic(
5050 return bool (perf_gain > noise_floor and candidate_result .best_test_runtime < best_runtime_until_now )
5151
5252
53- def quantity_of_tests_critic (candidate_result : OptimizedCandidateResult ) -> bool :
53+ def quantity_of_tests_critic (candidate_result : OptimizedCandidateResult | OriginalCodeBaseline ) -> bool :
5454 test_results = candidate_result .behavior_test_results
5555 report = test_results .get_test_pass_fail_report_by_type ()
5656
You can’t perform that action at this time.
0 commit comments