Configure elastic search integration with rspec tag (#27882)
This commit is contained in:
parent
297839c10c
commit
e892efbc40
4 changed files with 14 additions and 17 deletions
|
@ -4,7 +4,6 @@ ENV['RAILS_ENV'] ||= 'test'
|
|||
|
||||
# This needs to be defined before Rails is initialized
|
||||
RUN_SYSTEM_SPECS = ENV.fetch('RUN_SYSTEM_SPECS', false)
|
||||
RUN_SEARCH_SPECS = ENV.fetch('RUN_SEARCH_SPECS', false)
|
||||
|
||||
if RUN_SYSTEM_SPECS
|
||||
STREAMING_PORT = ENV.fetch('TEST_STREAMING_PORT', '4020')
|
||||
|
@ -55,20 +54,28 @@ RSpec.configure do |config|
|
|||
case type
|
||||
when :system
|
||||
!RUN_SYSTEM_SPECS
|
||||
when :search
|
||||
!RUN_SEARCH_SPECS
|
||||
end
|
||||
}
|
||||
|
||||
# By default, skip the elastic search integration specs
|
||||
config.filter_run_excluding search: true
|
||||
|
||||
config.fixture_path = Rails.root.join('spec', 'fixtures')
|
||||
config.use_transactional_fixtures = true
|
||||
config.order = 'random'
|
||||
config.infer_spec_type_from_file_location!
|
||||
config.filter_rails_from_backtrace!
|
||||
|
||||
# Set type to `cli` for all CLI specs
|
||||
config.define_derived_metadata(file_path: Regexp.new('spec/lib/mastodon/cli')) do |metadata|
|
||||
metadata[:type] = :cli
|
||||
end
|
||||
|
||||
# Set `search` metadata true for all specs in spec/search/
|
||||
config.define_derived_metadata(file_path: Regexp.new('spec/search/*')) do |metadata|
|
||||
metadata[:search] = true
|
||||
end
|
||||
|
||||
config.include Devise::Test::ControllerHelpers, type: :controller
|
||||
config.include Devise::Test::ControllerHelpers, type: :helper
|
||||
config.include Devise::Test::ControllerHelpers, type: :view
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue