Skip to content

Handle malformed coverage files - #93

Merged
maleadt merged 1 commit into
JuliaCI:masterfrom
ranocha:hr/fix_70_92
Oct 2, 2026
Merged

maleadt merged 1 commit into
JuliaCI:masterfrom
ranocha:hr/fix_70_92

Conversation

@ranocha

@ranocha ranocha commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Julia's .cov files can contain an empty or partial line (#70, #92). CoverageTools currently slices the first nine characters of every line, so one damaged file aborts coverage collection, even when another process wrote a usable coverage file.

This reads Julia's ASCII count field and treats malformed records as unknown counts. It keeps a slot for each bad record, so later counts stay on the right source lines and counts from another .cov file can still be merged. It warns once per affected file. Source exclusion also handles a coverage file that ends before the source file.

For example, counts of 1, an empty record, then 3 become [1, nothing, 3] rather than throwing or shifting 3 to the second line. Existing source analysis may still infer zero for an unknown line inside a function.

Tested with the full suite on Julia 1.10.12 and 1.14 nightly. The new tests cover empty and truncated records, count-field boundaries, merging with a complete file, and a coverage file shorter than its source.

Fixes #70. Fixes #92.

@codecov

codecov Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.08%. Comparing base (a0d2e8e) to head (b3b519b).

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #93      +/-   ##
==========================================
+ Coverage   95.81%   96.08%   +0.27%     
==========================================
  Files           4        4              
  Lines         358      383      +25     
==========================================
+ Hits          343      368      +25     
  Misses         15       15              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maleadt maleadt changed the title fix issues with malformed files Handle malformed coverage files Oct 2, 2026
@maleadt
maleadt merged commit 4b28312 into JuliaCI:master Oct 2, 2026
10 of 11 checks passed
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.

attempt to access empty String at index [1:9] process_cov throws BoundsError: attempt to access 8-codeunit String at index [1:9]

2 participants