diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-08-25 15:22:28 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-08-25 15:25:18 +0300 |
commit | e984a8a3543fa9a26308cea35a42046392f4a488 (patch) | |
tree | 1b5096bc11581b343d20bbf12b5b9c9771eef20b | |
parent | a653c8ead4d45ffcab5447a9e38f9742600c0d09 (diff) |
Migrate new jobs when reverting pipeline queues migration
-rw-r--r-- | db/post_migrate/20170822101017_migrate_pipeline_sidekiq_queues.rb | 3 | ||||
-rw-r--r-- | spec/migrations/migrate_pipeline_sidekiq_queues_spec.rb | 9 |
2 files changed, 10 insertions, 2 deletions
diff --git a/db/post_migrate/20170822101017_migrate_pipeline_sidekiq_queues.rb b/db/post_migrate/20170822101017_migrate_pipeline_sidekiq_queues.rb index 48fa3af0c60..8441cfe7968 100644 --- a/db/post_migrate/20170822101017_migrate_pipeline_sidekiq_queues.rb +++ b/db/post_migrate/20170822101017_migrate_pipeline_sidekiq_queues.rb @@ -10,5 +10,8 @@ class MigratePipelineSidekiqQueues < ActiveRecord::Migration def down 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 diff --git a/spec/migrations/migrate_pipeline_sidekiq_queues_spec.rb b/spec/migrations/migrate_pipeline_sidekiq_queues_spec.rb index fff531a78c5..e02bcd2f4da 100644 --- a/spec/migrations/migrate_pipeline_sidekiq_queues_spec.rb +++ b/spec/migrations/migrate_pipeline_sidekiq_queues_spec.rb @@ -21,12 +21,17 @@ describe MigratePipelineSidekiqQueues, :sidekiq, :redis do it 'correctly migrates queue when migrating down' do Sidekiq::Testing.disable! do 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 - 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_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 |