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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
a5ab418c
Commit
a5ab418c
authored
Jan 20, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing specs for update build queue service
parent
ecb9f978
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
1 deletion
+50
-1
app/services/ci/update_build_queue_service.rb
app/services/ci/update_build_queue_service.rb
+3
-1
spec/services/ci/update_build_queue_service_spec.rb
spec/services/ci/update_build_queue_service_spec.rb
+47
-0
No files found.
app/services/ci/update_build_queue_service.rb
View file @
a5ab418c
...
...
@@ -7,11 +7,13 @@ module Ci
end
end
return
unless
build
.
project
.
shared_runners_enabled?
Ci
::
Runner
.
shared
.
each
do
|
runner
|
if
runner
.
can_pick?
(
build
)
runner
.
tick_runner_queue
end
end
if
build
.
project
.
shared_runners_enabled?
end
end
end
end
spec/services/ci/update_build_queue_service_spec.rb
0 → 100644
View file @
a5ab418c
require
'spec_helper'
describe
Ci
::
UpdateBuildQueueService
,
:services
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
let
(
:pipeline
)
{
create
(
:ci_pipeline
,
project:
project
)
}
context
'when updating specific runners'
do
let
(
:runner
)
{
create
(
:ci_runner
)
}
context
'when there are runner that can pick build'
do
before
{
build
.
project
.
runners
<<
runner
}
it
'ticks runner queue value'
do
expect
{
subject
.
execute
(
build
)
}
.
to
change
{
runner
.
ensure_runner_queue_value
}
end
end
context
'when there are no runners that can pick build'
do
it
'does not tick runner queue value'
do
expect
{
subject
.
execute
(
build
)
}
.
not_to
change
{
runner
.
ensure_runner_queue_value
}
end
end
end
context
'when updating shared runners'
do
let
(
:runner
)
{
create
(
:ci_runner
,
:shared
)
}
context
'when there are runner that can pick build'
do
it
'ticks runner queue value'
do
expect
{
subject
.
execute
(
build
)
}
.
to
change
{
runner
.
ensure_runner_queue_value
}
end
end
context
'when there are no runners that can pick build'
do
before
{
build
.
tag_list
=
[
:docker
]
}
it
'does not tick runner queue value'
do
expect
{
subject
.
execute
(
build
)
}
.
not_to
change
{
runner
.
ensure_runner_queue_value
}
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