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
4adc2698
Commit
4adc2698
authored
Oct 02, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use actual plan when looking up for CI/CD limits
parent
e51bc13f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
7 deletions
+29
-7
ee/app/models/ee/namespace.rb
ee/app/models/ee/namespace.rb
+2
-2
spec/ee/spec/models/ee/namespace_spec.rb
spec/ee/spec/models/ee/namespace_spec.rb
+27
-5
No files found.
ee/app/models/ee/namespace.rb
View file @
4adc2698
...
...
@@ -116,11 +116,11 @@ module EE
# TODO, CI/CD Quotas feature check
#
def
max_active_pipelines
plan
&
.
active_pipelines_limit
.
to_i
actual_
plan
&
.
active_pipelines_limit
.
to_i
end
def
max_pipeline_size
plan
&
.
pipeline_size_limit
.
to_i
actual_
plan
&
.
pipeline_size_limit
.
to_i
end
private
...
...
spec/ee/spec/models/ee/namespace_spec.rb
View file @
4adc2698
...
...
@@ -157,13 +157,24 @@ describe Namespace do
end
describe
'#max_active_pipelines'
do
context
'when there is no
plan associat
ed'
do
context
'when there is no
limit defin
ed'
do
it
'returns zero'
do
expect
(
namespace
.
max_active_pipelines
).
to
be_zero
end
end
context
'when limit is not defined'
do
context
'when free plan has limit defined'
do
before
do
Plan
.
find_by
(
name:
Namespace
::
FREE_PLAN
)
.
update_column
(
:active_pipelines_limit
,
40
)
end
it
'returns a free plan limits'
do
expect
(
namespace
.
max_active_pipelines
).
to
be
40
end
end
context
'when associated plan has no limit defined'
do
before
do
namespace
.
plan
=
Namespace
::
GOLD_PLAN
end
...
...
@@ -186,13 +197,24 @@ describe Namespace do
end
describe
'#max_pipeline_size'
do
context
'when there
is no plan associat
ed'
do
context
'when there
are no limits defin
ed'
do
it
'returns zero'
do
expect
(
namespace
.
max_active_pipelines
).
to
be_zero
expect
(
namespace
.
max_pipeline_size
).
to
be_zero
end
end
context
'when free plan has limit defined'
do
before
do
Plan
.
find_by
(
name:
Namespace
::
FREE_PLAN
)
.
update_column
(
:pipeline_size_limit
,
40
)
end
it
'returns a free plan limits'
do
expect
(
namespace
.
max_pipeline_size
).
to
be
40
end
end
context
'when
limit is not
defined'
do
context
'when
associated plan has no limits
defined'
do
before
do
namespace
.
plan
=
Namespace
::
GOLD_PLAN
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