Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch coverage support #18

Closed
rmacklin opened this issue Nov 1, 2020 · 1 comment · Fixed by #19
Closed

Branch coverage support #18

rmacklin opened this issue Nov 1, 2020 · 1 comment · Fixed by #19

Comments

@rmacklin
Copy link

rmacklin commented Nov 1, 2020

simplecov supports measuring branch coverage in addition to line coverage:
https://github.com/simplecov-ruby/simplecov/tree/818bc2547842a90c607b4fec834320766a8686de#branch-coverage-ruby--25

It seems like this formatter currently displays line coverage results but not branch coverage results. Would it be valuable to explicitly mention this in the README? Or, have you thought about supporting branch coverage?

robotdana added a commit to robotdana/simplecov-console that referenced this issue Nov 3, 2020
This will only show if simlpecov is recording branch coverage, otherwise
the output is unchanged

The output does look kinda awkward and busy, but all i care about is
actually being able to see output from CI without having to set up some
kind of artifact hosting for the coverage/index.html

fixes: chetan#18

example output:

Passing:
```
COVERAGE: 100.00% -- 1743/1743 lines in 108 files
BRANCH COVERAGE: 100.00% -- 434/434 branches in 108 branches
```

Failing (block format):
```
COVERAGE: 100.00% -- 1743/1743 lines in 108 files
BRANCH COVERAGE:  99.77% -- 434/435 branches in 108 branches

    file: lib/leftovers/config_validator/error_processor.rb
coverage: 100.00% (96/96 lines)
  missed:
branches: 96.97% (32/33 branches)
  missed: 112[else]
```

Failing (table format):
```
COVERAGE: 100.00% -- 1743/1743 lines in 108 files
BRANCH COVERAGE:  99.77% -- 434/435 branches in 108 branches

+----------+---------------------------------------------------+-------+--------+---------+-----------------+----------+-----------------+------------------+
| coverage | file                                              | lines | missed | missing | branch coverage | branches | branches missed | branches missing |
+----------+---------------------------------------------------+-------+--------+---------+-----------------+----------+-----------------+------------------+
| 100.00%  | lib/leftovers/config_validator/error_processor.rb | 96    | 0      |         |  96.97%         | 33       | 1               | 112[else]        |
+----------+---------------------------------------------------+-------+--------+---------+-----------------+----------+-----------------+------------------+
```
@chetan chetan closed this as completed in 55ab7b5 Nov 11, 2020
@chetan
Copy link
Owner

chetan commented Nov 11, 2020

@rmacklin just pushed v0.8 with branch support. Let me know if you see any issues

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 a pull request may close this issue.

2 participants