Skip to content

Comments

better coverage numbers#1564

Merged
misrasaurabh1 merged 3 commits intoomni-javafrom
dependent-coverage-numbers
Feb 20, 2026
Merged

better coverage numbers#1564
misrasaurabh1 merged 3 commits intoomni-javafrom
dependent-coverage-numbers

Conversation

@misrasaurabh1
Copy link
Contributor

No description provided.

@claude
Copy link
Contributor

claude bot commented Feb 20, 2026

PR Review Summary

Prek Checks

All checks passing. Fixed 1 ruff formatting issue in coverage_utils.py and added -> None return type annotations to 24 test methods to satisfy mypy. Changes pushed in commit 4730f342.

Mypy Checks

All checks passing. Fixed 24 no-untyped-def errors in tests/test_languages/test_java/test_coverage.py (missing -> None return types on test methods).

Code Review

No critical issues found.

The PR refactors JacocoCoverageUtils.load_from_jacoco_xml to:

  1. Extract _extract_lines_for_method and _compute_coverage_pct as reusable static helpers
  2. Add dependent (helper) function coverage tracking, mirroring the existing Python CoverageUtils behavior
  3. Aggregate total coverage across main + helper functions

The implementation correctly limits dependent coverage to exactly 1 helper function (matching Python behavior), and handles edge cases (helper not found in XML, multiple helpers, zero helpers).

Test Coverage

File Base (omni-java) PR Change
codeflash/verification/coverage_utils.py 41% (271 stmts, 159 miss) 48% (304 stmts, 159 miss) +7% ⬆️
tests/test_languages/test_java/test_coverage.py 100% 100% No change

Coverage improved. The PR adds 33 new statements to coverage_utils.py, and all 33 are covered by the 5 new test cases (miss count unchanged at 159). Test count went from 19 to 24.

Optimization PRs

3 open codeflash optimization PRs found (#1562, #1563, #1565). None are ready to merge — CI checks are either pending or have failures.


Last updated: 2026-02-20

@misrasaurabh1
Copy link
Contributor Author

@claude can you fix the import error for python 3.9 in the unit test and commit the fix?

@claude
Copy link
Contributor

claude bot commented Feb 20, 2026

Claude finished @misrasaurabh1's task in 54s —— View job


Fixed Python 3.9 Import Error

  • Identify the Python 3.9 import error in the unit test
  • Fix the import error by adding from __future__ import annotations
  • Commit and push the fix

Root cause: Line 15 of test_coverage.py used list[FunctionSource] | None — the X | Y union syntax (PEP 604) requires Python 3.10+ at runtime.

Fix: Added from __future__ import annotations at the top of tests/test_languages/test_java/test_coverage.py, which defers annotation evaluation and makes the syntax work on Python 3.9. Pushed in commit f321f836.


  • · *

The `list[X] | None` union syntax (PEP 604) requires Python 3.10+ at
runtime. Adding the future annotations import defers evaluation and
fixes the import error on Python 3.9.

Co-authored-by: Saurabh Misra <misrasaurabh1@users.noreply.github.com>
@misrasaurabh1 misrasaurabh1 merged commit bdf8f84 into omni-java Feb 20, 2026
23 of 29 checks passed
@misrasaurabh1 misrasaurabh1 deleted the dependent-coverage-numbers branch February 20, 2026 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant