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
cbc010ad
Commit
cbc010ad
authored
Feb 01, 2022
by
Pedro Pombeiro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix specs
parent
4f12dcf7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
27 deletions
+37
-27
spec/models/ci/runner_spec.rb
spec/models/ci/runner_spec.rb
+37
-27
No files found.
spec/models/ci/runner_spec.rb
View file @
cbc010ad
...
...
@@ -265,10 +265,10 @@ RSpec.describe Ci::Runner do
it_behaves_like
'.belonging_to_parent_group_of_project'
end
context
'with
existing system wide, group and project runners
'
do
context
'with
instance runners sharing enabled
'
do
# group specific
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:project
)
{
create
(
:project
,
group:
group
)
}
let_it_be
(
:group
)
{
create
(
:group
,
shared_runners_enabled:
true
)
}
let_it_be
(
:project
)
{
create
(
:project
,
group:
group
,
shared_runners_enabled:
true
)
}
let_it_be
(
:group_runner
)
{
create
(
:ci_runner
,
:group
,
groups:
[
group
])
}
# project specific
...
...
@@ -280,20 +280,8 @@ RSpec.describe Ci::Runner do
describe
'.owned_or_instance_wide'
do
subject
{
described_class
.
owned_or_instance_wide
(
project
.
id
)
}
context
'with instance runners sharing enabled'
do
let
(
:shared_runners_enabled
)
{
true
}
it
'returns a globally shared, a project specific and a group specific runner'
do
is_expected
.
to
contain_exactly
(
group_runner
,
project_runner
,
shared_runner
)
end
end
context
'with instance runners sharing disabled'
do
let
(
:shared_runners_enabled
)
{
false
}
it
'returns a project specific and a group specific runner'
do
is_expected
.
to
contain_exactly
(
group_runner
,
project_runner
)
end
it
'returns a globally shared, a project specific and a group specific runner'
do
is_expected
.
to
contain_exactly
(
group_runner
,
project_runner
,
shared_runner
)
end
end
...
...
@@ -305,20 +293,42 @@ RSpec.describe Ci::Runner do
project_runner
end
context
'with instance runners sharing enabled'
do
let
(
:shared_runners_enabled
)
{
true
}
it
'returns a globally shared and a group specific runner'
do
is_expected
.
to
contain_exactly
(
group_runner
,
shared_runner
)
end
end
end
context
'with instance runners sharing disabled'
do
# group specific
let_it_be
(
:group
)
{
create
(
:group
,
shared_runners_enabled:
false
)
}
let_it_be
(
:project
)
{
create
(
:project
,
group:
group
,
shared_runners_enabled:
false
)
}
let_it_be
(
:group_runner
)
{
create
(
:ci_runner
,
:group
,
groups:
[
group
])
}
# project specific
let_it_be
(
:project_runner
)
{
create
(
:ci_runner
,
:project
,
projects:
[
project
])
}
it
'returns a globally shared and a group specific runner'
do
is_expected
.
to
contain_exactly
(
group_runner
,
shared_runner
)
end
# globally shared
let_it_be
(
:shared_runner
)
{
create
(
:ci_runner
,
:instance
)
}
describe
'.owned_or_instance_wide'
do
subject
{
described_class
.
owned_or_instance_wide
(
project
.
id
)
}
it
'returns a project specific and a group specific runner'
do
is_expected
.
to
contain_exactly
(
group_runner
,
project_runner
)
end
end
context
'with instance runners sharing disabled
'
do
let
(
:shared_runners_enabled
)
{
false
}
describe
'.group_or_instance_wide
'
do
subject
{
described_class
.
group_or_instance_wide
(
group
)
}
it
'returns a group specific runner'
do
is_expected
.
to
contain_exactly
(
group_runner
)
end
before
do
# Ensure the project runner is instantiated
project_runner
end
it
'returns a group specific runner'
do
is_expected
.
to
contain_exactly
(
group_runner
)
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