summaryrefslogtreecommitdiff
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2019-04-18 22:08:04 +0200
committerRémy Coutable <remy@rymai.me>2019-05-20 14:31:58 +0200
commit4d9c76e9e44119ee2578c94b2b98bb72e80e874b (patch)
tree441a0b95536a35959f237c487cfba44f5dbdd7ed /spec/spec_helper.rb
parent27d207bd8fa0ca095f4008fbcc62c0b924b8c405 (diff)
downloadgitlab-ce-4d9c76e9e44119ee2578c94b2b98bb72e80e874b.tar.gz
Reorganize test jobs by levelreorganize-tests-jobs-by-level
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 69589c9aa33..390a869d93f 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -44,6 +44,8 @@ Dir[Rails.root.join("spec/support/shared_contexts/*.rb")].each { |f| require f }
Dir[Rails.root.join("spec/support/shared_examples/*.rb")].each { |f| require f }
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
+quality_level = Quality::TestLevel.new
+
RSpec.configure do |config|
config.use_transactional_fixtures = false
config.use_instantiated_fixtures = false
@@ -55,9 +57,10 @@ RSpec.configure do |config|
config.infer_spec_type_from_file_location!
config.full_backtrace = !!ENV['CI']
- config.define_derived_metadata(file_path: %r{/spec/}) do |metadata|
+ config.define_derived_metadata(file_path: %r{(ee)?/spec/.+_spec\.rb\z}) do |metadata|
location = metadata[:location]
+ metadata[:level] = quality_level.level_for(location)
metadata[:api] = true if location =~ %r{/spec/requests/api/}
# do not overwrite type if it's already set