Commit e984a8a3 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Migrate new jobs when reverting pipeline queues migration

parent a653c8ea
...@@ -10,5 +10,8 @@ class MigratePipelineSidekiqQueues < ActiveRecord::Migration ...@@ -10,5 +10,8 @@ class MigratePipelineSidekiqQueues < ActiveRecord::Migration
def down def down
sidekiq_queue_migrate 'pipeline_default', to: 'pipeline' sidekiq_queue_migrate 'pipeline_default', to: 'pipeline'
sidekiq_queue_migrate 'pipeline_processing', to: 'pipeline'
sidekiq_queue_migrate 'pipeline_hooks', to: 'pipeline'
sidekiq_queue_migrate 'pipeline_cache', to: 'pipeline'
end end
end end
...@@ -21,12 +21,17 @@ describe MigratePipelineSidekiqQueues, :sidekiq, :redis do ...@@ -21,12 +21,17 @@ describe MigratePipelineSidekiqQueues, :sidekiq, :redis do
it 'correctly migrates queue when migrating down' do it 'correctly migrates queue when migrating down' do
Sidekiq::Testing.disable! do Sidekiq::Testing.disable! do
stubbed_worker(queue: :pipeline_default).perform_async('Class', [1]) stubbed_worker(queue: :pipeline_default).perform_async('Class', [1])
stubbed_worker(queue: :pipeline_default).perform_async('Class', [2]) stubbed_worker(queue: :pipeline_processing).perform_async('Class', [2])
stubbed_worker(queue: :pipeline_hooks).perform_async('Class', [3])
stubbed_worker(queue: :pipeline_cache).perform_async('Class', [4])
described_class.new.down described_class.new.down
expect(sidekiq_queue_length('pipeline')).to eq 2 expect(sidekiq_queue_length('pipeline')).to eq 4
expect(sidekiq_queue_length('pipeline_default')).to eq 0 expect(sidekiq_queue_length('pipeline_default')).to eq 0
expect(sidekiq_queue_length('pipeline_processing')).to eq 0
expect(sidekiq_queue_length('pipeline_hooks')).to eq 0
expect(sidekiq_queue_length('pipeline_cache')).to eq 0
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment