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

Lock simplecov between 0.10 and 0.13 version #181

Merged
merged 4 commits into from
Mar 20, 2017
Merged

Lock simplecov between 0.10 and 0.13 version #181

merged 4 commits into from
Mar 20, 2017

Conversation

bliof
Copy link
Contributor

@bliof bliof commented Mar 18, 2017

Done because the 0.14.0 version introduces some changes that break the
CodeClimate::TestReporter::Formatter#merge_results
simplecov-ruby/simplecov@a7747c1

Check also:

@bliof
Copy link
Contributor Author

bliof commented Mar 18, 2017

@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
Copy link
Contributor

@maxjacobson maxjacobson left a 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
Copy link
Contributor

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?

Copy link
Contributor Author

@bliof bliof Mar 20, 2017

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`

@@ -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"
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.
@maxjacobson maxjacobson merged commit 9971c7e into codeclimate:master Mar 20, 2017
@bliof bliof deleted the lock-simplecov branch March 20, 2017 21:50
@FranklinYu
Copy link

Will v1.1.x branch in the future support SimpleCov v0.14.x?

@colszowka
Copy link

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 original_result.merge_resultset (although I am not quite sure why this gem needs to deal with resultset merging in the first place, as this is a low-level functionality of simplecov and I'd expect code climate would only need to consume the final (merged) result)

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.

@ale7714
Copy link

ale7714 commented Apr 10, 2017

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.

@FranklinYu
Copy link

@ale7714 The manual page indicates that the unified reporter gets the data from ./coverage/.resultset.json in Ruby projects. Would that JSON format change over time? Should we pin the SimpleCov version? We don't need to worry about that if we're using a gem.

@ale7714
Copy link

ale7714 commented Apr 10, 2017

@FranklinYu that's correct. We're parsing .resulset.json from SimpleCov to a Code Climate payload. For now, it's not needed to pin SimpleCov to a particular version. If we find some issue it require to use a particular version, we will update our docs.
Let me know if you have any other question, also feel free to open issues on the test reporter repo if you find any because we're still on an alpha stage.

@colszowka
Copy link

colszowka commented Apr 11, 2017

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.

@FranklinYu
Copy link

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.

@ale7714
Copy link

ale7714 commented Apr 11, 2017

@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.

@FranklinYu
Copy link

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 cc-simplecov-json (the imaginary formatter name):

bundle exec rake cc:coverage:format
./cc-test-reporter upload-coverage

timbru31 added a commit to timbru31/ruby-test-reporter that referenced this pull request Apr 18, 2017
as per codeclimate#181 (comment), the issue only occurs when using multiple test suites
glebm added a commit to glebm/i18n-tasks that referenced this pull request Jan 18, 2018
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.
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.

5 participants