mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Configurable redis url in tests
This allows for a custom redis url (i.e. when having redis run on a non-default port) in tests. To use this, run the tests with `REDIS_URL=redis://localhost:16379/15 rake`
This commit is contained in:
parent
917cc33b77
commit
5a0a677ba9
1 changed files with 6 additions and 1 deletions
|
@ -25,4 +25,9 @@ require 'sidekiq/util'
|
|||
Sidekiq.logger.level = Logger::ERROR
|
||||
|
||||
require 'sidekiq/redis_connection'
|
||||
REDIS = Sidekiq::RedisConnection.create(:url => "redis://localhost/15", :namespace => 'testy')
|
||||
redis_url = ENV['REDIS_URL'] || 'redis://localhost/15'
|
||||
REDIS = Sidekiq::RedisConnection.create(:url => redis_url, :namespace => 'testy')
|
||||
|
||||
Sidekiq.configure_client do |config|
|
||||
config.redis = { :url => redis_url, :namespace => 'testy' }
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue