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
d321f552
Commit
d321f552
authored
Sep 20, 2021
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for updating project runner settings
parent
9aa02e07
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
14 deletions
+30
-14
spec/services/projects/update_service_spec.rb
spec/services/projects/update_service_spec.rb
+30
-14
No files found.
spec/services/projects/update_service_spec.rb
View file @
d321f552
...
...
@@ -441,27 +441,43 @@ RSpec.describe Projects::UpdateService do
end
end
context
'when updating #shared_runners'
,
:https_pages_enabled
do
let!
(
:pending_build
)
{
create
(
:ci_pending_build
,
project:
project
,
instance_runners_enabled:
true
)
}
context
'when updating runners settings'
do
let
(
:settings
)
do
{
instance_runners_enabled:
true
,
namespace_traversal_ids:
[]
}
end
subject
(
:call_service
)
do
update_project
(
project
,
admin
,
shared_runners_enabled:
shared_runners_enabled
)
let!
(
:pending_build
)
do
create
(
:ci_pending_build
,
project:
project
,
**
settings
)
end
context
'when shared runners is toggled'
do
let
(
:shared_runners_enabled
)
{
false
}
it
'updates builds queue when shared runners get disabled'
do
expect
{
update_project
(
shared_runners_enabled:
false
)
}
.
to
change
{
pending_build
.
reload
.
instance_runners_enabled
}.
to
(
false
)
it
'updates ci pending builds'
do
expect
{
call_service
}.
to
change
{
pending_build
.
reload
.
instance_runners_enabled
}.
to
(
false
)
end
expect
(
pending_build
.
reload
.
instance_runners_enabled
).
to
be
false
end
context
'when shared runners is not toggled'
do
let
(
:shared_runners_enabled
)
{
true
}
it
'updates builds queue when shared runners get enabled'
do
expect
{
update_project
(
shared_runners_enabled:
true
)
}
.
to
not_change
{
pending_build
.
reload
.
instance_runners_enabled
}
it
'updates ci pending builds'
do
expect
{
call_service
}.
to
not_change
{
pending_build
.
reload
.
instance_runners_enabled
}
end
expect
(
pending_build
.
reload
.
instance_runners_enabled
).
to
be
true
end
it
'updates builds queue when group runners get disabled'
do
update_project
(
group_runners_enabled:
false
)
expect
(
pending_build
.
reload
.
namespace_traversal_ids
).
to
be_empty
end
it
'updates builds queue when group runners get enabled'
do
update_project
(
group_runners_enabled:
true
)
expect
(
pending_build
.
reload
.
namespace_traversal_ids
).
not_to
be_empty
end
def
update_project
(
**
params
)
update_project
(
project
,
admin
,
**
params
)
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