simplecov icon indicating copy to clipboard operation
simplecov copied to clipboard

Support for "diff coverage"

Open deivid-rodriguez opened this issue 5 years ago • 4 comments

The only codeclimate feature that I think it's not provided by default in simplecov is "diff coverage", namely, the ability to track the coverage of a set of source control changes, and to enforce restrictions on it.

For example, check that a given patch cannot have less that 50% coverage, which would mean that at least half of the lines being added or changed would need to be hit by tests.

Not sure if adding support for this inside simplecov could couple it too much with source control systems. Maybe a first step that does not require any knowledge about git would be to, given a coverage report, allow to query information about the partial coverage of a given set of { file_name, line_number } duples. I think that would simplify implementing diff coverage inside a plugin or something like that.

Thoughts?

deivid-rodriguez avatar Apr 12 '20 17:04 deivid-rodriguez

Hey @deivid-rodriguez !

Definitey it'd be a great feature - not sure I'd wanna solve it inside simplecov.

I'll loop in @grodowski as he reached out to me some time ago about his undercover which takes care of exactly that problem iirc.

I like your proposed interface as it takes care of a significant chunk of the problem to the best of my understanding while not relying on VCS information. The latter of which I really wouldn't wanna have in simplecov core - we have way too many integrations as is.

PragTob avatar Apr 14 '20 19:04 PragTob

Nice, I didn't know about undercover, I'll have a look at it!

deivid-rodriguez avatar Apr 14 '20 19:04 deivid-rodriguez

@deivid-rodriguez are you happy with what you found? :)

PragTob avatar Jun 23 '20 18:06 PragTob

I never got to dig into this anymore :disappointed:

deivid-rodriguez avatar Jun 23 '20 18:06 deivid-rodriguez