Commit e69aee26 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'danger-sidekiq-queues-handle-removed-queues' into 'master'

Ignore removed queues in danger sidekiq_queues

See merge request gitlab-org/gitlab!35948
parents c739007a bf4b6219
......@@ -14,7 +14,7 @@ module Gitlab
def changed_queue_names
@changed_queue_names ||=
(new_queues.values_at(*old_queues.keys) - old_queues.values)
.map { |queue| queue[:name] }
.compact.map { |queue| queue[:name] }
end
private
......
......@@ -62,5 +62,21 @@ RSpec.describe Gitlab::Danger::SidekiqQueues do
expect(sidekiq_queues.changed_queue_names).to contain_exactly(:post_receive, :process_commit)
end
it 'ignores removed queues' do
old_queues = {
merge: { name: :merge, urgency: :low },
post_receive: { name: :post_receive, urgency: :high }
}
new_queues = {
post_receive: { name: :post_receive, urgency: :low }
}
allow(sidekiq_queues).to receive(:old_queues).and_return(old_queues)
allow(sidekiq_queues).to receive(:new_queues).and_return(new_queues)
expect(sidekiq_queues.changed_queue_names).to contain_exactly(:post_receive)
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