simplecov icon indicating copy to clipboard operation
simplecov copied to clipboard

Add method coverage support

Open tycooon opened this issue 5 years ago • 7 comments

See #782. Also addresses #801 and #916. Support for HTML formatter can be found here: https://github.com/simplecov-ruby/simplecov-html/pull/110.

Some notes:

  • I had to rework how coverage is parsed/unparsed (see ResultSerialization module).
  • Because of that, I had to revert some of ResultMerger optimizations :( Now it's operating Result objects, however it still parses and merges files one be one.
  • Coverage is now always stored in memory in symbolized form (lines: [] instead of "lines" => []), just the same way you get it when calling Ruby's Coverage.result. Because of that, a lot of specs were updated.
  • Sometimes method owner includes memory address (e.g. when method is called on anonymous class). This makes merging results from different CI jobs problematic, so we replace memory addresses with zero address 0x0000000000000000.
  • adapt_pre_simplecov_0_18_result logic was moved to ResultSerialization.deserialize. Also old-style branch info is supported (eval is still used for that).

All this stuff has been battle-tested on a couple of big projects, some of which merge results of multiple CI jobs.

tycooon avatar Apr 23 '21 17:04 tycooon

@PragTob hope you will find some time to review the changes.

tycooon avatar Apr 24 '21 11:04 tycooon

Hey @PragTob, maybe you can take a look now?

tycooon avatar Jan 09 '23 08:01 tycooon

@PragTob ping!

pboling avatar Mar 29 '23 21:03 pboling

@PragTob ping!

0exp avatar Dec 20 '23 08:12 0exp