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

Make reporting coverage optional #274

Closed
rski opened this issue Nov 29, 2016 · 8 comments
Closed

Make reporting coverage optional #274

rski opened this issue Nov 29, 2016 · 8 comments

Comments

@rski
Copy link
Member

rski commented Nov 29, 2016

I don't really care about having coverage reports when I'm just trying to get a test working. It might be nice to be able to disable coverage by setting an environment variable like NO_COVERAGE_REPORT to true or something like that.

@rnelson0
Copy link
Member

@rski does bundle exec rspec <filename> address your needs adequately?

@rski
Copy link
Member Author

rski commented Nov 29, 2016

@rnelson0 it still generates a coverage output.
What i'd like to avoid is this, which also happens in smallish terminal windows.
2016-11-29-233317_1267x1048_escrotum

@alexjfisher
Copy link
Member

@rski From that screenshot, the biggest problem seems to be simplecov including vendor gems.

Are you running bundle install in a particular way to get vendor/ruby as your BUNDLE_PATH?
simplecov already defaults to excluding /vendor/bundle/. https://github.com/colszowka/simplecov/blob/a8a8c265e3e64ec56604ba61366d647c851811d9/lib/simplecov/defaults.rb#L44

If that isn't enough, we can add add_filter '/vendor/'here.

@rnelson0
Copy link
Member

Run bundle exec rspec spec/classes/install/gem_spec.rb in r10k module as-is:

Finished in 12.23 seconds (files took 3.79 seconds to load)
78 examples, 0 failures

Coverage report generated for RSpec to /home/rnelson0/voxpupuli/r10k/coverage. 1649 / 4121 LOC (40.01%) covered.

COVERAGE:  40.01% -- 1649/4121 lines in 91 files

showing bottom (worst) 15 of 85 files
+----------+--------------------------------------------+-------+--------+---------------------------------------------+
| coverage | file                                       | lines | missed | missing                                     |
+----------+--------------------------------------------+-------+--------+---------------------------------------------+
|  13.40%  | vendor/ruby/gems/puppet-4.8.0/lib/puppe... | 97    | 84     | 26, 33, 36, 38, 40-41, 44-46, 48, 52, 54... |
|  13.64%  | vendor/ruby/gems/puppet-4.8.0/lib/puppe... | 88    | 76     | 6-7, 9, 12, 17-19, 21, 35-36, 39-41, 43,... |
|  15.38%  | vendor/ruby/gems/puppet-4.8.0/lib/puppe... | 13    | 11     | 4-8, 13-15, 18, 20, 22                      |
|  19.33%  | vendor/ruby/gems/puppet-4.8.0/lib/puppe... | 119   | 96     | 25, 27-28, 30-32, 35-38, 41, 43-44, 46, ... |
|  20.00%  | vendor/ruby/gems/puppet-4.8.0/lib/puppe... | 175   | 140    | 56, 63-65, 70, 75, 79, 82-83, 85-87, 91,... |
|  20.20%  | vendor/ruby/gems/puppet-4.8.0/lib/puppe... | 99    | 79     | 7, 17-19, 22-25, 28-29, 34, 37-39, 43-47... |
|  21.25%  | vendor/ruby/gems/puppet-4.8.0/lib/puppe... | 80    | 63     | 21, 23-24, 26, 28-29, 31-32, 35-38, 40, ... |
|  21.85%  | vendor/ruby/gems/puppet-4.8.0/lib/puppe... | 119   | 93     | 20, 29-30, 48, 50-52, 55-56, 70-73, 75, ... |
|  22.22%  | vendor/ruby/gems/puppet-4.8.0/lib/puppe... | 108   | 84     | 32, 36, 39, 41, 43, 45, 47, 52-53, 58-59... |
|  22.39%  | vendor/ruby/gems/puppet-4.8.0/lib/puppe... | 134   | 104    | 30-32, 34, 42-43, 45, 48-49, 58, 61-63, ... |
|  22.58%  | vendor/ruby/gems/puppet-4.8.0/lib/puppe... | 62    | 48     | 19, 23-24, 27, 31, 33, 36-37, 39-40, 43,... |
|  22.97%  | vendor/ruby/gems/puppet-4.8.0/lib/puppe... | 74    | 57     | 48-52, 57-58, 63, 65-67, 72-74, 77-78, 8... |
|  23.47%  | vendor/ruby/gems/puppet-4.8.0/lib/puppe... | 98    | 75     | 29, 40, 42, 44, 46, 48, 51, 53, 55, 69, ... |
|  23.81%  | vendor/ruby/gems/puppet-4.8.0/lib/puppe... | 42    | 32     | 16, 18-20, 26, 28-29, 31, 33, 35, 37, 40... |
|  24.59%  | vendor/ruby/gems/puppet-4.8.0/lib/puppe... | 61    | 46     | 30-34, 39-40, 45-49, 54-62, 64-65, 69-71... |
+----------+--------------------------------------------+-------+--------+---------------------------------------------+
6 file(s) with 100% coverage not shown
[Coveralls] Outside the CI environment, not sending data.

Add add_filter 'vendor' (no need for leading slash I don't think) and it changes to:

Finished in 11.46 seconds (files took 4.08 seconds to load)
78 examples, 0 failures

Coverage report generated for RSpec to /home/rnelson0/voxpupuli/r10k/coverage. 0.0 / 0.0 LOC (100.0%) covered.

COVERAGE: 100.00% -- 0.0/0.0 lines in 0 files

It doesn't stop the coverage report entirely, but I believe addresses the main issue which is junk data. @rski comments?

@rski
Copy link
Member Author

rski commented Nov 30, 2016

Yup, cool. This needs to be fixed in the modulesync_config or?

@bastelfreak
Copy link
Member

yep

@rnelson0
Copy link
Member

Dang, I was working off an earlier version of modulesync. Here's what happens if I add it to the current setup:

Finished in 12.03 seconds (files took 3.74 seconds to load)
78 examples, 0 failures

Coverage report generated for RSpec to /home/rnelson0/voxpupuli/r10k/coverage. 0 / 12 LOC (0.0%) covered.

COVERAGE:   0.00% -- 0/12 lines in 2 files

+----------+--------------------------------+-------+--------+---------+
| coverage | file                           | lines | missed | missing |
+----------+--------------------------------+-------+--------+---------+
|   0.00%  | lib/facter/r10k_environment.rb | 6     | 6      | 1-6     |
|   0.00%  | lib/facter/r10k_path.rb        | 6     | 6      | 1-6     |
+----------+--------------------------------+-------+--------+---------+
[Coveralls] Outside the CI environment, not sending data.

I still think that's better.

@rski
Copy link
Member Author

rski commented Nov 30, 2016

Ah right ok I was working on an earlier msync as well. So we just need to msync puppet-network, cool.

@rski rski closed this as completed Nov 30, 2016
rnelson0 added a commit that referenced this issue Nov 30, 2016
@rski rski reopened this Nov 30, 2016
rnelson0 added a commit that referenced this issue Nov 30, 2016
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

No branches or pull requests

4 participants