Defect #33044

SimpleCov 0.18.3 causes NameError during tests

Added by Go MAEDA 3 months ago. Updated 3 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Gems support
Target version:-
Resolution:Fixed Affected version:

Description

I observed the following error when running tests after updating SimpleCov from 0.18.2 to 0.18.3.

$ bin/rails test test/functional/email_addresses_controller_test.rb
Run options: --seed 4397

# Running:

................

Finished in 4.072047s, 3.9292 runs/s, 10.8054 assertions/s.
16 runs, 44 assertions, 0 failures, 0 errors, 0 skips
Traceback (most recent call last):
    2: from /Users/maeda/redmines/gems/ruby/2.6.0/gems/minitest-5.14.0/lib/minitest.rb:64:in `block (2 levels) in autorun'
    1: from /Users/maeda/redmines/gems/ruby/2.6.0/gems/minitest-5.14.0/lib/minitest.rb:64:in `reverse_each'
/Users/maeda/redmines/gems/ruby/2.6.0/gems/simplecov-0.18.3/lib/minitest/simplecov_plugin.rb:8:in `block in plugin_simplecov_init': uninitialized constant Minitest::SimpleCov (NameError)

Related issues

Related to Redmine - Patch #32950: Update simplecov to 0.18 Closed

Associated revisions

Revision 19529
Added by Go MAEDA 3 months ago

Test failure with SimpleCov 0.18.3 or 0.18.4 (#32950, #33044).

History

#1 Updated by Go MAEDA 3 months ago

The issue is not yet fixed in SimpleCov 0.18.4.

#2 Updated by Go MAEDA 3 months ago

You don't see the error if the following change is applied (it is just a workaround. I don't intend to commit the change as is. I think more deep inspection is needed).

diff --git a/test/test_helper.rb b/test/test_helper.rb
index b3956e9af..10f8f52fd 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -17,8 +17,8 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

+require 'simplecov'
 if ENV["COVERAGE"]
-  require 'simplecov'
   require File.expand_path(File.dirname(__FILE__) + "/coverage/html_formatter")
   SimpleCov.formatter = Redmine::Coverage::HtmlFormatter
   SimpleCov.start 'rails'

#4 Updated by Mizuki ISHIKAWA 3 months ago

Version 0.18.5 of simplecov has been released.
I confirmed that there was no problem with that version.

#5 Updated by Go MAEDA 3 months ago

#6 Updated by Go MAEDA 3 months ago

  • Status changed from New to Closed
  • Resolution set to Fixed

Updated Gemfile not to use Simplecov 0.18.4 or earlier.

Also available in: Atom PDF