Add rubocop rule to catch misplaced specs for ee extensions
Description of the proposal
Add rubocop rule to catch misplaced specs for ee extensions
- alert if spec file is misplaced. Enforces https://docs.gitlab.com/development/ee_features/#testing-ee-features-based-on-ce-features
- see #493735 (closed)
# Checks EE spec files for misplaced EE spec files
# in ee/spec/ (but not in ee/spec/*/ee/) should have matching application files.
# See https://docs.gitlab.com/development/ee_features/#testing-ee-features-based-on-ce-features.
#
# @example
# # bad
# ee/spec/models/my_model_spec.rb # When an existing prepended module ee/app/models/ee/my_model.rb
#
# # good
# ee/spec/models/my_model_spec.rb # With matching ee/app/models/my_model.rb
# ee/spec/models/ee/my_model_spec.rb # EE extension specs can have added functionality
# without a matching application file
#
Check-list
-
Make sure this MR enables a static analysis check rule for new usage but ignores current offenses. -
Create a follow-up issue to fix the current offenses as a separate iteration: Resolve Gitlab/RSpec/MisplacedEeSpecFile except... (#543719) -
Follow the review process as usual.
Edited by Doug Stull