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

Add branch coverage output #19

Merged
merged 1 commit into from
Nov 11, 2020
Merged

Conversation

robotdana
Copy link
Contributor

@robotdana robotdana commented Nov 3, 2020

This will only show if simplecov 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: #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]        |
+----------+---------------------------------------------------+-------+--------+---------+-----------------+----------+-----------------+------------------+

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 merged commit 55ab7b5 into chetan:master Nov 11, 2020
chetan added a commit that referenced this pull request Nov 11, 2020
@chetan
Copy link
Owner

chetan commented Nov 11, 2020

Looks great, thanks @robotdana! I just pushed v0.8

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 this pull request may close these issues.

Branch coverage support
2 participants