diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-06-30 19:04:00 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-07-21 12:44:24 +0200 |
commit | 070a96f54faac289d9254f0e8735f3926418335c (patch) | |
tree | 4ee7b4b0d3192ee63081c7b54bed19748683d647 | |
parent | 8cc7a2dd6f201019d6848aade74d938db356cc39 (diff) | |
download | gitlab-ce-070a96f54faac289d9254f0e8735f3926418335c.tar.gz |
Update configuration of SimpleCov
-rw-r--r-- | .gitlab-ci.yml | 1 | ||||
-rw-r--r-- | features/support/env.rb | 1 | ||||
-rwxr-xr-x | scripts/merge-simplecov | 4 | ||||
-rw-r--r-- | spec/simplecov_env.rb | 35 | ||||
-rw-r--r-- | spec/spec_helper.rb | 1 |
5 files changed, 26 insertions, 16 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aa22bf688a0..1ca266ef4f1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,6 +28,7 @@ stages: - prepare - test - post-test +- pages # Prepare and merge knapsack tests .knapsack-state: &knapsack-state diff --git a/features/support/env.rb b/features/support/env.rb index 1c39367ad42..16ce1b6ca77 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -1,4 +1,5 @@ require_relative Rails.root.join('spec', 'simplecov_env') +SimpleCov.start if ENV['SIMPLECOV'] ENV['RAILS_ENV'] = 'test' require './config/environment' diff --git a/scripts/merge-simplecov b/scripts/merge-simplecov index b59ff0ae9a0..0d764d2b406 100755 --- a/scripts/merge-simplecov +++ b/scripts/merge-simplecov @@ -58,8 +58,6 @@ def merged_result result end -SimpleCov.configure do - merge_timeout 7200 -end +require_relative '../spec/simplecov_env' merged_result.format! 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' |