diff options
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/simplecov_env.rb | 35 | ||||
| -rw-r--r-- | spec/spec_helper.rb | 1 |
2 files changed, 23 insertions, 13 deletions
diff --git a/spec/simplecov_env.rb b/spec/simplecov_env.rb index a833255d407..956476fd065 100644 --- a/spec/simplecov_env.rb +++ b/spec/simplecov_env.rb @@ -1,18 +1,27 @@ -if ENV['SIMPLECOV'] - require 'simplecov' +require 'simplecov' - SimpleCov.start :rails do - if ENV['CI_BUILD_NAME'] - coverage_dir "coverage/#{ENV['CI_BUILD_NAME']}" - command_name ENV['CI_BUILD_NAME'] - merge_timeout 7200 - end +SimpleCov.configure do + load_profile :rails - add_filter '/vendor/ruby/' + if ENV['CI_BUILD_NAME'] + coverage_dir "coverage/#{ENV['CI_BUILD_NAME']}" + command_name ENV['CI_BUILD_NAME'] + end - add_group 'Services', 'app/services' - add_group 'Finders', 'app/finders' - add_group 'Uploaders', 'app/uploaders' - add_group 'Validators', 'app/validators' + if ENV['CI'] + SimpleCov.at_exit do + # In CI environment don't generate formatted reports + # Only generate .resultset.json + SimpleCov.result + end end + + add_filter '/vendor/ruby/' + + add_group 'Services', 'app/services' + add_group 'Finders', 'app/finders' + add_group 'Uploaders', 'app/uploaders' + add_group 'Validators', 'app/validators' + + merge_timeout 7200 end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 6a882bea571..d2760d0ef28 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,5 @@ require_relative 'simplecov_env' +SimpleCov.start if ENV['SIMPLECOV'] ENV["RAILS_ENV"] ||= 'test' |
