Project

General

Profile

Actions

Feature #30963

closed

Update simplecov gem (~> 0.17.0)

Feature #30963: Update simplecov gem (~> 0.17.0)

Added by Go MAEDA over 7 years ago. Updated over 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Gems support
Target version:
Resolution:
Fixed

Description

simplecov 0.16.1 has been released on 2018-03-16.


Related issues 1 (0 open — 1 closed)

Related to Redmine - Defect #30967: "rake test:coverage" fails in Ruby 2.5 and 2.6ClosedGo MAEDAActions

Updated by Go MAEDA over 7 years ago Actions #1

  • Tracker changed from Defect to Feature

Updated by Go MAEDA over 7 years ago Actions #2

I encountered the following error while running bin/rake test:coverage with simplecov 0.16.1.

Traceback (most recent call last):
    10: from /Users/maeda/redmines/gems/ruby/2.6.0/gems/simplecov-0.16.1/lib/simplecov/defaults.rb:27:in `block in <top (required)>'
     9: from /Users/maeda/redmines/gems/ruby/2.6.0/gems/simplecov-0.16.1/lib/simplecov.rb:200:in `run_exit_tasks!'
     8: from /Users/maeda/redmines/gems/ruby/2.6.0/gems/simplecov-0.16.1/lib/simplecov/configuration.rb:182:in `block in at_exit'
     7: from /Users/maeda/redmines/gems/ruby/2.6.0/gems/simplecov-0.16.1/lib/simplecov/result.rb:48:in `format!'
     6: from /Users/maeda/redmines/redmine-trunk/test/coverage/html_formatter.rb:29:in `format'
     5: from /Users/maeda/redmines/redmine-trunk/test/coverage/html_formatter.rb:29:in `each'
     4: from /Users/maeda/redmines/redmine-trunk/test/coverage/html_formatter.rb:30:in `block in format'
     3: from /Users/maeda/redmines/redmine-trunk/test/coverage/html_formatter.rb:30:in `open'
     2: from /Users/maeda/redmines/redmine-trunk/test/coverage/html_formatter.rb:31:in `block (2 levels) in format'
     1: from /Users/maeda/redmines/redmine-trunk/test/coverage/html_formatter.rb:31:in `puts'
/Users/maeda/redmines/redmine-trunk/test/coverage/html_formatter.rb:31:in `write': "\xC5" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)

Updated by Go MAEDA over 7 years ago Actions #3

The error described in #30963#note-1 occurs while processing app/models/repository/git.rb line 3 ('ŋ') or lib/redmine/search.rb line 63 ('汉').

The following change will fixes the error.

Index: Gemfile
===================================================================
--- Gemfile    (リビジョン 17927)
+++ Gemfile    (作業コピー)
@@ -79,7 +79,7 @@
 group :test do
   gem "rails-dom-testing" 
   gem "mocha" 
-  gem "simplecov", "~> 0.14.1", :require => false
+  gem "simplecov", "~> 0.16.1", :require => false
   # For running system tests
   gem 'puma', '~> 3.7'
   gem "capybara", '~> 2.13'
Index: test/coverage/html_formatter.rb
===================================================================
--- test/coverage/html_formatter.rb    (リビジョン 17927)
+++ test/coverage/html_formatter.rb    (作業コピー)
@@ -28,7 +28,7 @@
         end
         result.source_files.each do |source_file|
           File.open(File.join(output_path, source_file_result(source_file)), "w") do |file|
-            file.puts template('source').result(binding)
+            file.puts template('source').result(binding).force_encoding('utf-8')
           end
         end
       end

Updated by Go MAEDA over 7 years ago Actions #4

  • Target version changed from Candidate for next major release to 4.1.0

I found that the error I wrote in #30963#note-1 depends on the version of Ruby. You will see the error if you run rake test:coverage in Ruby 2.5 or 2.6. The error is reproducible with not only the latest SimpleCov 0.16 but also 0.14.1 (the version specified in the current Gemfile).

I confirmed that SimpleCov 0.16.1 passes all tests and generates the coverage report without any error in Ruby 2.3 and 2.4.

In conclusion, we can update SimpleCov to 0.16.1 safely. The problem I reported in #30963#note-1 is another problem and should be handled separately. I have opened a new issue #30967 for the problem.

Updated by Go MAEDA over 7 years ago Actions #5

  • Related to Defect #30967: "rake test:coverage" fails in Ruby 2.5 and 2.6 added

Updated by Go MAEDA over 7 years ago Actions #6

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed.

Updated by Go MAEDA over 7 years ago Actions #7

  • Status changed from Closed to Reopened

Updated by Go MAEDA over 7 years ago Actions #8

  • Subject changed from Update simplecov gem (~> 0.16.1) to Update simplecov gem (~> 0.17.0)
  • Status changed from Reopened to Closed

Updated SimpleCov to 0.17.0 in r18370.

Actions

Also available in: PDF Atom