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
bfc694f5
Commit
bfc694f5
authored
Dec 19, 2017
by
Alexis Reigel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show group runners setup only to group master
parent
c585004b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
30 deletions
+59
-30
app/views/projects/runners/_group_runners.html.haml
app/views/projects/runners/_group_runners.html.haml
+5
-2
spec/features/runners_spec.rb
spec/features/runners_spec.rb
+54
-28
No files found.
app/views/projects/runners/_group_runners.html.haml
View file @
bfc694f5
...
...
@@ -20,8 +20,11 @@
-
elsif
@group_runners
.
empty?
This group does not provide any group Runners yet.
=
render
partial:
'ci/runner/how_to_setup_runner'
,
locals:
{
registration_token:
@project
.
group
.
runners_token
,
type:
'group'
}
-
if
can?
(
current_user
,
:admin_pipeline
,
@project
.
group
)
=
render
partial:
'ci/runner/how_to_setup_runner'
,
locals:
{
registration_token:
@project
.
group
.
runners_token
,
type:
'group'
}
-
else
Ask your group master to setup a group Runner.
-
else
%h4
.underlined-title
Available group Runners :
#{
@group_runners
.
count
}
...
...
spec/features/runners_spec.rb
View file @
bfc694f5
...
...
@@ -187,51 +187,77 @@ feature 'Runners' do
project
.
add_master
(
user
)
end
context
'project without a group'
do
given
(
:project
)
{
create
:project
}
given
(
:group
)
{
create
:group
}
scenario
'group runners are not available'
do
visit
runners_path
(
project
)
context
'as project and group master'
do
background
do
group
.
add_master
(
user
)
end
context
'project with a group but no group runner'
do
given
(
:project
)
{
create
:project
,
group:
group
}
scenario
'group runners are not available'
do
visit
runners_path
(
project
)
expect
(
page
).
to
have_content
'This project does not belong to a group and can therefore not make use of group Runners.'
expect
(
page
).
to
have_content
'This group does not provide any group Runners yet.'
expect
(
page
).
to
have_content
'Setup a group Runner manually'
expect
(
page
).
not_to
have_content
'Ask your group master to setup a group Runner.'
end
end
end
context
'
project with a group but no group runn
er'
do
given
(
:group
)
{
create
:group
}
given
(
:project
)
{
create
:project
,
group:
group
}
context
'
as project mast
er'
do
context
'project without a group'
do
given
(
:project
)
{
create
:project
}
scenario
'group runners are not available'
do
visit
runners_path
(
project
)
scenario
'group runners are not available'
do
visit
runners_path
(
project
)
expect
(
page
).
to
have_content
'This group does not provide any group Runners yet.'
expect
(
page
).
to
have_content
'This project does not belong to a group and can therefore not make use of group Runners.'
end
end
end
context
'project with a group and a group runner'
do
given
(
:group
)
{
create
:group
}
given
(
:project
)
{
create
:project
,
group:
group
}
given!
(
:ci_runner
)
{
create
:ci_runner
,
groups:
[
group
],
description:
'group-runner'
}
context
'project with a group but no group runner'
do
given
(
:group
)
{
create
:group
}
given
(
:project
)
{
create
:project
,
group:
group
}
scenario
'group runners are available'
do
visit
runners_path
(
project
)
scenario
'group runners are not available'
do
visit
runners_path
(
project
)
expect
(
page
).
to
have_content
'This group does not provide any group Runners yet.'
expect
(
page
).
to
have_content
'Available group Runners : 1'
expect
(
page
).
to
have_content
'group-runner'
expect
(
page
).
not_to
have_content
'Setup a group Runner manually'
expect
(
page
).
to
have_content
'Ask your group master to setup a group Runner.'
end
end
scenario
'group runners may be disabled for a project'
do
visit
runners_path
(
project
)
context
'project with a group and a group runner'
do
given
(
:group
)
{
create
:group
}
given
(
:project
)
{
create
:project
,
group:
group
}
given!
(
:ci_runner
)
{
create
:ci_runner
,
groups:
[
group
],
description:
'group-runner'
}
scenario
'group runners are available'
do
visit
runners_path
(
project
)
expect
(
page
).
to
have_content
'Available group Runners : 1'
expect
(
page
).
to
have_content
'group-runner'
end
click_on
'Disable group Runners'
scenario
'group runners may be disabled for a project'
do
visit
runners_path
(
project
)
click_on
'Disable group Runners'
expect
(
page
).
to
have_content
'Enable group Runners'
expect
(
project
.
reload
.
group_runners_enabled
).
to
be
false
expect
(
page
).
to
have_content
'Enable group Runners'
expect
(
project
.
reload
.
group_runners_enabled
).
to
be
false
click_on
'Enable group Runners'
click_on
'Enable group Runners'
expect
(
page
).
to
have_content
'Disable group Runners'
expect
(
project
.
reload
.
group_runners_enabled
).
to
be
true
expect
(
page
).
to
have_content
'Disable group Runners'
expect
(
project
.
reload
.
group_runners_enabled
).
to
be
true
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