Skip to content

Commit 8a37354

Browse files
feat: enable coverage check for all languages
Remove the Python-only gate on coverage checking so JS/TS optimizations also require adequate test coverage before proceeding. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2bcd91c commit 8a37354

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

codeflash/optimization/function_optimizer.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,8 +1904,7 @@ def setup_and_establish_baseline(
19041904
original_code_baseline, test_functions_to_remove = baseline_result.unwrap()
19051905
# Check test quantity for all languages
19061906
quantity_ok = quantity_of_tests_critic(original_code_baseline)
1907-
# TODO: {Self} Only check coverage for Python - coverage infrastructure not yet reliable for JS/TS
1908-
coverage_ok = coverage_critic(original_code_baseline.coverage_results) if is_python() else True
1907+
coverage_ok = coverage_critic(original_code_baseline.coverage_results)
19091908
if isinstance(original_code_baseline, OriginalCodeBaseline) and (not coverage_ok or not quantity_ok):
19101909
if self.args.override_fixtures:
19111910
restore_conftest(original_conftest_content)
@@ -2348,8 +2347,7 @@ def establish_original_code_baseline(
23482347
)
23492348
console.rule()
23502349
return Failure("Failed to establish a baseline for the original code - bevhavioral tests failed.")
2351-
# Skip coverage check for non-Python languages (coverage not yet supported)
2352-
if is_python() and not coverage_critic(coverage_results):
2350+
if not coverage_critic(coverage_results):
23532351
did_pass_all_tests = all(result.did_pass for result in behavioral_results)
23542352
if not did_pass_all_tests:
23552353
return Failure("Tests failed to pass for the original code.")

0 commit comments

Comments
 (0)