Open
Description
with ruby 2.2.1 and simplecov 0.9.2
When i run my test with all gem included in 'vendor/cache' (I use bundle package), I have some encoding error. See full trace bellow. The issue is related to filters because when I delete all my simplecov filters everything goes right. I use continuous integration with jenkins and this error make deployment stop.
I tried to convert the string in UTF-8 but it doesn't work. Finally I manage to bypass my problem by catching this exception (I modified lib/simplecov/default.rb:7
) but I don't know how to write a test for it, or how to solve the encoding problem.
/var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/bundle/ruby/2.2.0/gems/simplecov-0.9.2/lib/simplecov/defaults.rb:7:in `block (2 levels) in <top (required)>': incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string) (Encoding::CompatibilityError)
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/bundle/ruby/2.2.0/gems/simplecov-0.9.2/lib/simplecov/filter.rb:41:in `call'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/bundle/ruby/2.2.0/gems/simplecov-0.9.2/lib/simplecov/filter.rb:41:in `matches?'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/bundle/ruby/2.2.0/gems/simplecov-0.9.2/lib/simplecov.rb:71:in `block (2 levels) in filtered'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/bundle/ruby/2.2.0/gems/simplecov-0.9.2/lib/simplecov.rb:71:in `reject'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/bundle/ruby/2.2.0/gems/simplecov-0.9.2/lib/simplecov.rb:71:in `block in filtered'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/bundle/ruby/2.2.0/gems/simplecov-0.9.2/lib/simplecov.rb:70:in `each'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/bundle/ruby/2.2.0/gems/simplecov-0.9.2/lib/simplecov.rb:70:in `filtered'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/bundle/ruby/2.2.0/gems/simplecov-0.9.2/lib/simplecov/result.rb:78:in `filter!'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/bundle/ruby/2.2.0/gems/simplecov-0.9.2/lib/simplecov/result.rb:31:in `initialize'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/bundle/ruby/2.2.0/gems/simplecov-0.9.2/lib/simplecov.rb:44:in `new'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/bundle/ruby/2.2.0/gems/simplecov-0.9.2/lib/simplecov.rb:44:in `result'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/bundle/ruby/2.2.0/gems/simplecov-0.9.2/lib/simplecov/configuration.rb:158:in `block in at_exit'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/bundle/ruby/2.2.0/gems/simplecov-0.9.2/lib/simplecov/defaults.rb:54:in `call'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/bundle/ruby/2.2.0/gems/simplecov-0.9.2/lib/simplecov/defaults.rb:54:in `block in <top (required)>'
Build step 'Exécuter un script shell' marked build as failure
Warning: you have no plugins providing access control for builds, so falling back to legacy behavior of permitting any downstream builds to be triggered
Finished: FAILURE
/var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/bundle/ruby/2.2.0/gems/coderay-1.1.0/lib/coderay/encoder.rb
/var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace
/var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/bundle/ruby/2.2.0/gems/coderay-1.1.0/lib/coderay/encoders/_map.rb
/var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace
/var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/bundle/ruby/2.2.0/gems/coderay-1.1.0/lib/coderay/encoders/terminal.rb
/var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace
/var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/bundle/ruby/2.2.0/gems/coderay-1.1.0/lib/coderay/helpers/plugin.rb
/var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace
/var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/bundle/ruby/2.2.0/gems/json-1.8.2/lib/json/common.rb:285:in `encode': "\xC3" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/bundle/ruby/2.2.0/gems/json-1.8.2/lib/json/common.rb:285:in `generate'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/bundle/ruby/2.2.0/gems/json-1.8.2/lib/json/common.rb:285:in `pretty_generate'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/vendor/cache/simplecov-678462da5dd6/lib/simplecov/result_merger.rb:81:in `block (2 levels) in store_result'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/vendor/cache/simplecov-678462da5dd6/lib/simplecov/result_merger.rb:80:in `open'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/vendor/cache/simplecov-678462da5dd6/lib/simplecov/result_merger.rb:80:in `block in store_result'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/vendor/cache/simplecov-678462da5dd6/lib/simplecov/result_merger.rb:75:in `open'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/vendor/cache/simplecov-678462da5dd6/lib/simplecov/result_merger.rb:75:in `store_result'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/vendor/cache/simplecov-678462da5dd6/lib/simplecov.rb:60:in `result'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/vendor/cache/simplecov-678462da5dd6/lib/simplecov/configuration.rb:159:in `block in at_exit'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/vendor/cache/simplecov-678462da5dd6/lib/simplecov/defaults.rb:66:in `call'
from /var/lib/jenkins/jobs/data-retriever_01_Préparation/workspace/vendor/cache/simplecov-678462da5dd6/lib/simplecov/defaults.rb:66:in `block in <top (required)>'
Build step 'Exécuter un script shell' marked build as failure
Warning: you have no plugins providing access control for builds, so falling back to legacy behavior of permitting any downstream builds to be triggered
Finished: FAILURE