Make it possible to check if worker uses a known queue
This commit is contained in:
parent
0f01ce3657
commit
ce274fd61b
3 changed files with 13 additions and 0 deletions
|
@ -27,6 +27,7 @@
|
|||
- [new_merge_request, 2]
|
||||
- [build, 2]
|
||||
- [pipeline, 2]
|
||||
- [pipelines-pipeline-processing, 2]
|
||||
- [gitlab_shell, 2]
|
||||
- [email_receiver, 2]
|
||||
- [emails_on_push, 2]
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
shared_examples 'sidekiq worker' do
|
||||
let(:queues) do
|
||||
YAML.load_file(Rails.root.join('config', 'sidekiq_queues.yml'))
|
||||
.fetch(:queues, []).map(&:first)
|
||||
end
|
||||
|
||||
it 'is going to be processed inside a known sidekiq queue' do
|
||||
expect(described_class.sidekiq_options['queue']).to be_in queues
|
||||
end
|
||||
end
|
|
@ -1,6 +1,8 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe PipelineUpdateWorker do
|
||||
it_behaves_like 'sidekiq worker'
|
||||
|
||||
describe '#perform' do
|
||||
context 'when pipeline exists' do
|
||||
let(:pipeline) { create(:ci_pipeline) }
|
||||
|
|
Loading…
Reference in a new issue