-
Notifications
You must be signed in to change notification settings - Fork 92
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
Lock simplecov between 0.10 and 0.13 version #181
Conversation
@gordondiggs follow-up from #180 |
Done because the 0.14.0 version introduces some changes that break the `CodeClimate::TestReporter::Formatter#merge_results` simplecov-ruby/simplecov@a7747c1 Check also: * SimpleCov::Result - https://github.com/colszowka/simplecov/blob/v0.14.0/lib/simplecov/result.rb * SimpleCov::RawCoverage - https://github.com/colszowka/simplecov/blob/v0.14.0/lib/simplecov/raw_coverage.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.
Hi @bliof, thanks for this PR and very good catch.
@@ -1,5 +1,5 @@ | |||
module CodeClimate | |||
module TestReporter | |||
VERSION = "1.0.7".freeze | |||
VERSION = "1.0.8".freeze |
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.
No need to update this file in this PR. Will you instead update the changelog?
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.
Feel free to edit the PR as you wish. There is some date in the changelog that is most probably the one for when the version is released.
Lock simplecov to supported versions `>= 0.10` and `<= 0.13`
codeclimate-test-reporter.gemspec
Outdated
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec| | |||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }.reject { |f| f == "ci" } | |||
|
|||
spec.required_ruby_version = ">= 1.9" | |||
spec.add_runtime_dependency "simplecov" | |||
spec.add_runtime_dependency "simplecov", ">= 0.10", "<= 0.13" |
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.
This looks good. I just want to confirm: is the minimum version number also necessary because that's when this method was introduced?
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.
No idea. I just tried - commit with locked version - with 0.10, 0.11, 0.12, and 0.13.
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.
OK - I'm going to update to remove the minimum check, but keep the maximum check. I think that's the smallest change to address the current issue.
Our process is to make changes like this while preparing a new release.
Will v1.1.x branch in the future support SimpleCov v0.14.x? |
Hey there, It'd be very nice if this bug could be actually fixed instead of pinning to an outdated version of SimpleCov ❤️ The underlying change in SimpleCov is the replacement of Hash and Array core extensions with utility methods that do this, see the related PR that introduced the change It should be fairly easy to change this gem's code to use the new API, swapping the old call to As a side note, this issue only arises when running multiple test suites (i.e. rspec and cucumber). On an app I am currently working on, we had no problems running codeclimate with SimpleCov 0.14. |
Hi @colszowka, thank you for your feedback! Currently we're working on a new unified test reporter that will support multiple coverage report formats and parallelized reporting. This new reporter don't rely on low-level functionality of SimpleCov and instead consumes the final result. We're focusing most of our development efforts on this new tool. It's currently on alpha and we're currently using it with the last version of SimpleCov successfully. I recommend users of SimpleCov v0.14.x to review and try our new test reporter. |
@ale7714 The manual page indicates that the unified reporter gets the data from |
@FranklinYu that's correct. We're parsing |
Thanks for the pointer @ale7714, I will try out the new reporter. I would not advise towards using the resultset.json file since it's an internal cache only meant for simplecov's merging mechanism and you're therefore betting yourselves on an internal data structure. I also would really not like pinning to a particular version of simplecov again later down the road when the approach of using an internal cache file turns out to fail. I would strongly recommend that you build your own simplecov formatter (it's easy). I don't know if it's fully functional, but https://github.com/vicentllongo/simplecov-json might be a good starting point. This way you can vendorize your dependency on json output from simplecov and guard your customers against pinning potentially buggy and outdated versions. Disclaimer: I'm the author of simplecov. |
I agree with @colszowka. Depending on private interface is always fragile, and I don't think customers would be happy about that. There may be a time gap between SimpleCov release a new version and your team update the documentation; if a customer updates his SimpleCov during this gap, he/she is under risk that he/she can't be aware of. Since the unified reporter is still in early stage (there's only a single alpha release), it's time to make the switch before it's too late. |
@colszowka thank you for your input! I appreciate it. I will review more about implementing our own simplecov formatter. I will bring your recommendations to the team. |
The current (low-level) workflow of the unified reporter, for non-parallel build, is ./cc-test-reporter format-coverage
./cc-test-reporter upload-coverage It seems easy to just replace the first step with a Rake task provided by bundle exec rake cc:coverage:format
./cc-test-reporter upload-coverage |
as per codeclimate#181 (comment), the issue only occurs when using multiple test suites
They depend on internal APIs, see: codeclimate/ruby-test-reporter#180 codeclimate/ruby-test-reporter#181 This is a second rewrite of their test reporter but they don't plan on fixing this bug because they are working on the third rewrite... I'm tired of having to deal with CodeClimate breakages on all my projects so I'll be moving away from it. If you know a good alternative, **well-written**, with support for aggregating multiple test suites, please comment on this commit message.
Done because the 0.14.0 version introduces some changes that break the
CodeClimate::TestReporter::Formatter#merge_results
simplecov-ruby/simplecov@a7747c1
Check also: