Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions codeflash/optimization/function_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1904,8 +1904,7 @@ def setup_and_establish_baseline(
original_code_baseline, test_functions_to_remove = baseline_result.unwrap()
# Check test quantity for all languages
quantity_ok = quantity_of_tests_critic(original_code_baseline)
# TODO: {Self} Only check coverage for Python - coverage infrastructure not yet reliable for JS/TS
coverage_ok = coverage_critic(original_code_baseline.coverage_results) if is_python() else True
coverage_ok = coverage_critic(original_code_baseline.coverage_results)
if isinstance(original_code_baseline, OriginalCodeBaseline) and (not coverage_ok or not quantity_ok):
if self.args.override_fixtures:
restore_conftest(original_conftest_content)
Expand Down Expand Up @@ -2348,8 +2347,7 @@ def establish_original_code_baseline(
)
console.rule()
return Failure("Failed to establish a baseline for the original code - bevhavioral tests failed.")
# Skip coverage check for non-Python languages (coverage not yet supported)
if is_python() and not coverage_critic(coverage_results):
if not coverage_critic(coverage_results):
did_pass_all_tests = all(result.did_pass for result in behavioral_results)
if not did_pass_all_tests:
return Failure("Tests failed to pass for the original code.")
Expand Down
Loading