diff options
Diffstat (limited to 'spec/support/rspec.rb')
-rw-r--r-- | spec/support/rspec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/support/rspec.rb b/spec/support/rspec.rb index 71dfc3fd5a3..ff0b5bebe33 100644 --- a/spec/support/rspec.rb +++ b/spec/support/rspec.rb @@ -8,6 +8,8 @@ require_relative "helpers/stub_object_storage" require_relative "helpers/stub_env" require_relative "helpers/fast_rails_root" +require_relative "../../lib/gitlab/utils" + RSpec::Expectations.configuration.on_potential_false_positives = :raise RSpec.configure do |config| @@ -35,4 +37,13 @@ RSpec.configure do |config| config.include StubObjectStorage config.include StubENV config.include FastRailsRoot + + warn_missing_feature_category = Gitlab::Utils.to_boolean(ENV['RSPEC_WARN_MISSING_FEATURE_CATEGORY'], default: true) + + # Add warning for example missing feature_category + config.before do |example| + if warn_missing_feature_category && example.metadata[:feature_category].blank? && !ENV['CI'] + warn "Missing metadata feature_category: #{example.location} See https://docs.gitlab.com/ee/development/testing_guide/best_practices.html#feature-category-metadata" + end + end end |