summaryrefslogtreecommitdiff
path: root/lib/quality
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2019-05-22 11:45:46 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2019-05-22 11:45:46 +0000
commit4f20c9de6f8e09131d751174243214d9bd3b6419 (patch)
treeb41332bd3773178776ff92738de8cff3f84fc689 /lib/quality
parentc4d930e5f54e7da07c80cc028dfc0f5c08719146 (diff)
downloadgitlab-ce-4f20c9de6f8e09131d751174243214d9bd3b6419.tar.gz
Revert "Merge branch 'reorganize-tests-jobs-by-level' into 'master'"revert-04c3c6dd
This reverts merge request !27514
Diffstat (limited to 'lib/quality')
-rw-r--r--lib/quality/test_level.rb75
1 files changed, 0 insertions, 75 deletions
diff --git a/lib/quality/test_level.rb b/lib/quality/test_level.rb
deleted file mode 100644
index 24d8eac200c..00000000000
--- a/lib/quality/test_level.rb
+++ /dev/null
@@ -1,75 +0,0 @@
-# frozen_string_literal: true
-
-module Quality
- class TestLevel
- UnknownTestLevelError = Class.new(StandardError)
-
- TEST_LEVEL_FOLDERS = {
- unit: %w[
- bin
- config
- db
- dependencies
- factories
- finders
- frontend
- graphql
- helpers
- initializers
- javascripts
- lib
- migrations
- models
- policies
- presenters
- rack_servers
- routing
- rubocop
- serializers
- services
- sidekiq
- tasks
- uploaders
- validators
- views
- workers
- elastic_integration
- ],
- integration: %w[
- controllers
- mailers
- requests
- ],
- system: ['features']
- }.freeze
-
- attr_reader :prefix
-
- def initialize(prefix = nil)
- @prefix = prefix
- @patterns = {}
- @regexps = {}
- end
-
- def pattern(level)
- @patterns[level] ||= "#{prefix}spec/{#{TEST_LEVEL_FOLDERS.fetch(level).join(',')}}{,/**/}*_spec.rb".freeze
- end
-
- def regexp(level)
- @regexps[level] ||= Regexp.new("#{prefix}spec/(#{TEST_LEVEL_FOLDERS.fetch(level).join('|')})").freeze
- end
-
- def level_for(file_path)
- case file_path
- when regexp(:unit)
- :unit
- when regexp(:integration)
- :integration
- when regexp(:system)
- :system
- else
- raise UnknownTestLevelError, "Test level for #{file_path} couldn't be set. Please rename the file properly or change the test level detection regexes in #{__FILE__}."
- end
- end
- end
-end