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
d7d2b651
Commit
d7d2b651
authored
Dec 20, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for RegisterBuildService how builds are picked when they have a quota set
parent
1dbf1e6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
spec/services/ci/register_build_service_spec.rb
spec/services/ci/register_build_service_spec.rb
+56
-0
No files found.
spec/services/ci/register_build_service_spec.rb
View file @
d7d2b651
...
@@ -130,6 +130,62 @@ module Ci
...
@@ -130,6 +130,62 @@ module Ci
end
end
end
end
context
'for project with shared runners when global minutes limit is set'
do
before
do
project
.
update
(
shared_runners_enabled:
true
)
stub_application_setting
(
shared_runners_minutes:
500
)
end
context
'allow to pick builds'
do
let
(
:build
)
{
execute
(
shared_runner
)
}
it
{
expect
(
build
).
to
be_kind_of
(
Build
)
}
end
context
'when over the global quota'
do
before
do
project
.
namespace
.
create_namespace_metrics
(
shared_runners_minutes:
600
)
end
let
(
:build
)
{
execute
(
shared_runner
)
}
it
"does not return a build"
do
expect
(
build
).
to
be_nil
end
context
'when project is public'
do
before
do
project
.
update
(
visibility_level:
Project
::
PUBLIC
)
end
it
"does return the build"
do
expect
(
build
).
to
be_kind_of
(
Build
)
end
end
context
'when namespace limit is set to unlimited'
do
before
do
project
.
namespace
.
update
(
shared_runners_minutes_limit:
0
)
end
it
"does return the build"
do
expect
(
build
).
to
be_kind_of
(
Build
)
end
end
context
'when namespace quota is bigger than a global one'
do
before
do
project
.
namespace
.
update
(
shared_runners_minutes_limit:
1000
)
end
it
"does return the build"
do
expect
(
build
).
to
be_kind_of
(
Build
)
end
end
end
end
context
'disallow shared runners'
do
context
'disallow shared runners'
do
before
do
before
do
project
.
update
(
shared_runners_enabled:
false
)
project
.
update
(
shared_runners_enabled:
false
)
...
...
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