summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-06-30 18:54:03 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-07-21 12:44:24 +0200
commit8cc7a2dd6f201019d6848aade74d938db356cc39 (patch)
tree1e91ae5415fdef0086a8f577bea705b46e11aac5
parent2d3978842cb1742d1c974fa57c29b6508a365c24 (diff)
downloadgitlab-ce-8cc7a2dd6f201019d6848aade74d938db356cc39.tar.gz
Store all simplecov configuration in one file
-rw-r--r--.gitlab-ci.yml4
-rw-r--r--features/support/env.rb12
-rw-r--r--spec/simplecov_env.rb18
-rw-r--r--spec/spec_helper.rb12
4 files changed, 24 insertions, 22 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4814cbe4ae7..aa22bf688a0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -40,6 +40,7 @@ stages:
paths:
- knapsack/
artifacts:
+ expire_in: 31d
paths:
- knapsack/
@@ -70,6 +71,7 @@ update-coverage:
script:
- bundle exec scripts/merge-simplecov
artifacts:
+ expire_in: 31d
paths:
- coverage/
@@ -93,6 +95,7 @@ update-coverage:
- cp knapsack/rspec_report.json ${KNAPSACK_REPORT_PATH}
- knapsack rspec
artifacts:
+ expire_in: 31d
paths:
- knapsack/
- coverage/
@@ -110,6 +113,7 @@ update-coverage:
- cp knapsack/spinach_report.json ${KNAPSACK_REPORT_PATH}
- knapsack spinach "-r rerun" || retry '[ ! -e tmp/spinach-rerun.txt ] || bundle exec spinach -r rerun $(cat tmp/spinach-rerun.txt)'
artifacts:
+ expire_in: 31d
paths:
- knapsack/
- coverage/
diff --git a/features/support/env.rb b/features/support/env.rb
index c1cfabd0d6a..1c39367ad42 100644
--- a/features/support/env.rb
+++ b/features/support/env.rb
@@ -1,14 +1,4 @@
-if ENV['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
- end
-end
+require_relative Rails.root.join('spec', 'simplecov_env')
ENV['RAILS_ENV'] = 'test'
require './config/environment'
diff --git a/spec/simplecov_env.rb b/spec/simplecov_env.rb
new file mode 100644
index 00000000000..a833255d407
--- /dev/null
+++ b/spec/simplecov_env.rb
@@ -0,0 +1,18 @@
+if ENV['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
+
+ add_filter '/vendor/ruby/'
+
+ add_group 'Services', 'app/services'
+ add_group 'Finders', 'app/finders'
+ add_group 'Uploaders', 'app/uploaders'
+ add_group 'Validators', 'app/validators'
+ end
+end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 72076258dcf..6a882bea571 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,14 +1,4 @@
-if ENV['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
- end
-end
+require_relative 'simplecov_env'
ENV["RAILS_ENV"] ||= 'test'