diff --git a/test/helper.rb b/test/helper.rb index c1e94dccd9..da80a46a9d 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -20,6 +20,8 @@ end end +ENV['REDIS_URL'] ||= 'redis://localhost/15' + Sidekiq.logger.level = Logger::ERROR def capture_logging(lvl=Logger::INFO) diff --git a/test/test_redis_connection.rb b/test/test_redis_connection.rb index 6c0879bfe6..1c66406629 100644 --- a/test/test_redis_connection.rb +++ b/test/test_redis_connection.rb @@ -82,7 +82,7 @@ def server_connection(*args) it "disables client setname with nil id" do pool = Sidekiq::RedisConnection.create(:id => nil) assert_equal Redis, pool.checkout.class - assert_equal "redis://127.0.0.1:6379/0", pool.checkout.connection.fetch(:id) + assert_equal "redis://localhost:6379/15", pool.checkout.connection.fetch(:id) end describe "network_timeout" do @@ -124,7 +124,7 @@ def server_connection(*args) pool = Sidekiq::RedisConnection.create(:path => "/var/run/redis.sock") assert_equal "unix", client_for(pool.checkout).scheme assert_equal "/var/run/redis.sock", pool.checkout.connection.fetch(:location) - assert_equal 0, pool.checkout.connection.fetch(:db) + assert_equal 15, pool.checkout.connection.fetch(:db) end it "uses a given :path and :db" do