diff options
Diffstat (limited to 'spec/lib/gitlab/sidekiq_config')
-rw-r--r-- | spec/lib/gitlab/sidekiq_config/worker_router_spec.rb | 7 | ||||
-rw-r--r-- | spec/lib/gitlab/sidekiq_config/worker_spec.rb | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/spec/lib/gitlab/sidekiq_config/worker_router_spec.rb b/spec/lib/gitlab/sidekiq_config/worker_router_spec.rb index 687e35813b1..4a8dbe69d36 100644 --- a/spec/lib/gitlab/sidekiq_config/worker_router_spec.rb +++ b/spec/lib/gitlab/sidekiq_config/worker_router_spec.rb @@ -114,6 +114,13 @@ RSpec.describe Gitlab::SidekiqConfig::WorkerRouter do ['resource_boundary=cpu', 'queue_b'], ['tags=expensive', 'queue_c'] ] | 'queue_foo' + # Match by generated queue name + [ + ['name=foo_bar', 'queue_foo'], + ['feature_category=feature_a|urgency=low', 'queue_a'], + ['resource_boundary=cpu', 'queue_b'], + ['tags=expensive', 'queue_c'] + ] | 'queue_foo' end end diff --git a/spec/lib/gitlab/sidekiq_config/worker_spec.rb b/spec/lib/gitlab/sidekiq_config/worker_spec.rb index 0c43c33ff8c..f4d7a4b3359 100644 --- a/spec/lib/gitlab/sidekiq_config/worker_spec.rb +++ b/spec/lib/gitlab/sidekiq_config/worker_spec.rb @@ -7,7 +7,7 @@ RSpec.describe Gitlab::SidekiqConfig::Worker do namespace = queue.include?(':') && queue.split(':').first inner_worker = double( name: attributes[:worker_name] || 'Foo::BarWorker', - queue: queue, + generated_queue_name: queue, queue_namespace: namespace, get_feature_category: attributes[:feature_category], get_weight: attributes[:weight], @@ -48,9 +48,9 @@ RSpec.describe Gitlab::SidekiqConfig::Worker do describe 'delegations' do [ - :feature_category_not_owned?, :get_feature_category, :get_weight, - :get_worker_resource_boundary, :get_urgency, :queue, - :queue_namespace, :worker_has_external_dependencies? + :feature_category_not_owned?, :generated_queue_name, + :get_feature_category, :get_weight, :get_worker_resource_boundary, + :get_urgency, :queue_namespace, :worker_has_external_dependencies? ].each do |meth| it "delegates #{meth} to the worker class" do worker = double |