summaryrefslogtreecommitdiff
path: root/spec/simplecov_env.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-06-30 19:04:00 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-07-21 12:44:24 +0200
commit070a96f54faac289d9254f0e8735f3926418335c (patch)
tree4ee7b4b0d3192ee63081c7b54bed19748683d647 /spec/simplecov_env.rb
parent8cc7a2dd6f201019d6848aade74d938db356cc39 (diff)
downloadgitlab-ce-070a96f54faac289d9254f0e8735f3926418335c.tar.gz
Update configuration of SimpleCov
Diffstat (limited to 'spec/simplecov_env.rb')
-rw-r--r--spec/simplecov_env.rb35
1 files changed, 22 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