-
Notifications
You must be signed in to change notification settings - Fork 1
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
[WIP] Code coverage analysis #87
Conversation
Locally with SimpleCov and on Travis CI with Coveralls. Close #81.
Changes Unknown when pulling fedb255 on code-coverage into * on master*. |
@twingly/dev WDYT? |
@@ -1,4 +1,4 @@ | |||
require "spec_helper" | |||
SimpleCov.command_name(File.basename(__FILE__, ".rb")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand what this is/why this is needed – do you have more info?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I should have mentioned it. I has to do that we have split our tests over several different rake tasks and need to merge the results. I got it from https://github.com/colszowka/simplecov#merging-results. I tried doing SimpleCov.command_name = "PID#{Process.pid}"
in spec_helper.rb
, so we shouldn't have to add something to every spec file, but it didn't work well. It saved the results from every run, so it didn't discover regressions in coverage, and the "hits/line" went up on every run.
The command names can be seen in the footer in report:
Generated by simplecov v0.12.0 and simplecov-html v0.10.0
using hasher_spec, null_url_spec, url_spec, utilities_spec
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command names can be seen in the footer in report:
Also in the spec run output: https://travis-ci.org/twingly/twingly-url/jobs/156254738
I commented out all tests in |
Found a similar issue, simplecov-ruby/simplecov#388, which is also using simplecov and coveralls, for a gem project, so I will take a look on what they've done |
Hmm, the comment at simplecov-ruby/simplecov#314 (comment) was somewhat insightful:
I was thinking it might the combination of Example: SimpleCov.command_name(File.basename(__FILE__, ".rb"))
require "twingly/url/hasher" produces: |
@walro what do you think of just ignoring hasher and utilities for now? diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index f84a87a..a4b1734 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -7,6 +7,9 @@ SimpleCov.formatters = [
SimpleCov.start do
add_filter "spec/"
add_filter "vendor/"
+
+ add_filter "hasher.rb"
+ add_filter "utilities.rb"
end
RSpec.configure do |config| |
Hehe, nah. We could add new |
I feel this is quite outdated now, I suspect things have moved forward since, close? |
Outdated how? Sure, there has been a decent amount of changes made since this was started, but our tests are still structured in the same way. |
Well, that's one part. The other part is that the tools have moved forward. Ruby has gained more things natively and so on. I feel that either we give this branch some love or just close it. It's approaching 18 months. |
Sure, it is probably best to start over. I will note here what I think is an issue. Our setup is a bit special in that we run rspec multiple times when we run our spec suite (we started doing this to catch require errors):
Lines 19 to 32 in fedb255
|
Locally with SimpleCov and on Travis CI with Coveralls.
Close #81.