simplecov-ruby / simplecov

Code coverage for Ruby with a powerful configuration library and automatic merging of coverage across test suites
MIT License
4.78k stars 553 forks source link

Fix Ruby 3.4.0 branch coverage #1113

Open bkuhlmann opened 2 weeks ago

bkuhlmann commented 2 weeks ago

Why

Hello. :wave: With Ruby 3.4.0, Preview 2, I'm experiencing the following issue when running my RSpec test suite:

Assertion failed: (cursor >= list->start), function pm_newline_list_line_column, file pm_newline_list.c, line 93.
Abort trap: 6

How

To reproduce, run the following:

git clone https://github.com/bkuhlmann/core.git
cd core
bundle install
rspec

As a workaround, you can make SimpleCov work by doing the following:

  1. Within the core project directory, open spec/spec_helper.rb in your editor.
  2. Delete this line: enable_coverage :branch.
  3. Delete this line: minimum_coverage_by_file line: 95, branch: 95
  4. Save and exit your editor and then run: rspec

Notice the entire test suite runs as expected and there are no errors reported.

The issue seems to be with enabling branch coverage in Ruby 3.4.0. All of this works fine in Ruby 3.3.0, though.

Notes

Here's what I'm running:

Earlopain commented 1 week ago

This seems to be a ruby bug, I openend https://bugs.ruby-lang.org/issues/20866

bkuhlmann commented 1 week ago

Ah, thanks. :bow: Will track on Ruby Issues as well.