-
Notifications
You must be signed in to change notification settings - Fork 553
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Problem with loading Minitest simplecov plugin #877
Comments
That behavior from I see, I'll make it x days in a row with a bugfix release I guess. I guess wrapping the code we want to trigger in And the scenario is a project with minitest running tests without requiring |
Yeah, it is pretty fun behaviour from I would hope that wrapping the code in |
I'm experiencing the same issue with minitest on the latest version 0.18.4 |
* Fixes #877 * not quire sure whether we should wrap the entire thing in if undefined?(..) or not but since the file has all the right structure otherwise I'm more worried about minitest being weirded out that it doesn't find what it expects than I am of letting it execute an empty method * also yes the version workaround is maybe a bit weird, however I wanted our test suite to reproduce the exact failure case because otherwise it'd be to easy to just implement a respond_to? check which would have everything passing but would fail in real life.
* Fixes #877 * not quire sure whether we should wrap the entire thing in if undefined?(..) or not but since the file has all the right structure otherwise I'm more worried about minitest being weirded out that it doesn't find what it expects than I am of letting it execute an empty method * also yes the version workaround is maybe a bit weird, however I wanted our test suite to reproduce the exact failure case because otherwise it'd be to easy to just implement a respond_to? check which would have everything passing but would fail in real life.
Update ruby-simplecov to 0.18.5. 0.18.5 (2020-02-25) =================== Can you guess? Another bugfix release! ## Bugfixes * minitest won't crash if SimpleCov isn't loaded - aka don't execute SimpleCov code in the minitest plugin if SimpleCov isn't loaded. Thanks to [@edariedl](https://github.com/edariedl) for the report of the peculiar problem in [#877](simplecov-ruby/simplecov#877). 0.18.4 (2020-02-24) =================== Another small bugfix release 🙈 Fixes SimpleCov running with rspec-rails, which was broken due to our fixed minitest integration. ## Bugfixes * SimpleCov will run again correctly when used with rspec-rails. The excellent bug report [#873](simplecov-ruby/simplecov#873) by [@odlp](https://github.com/odlp) perfectly details what went wrong. Thanks to [@adam12](https://github.com/adam12) for the fix [#874](simplecov-ruby/simplecov#874). 0.18.3 (2020-02-23) =========== Small bugfix release. It's especially recommended to upgrade simplecov-html as well because of bugs in the 0.12.0 release. ## Bugfixes * Fix a regression related to file encodings as special characters were missing. Furthermore we now respect the magic `# encoding: ...` comment and read files in the right encoding. Thanks ([@Tietew](https://github.com/Tietew)) - see [#866](simplecov-ruby/simplecov#866) * Use `Minitest.after_run` hook to trigger post-run hooks if `Minitest` is present. See [#756](simplecov-ruby/simplecov#756) and [#855](simplecov-ruby/simplecov#855) thanks ([@adam12](https://github.com/adam12)) 0.18.2 (2020-02-12) =================== Small release just to allow you to use the new simplecov-html. ## Enhancements * Relax simplecov-html requirement so that you're able to use [0.12.0](https://github.com/colszowka/simplecov-html/blob/master/CHANGELOG.md#0120-2020-02-12)
Hi,
I've just updated simplecov to the latest version 0.18.4 in our Rails app (Rails 6.0.2.1 with Minitest 5.14.0, Ruby 2.6.5). We are not loading simplcov every time, but we use the ENV variable to turn it on.
Gemfile configuration:
At the top of our
test_helper.rb
:When I run the tests without
COVERAGE
env variable I get following error:I looked into it a bit, and unfortunately Minitest is loading plugins via
Gem.find_files("minitest/*_plugin.rb")
and it loads plugin files for every gem in the Gemfile even if it is not required in the projetct at a time.I tried to test it in the rails console. First I made sure that simplecov is not required and then I tried to run the
Gem.find_files("minitest/*_plugin.rb")
. As you can seeminitest/simplecov_plugin.rb
was found anyway:Thanks!
The text was updated successfully, but these errors were encountered: