Fixed ActiveJob integration tests

This commit is contained in:
Cristian Bica 2015-03-05 23:41:14 +02:00
parent 798a14a638
commit cb786219f4
4 changed files with 9 additions and 3 deletions

View File

@ -49,7 +49,7 @@ group :job do
gem 'backburner', require: false
gem 'qu-rails', github: "bkeepers/qu", branch: "master", require: false
gem 'qu-redis', require: false
# gem 'delayed_job_active_record', require: false
gem 'delayed_job_active_record', require: false
gem 'sequel', require: false
end

View File

@ -117,6 +117,9 @@ GEM
dante (0.1.5)
delayed_job (4.0.6)
activesupport (>= 3.0, < 5.0)
delayed_job_active_record (4.0.3)
activerecord (>= 3.0, < 5.0)
delayed_job (>= 3.0, < 4.1)
erubis (2.7.0)
execjs (2.3.0)
globalid (0.3.3)
@ -252,6 +255,7 @@ DEPENDENCIES
coffee-rails (~> 4.1.0)
dalli (>= 2.2.1)
delayed_job
delayed_job_active_record
jquery-rails!
json
kindlerb (= 0.1.1)

View File

@ -3,7 +3,7 @@ module QuJobsManager
require 'qu-rails'
require 'qu-redis'
ActiveJob::Base.queue_adapter = :qu
ENV['REDISTOGO_URL'] = "tcp://127.0.0.1:6379/12"
ENV['REDISTOGO_URL'] = "redis://127.0.0.1:6379/12"
backend = Qu::Backend::Redis.new
backend.namespace = "active_jobs_int_test"
Qu.backend = backend

View File

@ -1,6 +1,7 @@
module QueueClassicJobsManager
def setup
ENV['QC_DATABASE_URL'] ||= 'postgres:///active_jobs_qc_int_test'
ENV['QC_RAILS_DATABASE'] = 'false'
ENV['QC_LISTEN_TIME'] = "0.5"
uri = URI.parse(ENV['QC_DATABASE_URL'])
user = uri.user||ENV['USER']
@ -20,7 +21,8 @@ module QueueClassicJobsManager
end
def start_workers
QC::Conn.disconnect
QC.default_conn_adapter.disconnect
QC.default_conn_adapter = nil
@pid = fork do
worker = QC::Worker.new(q_name: 'integration_tests')
worker.start