Skip to content

Let's report actionable minimum numbers for Branch Coverage #1115

Open
@corsonknowles

Description

@corsonknowles

Currently, simplecov is rounding up when delivering branch coverage results. If we then set minimum branch coverage to the reported amount, the next spec run will fail.

Example:

Line Coverage: 100.0% (3486 / 3486)
Branch Coverage: 98.2% (763 / 777)
Running RuboCop...
Inspecting 281 files

763 / 777 = 0.98198198198

So the ideal number for the report would be 98.19, i.e. the floor of the 2nd decimal place.

Running specs with 98.19 will pass, as expected.

gem list simplecov

*** LOCAL GEMS ***

simplecov (0.22.0)
simplecov-html (0.13.1, 0.12.3)
simplecov_json_formatter (0.1.4)

Reproduction steps:
Set up Rubocop RSpec

Run bundle exec rake

Check out this branch if you want to reproduce with the exact coverage metrics described here:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions