Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
bf4b6219
Commit
bf4b6219
authored
Jul 03, 2020
by
Dylan Griffith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore removed queues in danger sidekiq_queues
parent
c1c7bfe8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
lib/gitlab/danger/sidekiq_queues.rb
lib/gitlab/danger/sidekiq_queues.rb
+1
-1
spec/lib/gitlab/danger/sidekiq_queues_spec.rb
spec/lib/gitlab/danger/sidekiq_queues_spec.rb
+16
-0
No files found.
lib/gitlab/danger/sidekiq_queues.rb
View file @
bf4b6219
...
@@ -14,7 +14,7 @@ module Gitlab
...
@@ -14,7 +14,7 @@ module Gitlab
def
changed_queue_names
def
changed_queue_names
@changed_queue_names
||=
@changed_queue_names
||=
(
new_queues
.
values_at
(
*
old_queues
.
keys
)
-
old_queues
.
values
)
(
new_queues
.
values_at
(
*
old_queues
.
keys
)
-
old_queues
.
values
)
.
map
{
|
queue
|
queue
[
:name
]
}
.
compact
.
map
{
|
queue
|
queue
[
:name
]
}
end
end
private
private
...
...
spec/lib/gitlab/danger/sidekiq_queues_spec.rb
View file @
bf4b6219
...
@@ -62,5 +62,21 @@ RSpec.describe Gitlab::Danger::SidekiqQueues do
...
@@ -62,5 +62,21 @@ RSpec.describe Gitlab::Danger::SidekiqQueues do
expect
(
sidekiq_queues
.
changed_queue_names
).
to
contain_exactly
(
:post_receive
,
:process_commit
)
expect
(
sidekiq_queues
.
changed_queue_names
).
to
contain_exactly
(
:post_receive
,
:process_commit
)
end
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
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment