Commit 07a6697c authored by Rémy Coutable's avatar Rémy Coutable

Don't include migrations files in the unit test level pattern

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 97b65561
...@@ -5,6 +5,10 @@ module Quality ...@@ -5,6 +5,10 @@ module Quality
UnknownTestLevelError = Class.new(StandardError) UnknownTestLevelError = Class.new(StandardError)
TEST_LEVEL_FOLDERS = { TEST_LEVEL_FOLDERS = {
migration: %w[
migrations
lib/gitlab/background_migration
],
unit: %w[ unit: %w[
bin bin
config config
...@@ -19,7 +23,6 @@ module Quality ...@@ -19,7 +23,6 @@ module Quality
initializers initializers
javascripts javascripts
lib lib
migrations
models models
policies policies
presenters presenters
...@@ -36,10 +39,6 @@ module Quality ...@@ -36,10 +39,6 @@ module Quality
workers workers
elastic_integration elastic_integration
], ],
migration: %w[
migrations
lib/gitlab/background_migration
],
integration: %w[ integration: %w[
controllers controllers
mailers mailers
......
...@@ -21,7 +21,7 @@ RSpec.describe Quality::TestLevel do ...@@ -21,7 +21,7 @@ RSpec.describe Quality::TestLevel do
context 'when level is unit' do context 'when level is unit' do
it 'returns a pattern' do it 'returns a pattern' do
expect(subject.pattern(:unit)) expect(subject.pattern(:unit))
.to eq("spec/{bin,config,db,dependencies,factories,finders,frontend,graphql,haml_lint,helpers,initializers,javascripts,lib,migrations,models,policies,presenters,rack_servers,routing,rubocop,serializers,services,sidekiq,tasks,uploaders,validators,views,workers,elastic_integration}{,/**/}*_spec.rb") .to eq("spec/{bin,config,db,dependencies,factories,finders,frontend,graphql,haml_lint,helpers,initializers,javascripts,lib,models,policies,presenters,rack_servers,routing,rubocop,serializers,services,sidekiq,tasks,uploaders,validators,views,workers,elastic_integration}{,/**/}*_spec.rb")
end end
end end
...@@ -82,7 +82,7 @@ RSpec.describe Quality::TestLevel do ...@@ -82,7 +82,7 @@ RSpec.describe Quality::TestLevel do
context 'when level is unit' do context 'when level is unit' do
it 'returns a regexp' do it 'returns a regexp' do
expect(subject.regexp(:unit)) expect(subject.regexp(:unit))
.to eq(%r{spec/(bin|config|db|dependencies|factories|finders|frontend|graphql|haml_lint|helpers|initializers|javascripts|lib|migrations|models|policies|presenters|rack_servers|routing|rubocop|serializers|services|sidekiq|tasks|uploaders|validators|views|workers|elastic_integration)}) .to eq(%r{spec/(bin|config|db|dependencies|factories|finders|frontend|graphql|haml_lint|helpers|initializers|javascripts|lib|models|policies|presenters|rack_servers|routing|rubocop|serializers|services|sidekiq|tasks|uploaders|validators|views|workers|elastic_integration)})
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment