diff options
Diffstat (limited to 'lib/quality')
-rw-r--r-- | lib/quality/test_level.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/quality/test_level.rb b/lib/quality/test_level.rb index cd94efddc1e..b239b6812ca 100644 --- a/lib/quality/test_level.rb +++ b/lib/quality/test_level.rb @@ -12,6 +12,9 @@ module Quality lib/gitlab/background_migration lib/ee/gitlab/background_migration ], + frontend_fixture: %w[ + frontend/fixtures + ], unit: %w[ bin channels @@ -63,7 +66,7 @@ module Quality end def pattern(level) - @patterns[level] ||= "#{prefix}spec/#{folders_pattern(level)}{,/**/}*_spec.rb" + @patterns[level] ||= "#{prefix}spec/#{folders_pattern(level)}{,/**/}*#{suffix(level)}" end def regexp(level) @@ -76,6 +79,9 @@ module Quality # spec/lib/gitlab/background_migration and tests under spec/lib are unit by default when regexp(:migration), regexp(:background_migration) :migration + # Detect frontend fixture before matching other unit tests + when regexp(:frontend_fixture) + :frontend_fixture when regexp(:unit) :unit when regexp(:integration) @@ -93,6 +99,15 @@ module Quality private + def suffix(level) + case level + when :frontend_fixture + ".rb" + else + "_spec.rb" + end + end + def migration_and_background_migration_folders TEST_LEVEL_FOLDERS.fetch(:migration) + TEST_LEVEL_FOLDERS.fetch(:background_migration) end |