Update configuration of SimpleCov

This commit is contained in:
Kamil Trzcinski 2016-06-30 19:04:00 +02:00 committed by Grzegorz Bizon
parent 8cc7a2dd6f
commit 070a96f54f
5 changed files with 27 additions and 17 deletions

View file

@ -28,6 +28,7 @@ stages:
- prepare - prepare
- test - test
- post-test - post-test
- pages
# Prepare and merge knapsack tests # Prepare and merge knapsack tests
.knapsack-state: &knapsack-state .knapsack-state: &knapsack-state

View file

@ -1,4 +1,5 @@
require_relative Rails.root.join('spec', 'simplecov_env') require_relative Rails.root.join('spec', 'simplecov_env')
SimpleCov.start if ENV['SIMPLECOV']
ENV['RAILS_ENV'] = 'test' ENV['RAILS_ENV'] = 'test'
require './config/environment' require './config/environment'

View file

@ -58,8 +58,6 @@ def merged_result
result result
end end
SimpleCov.configure do require_relative '../spec/simplecov_env'
merge_timeout 7200
end
merged_result.format! merged_result.format!

View file

@ -1,18 +1,27 @@
if ENV['SIMPLECOV'] require 'simplecov'
require 'simplecov'
SimpleCov.start :rails do SimpleCov.configure do
if ENV['CI_BUILD_NAME'] load_profile :rails
coverage_dir "coverage/#{ENV['CI_BUILD_NAME']}"
command_name ENV['CI_BUILD_NAME']
merge_timeout 7200
end
add_filter '/vendor/ruby/' if ENV['CI_BUILD_NAME']
coverage_dir "coverage/#{ENV['CI_BUILD_NAME']}"
add_group 'Services', 'app/services' command_name ENV['CI_BUILD_NAME']
add_group 'Finders', 'app/finders'
add_group 'Uploaders', 'app/uploaders'
add_group 'Validators', 'app/validators'
end end
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 end

View file

@ -1,4 +1,5 @@
require_relative 'simplecov_env' require_relative 'simplecov_env'
SimpleCov.start if ENV['SIMPLECOV']
ENV["RAILS_ENV"] ||= 'test' ENV["RAILS_ENV"] ||= 'test'