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
4333b396
Commit
4333b396
authored
Aug 28, 2018
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move EE specific lines for #deployment_variables specs to `ee/` project_spec.rb
parent
9116be1d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
45 deletions
+49
-45
ee/spec/models/project_spec.rb
ee/spec/models/project_spec.rb
+49
-0
spec/models/project_spec.rb
spec/models/project_spec.rb
+0
-45
No files found.
ee/spec/models/project_spec.rb
View file @
4333b396
...
@@ -153,6 +153,55 @@ describe Project do
...
@@ -153,6 +153,55 @@ describe Project do
end
end
end
end
describe
'#deployment_variables'
do
context
'when project has a deployment platforms'
do
context
'when multiple clusters (EEP) is enabled'
do
before
do
stub_licensed_features
(
multiple_clusters:
true
)
end
let
(
:project
)
{
create
(
:project
)
}
let!
(
:default_cluster
)
do
create
(
:cluster
,
platform_type: :kubernetes
,
projects:
[
project
],
environment_scope:
'*'
,
platform_kubernetes:
default_cluster_kubernetes
)
end
let!
(
:review_env_cluster
)
do
create
(
:cluster
,
platform_type: :kubernetes
,
projects:
[
project
],
environment_scope:
'review/*'
,
platform_kubernetes:
review_env_cluster_kubernetes
)
end
let
(
:default_cluster_kubernetes
)
{
create
(
:cluster_platform_kubernetes
,
token:
'default-AAA'
)
}
let
(
:review_env_cluster_kubernetes
)
{
create
(
:cluster_platform_kubernetes
,
token:
'review-AAA'
)
}
context
'when environment name is review/name'
do
let!
(
:environment
)
{
create
(
:environment
,
project:
project
,
name:
'review/name'
)
}
it
'returns variables from this service'
do
expect
(
project
.
deployment_variables
(
environment:
'review/name'
))
.
to
include
(
key:
'KUBE_TOKEN'
,
value:
'review-AAA'
,
public:
false
)
end
end
context
'when environment name is other'
do
let!
(
:environment
)
{
create
(
:environment
,
project:
project
,
name:
'staging/name'
)
}
it
'returns variables from this service'
do
expect
(
project
.
deployment_variables
(
environment:
'staging/name'
))
.
to
include
(
key:
'KUBE_TOKEN'
,
value:
'default-AAA'
,
public:
false
)
end
end
end
end
end
describe
'#environments_for_scope'
do
describe
'#environments_for_scope'
do
set
(
:project
)
{
create
(
:project
)
}
set
(
:project
)
{
create
(
:project
)
}
...
...
spec/models/project_spec.rb
View file @
4333b396
...
@@ -2646,51 +2646,6 @@ describe Project do
...
@@ -2646,51 +2646,6 @@ describe Project do
it_behaves_like
'same behavior between KubernetesService and Platform::Kubernetes'
it_behaves_like
'same behavior between KubernetesService and Platform::Kubernetes'
end
end
context
'when multiple clusters (EEP) is enabled'
do
before
do
stub_licensed_features
(
multiple_clusters:
true
)
end
let
(
:project
)
{
create
(
:project
)
}
let!
(
:default_cluster
)
do
create
(
:cluster
,
platform_type: :kubernetes
,
projects:
[
project
],
environment_scope:
'*'
,
platform_kubernetes:
default_cluster_kubernetes
)
end
let!
(
:review_env_cluster
)
do
create
(
:cluster
,
platform_type: :kubernetes
,
projects:
[
project
],
environment_scope:
'review/*'
,
platform_kubernetes:
review_env_cluster_kubernetes
)
end
let
(
:default_cluster_kubernetes
)
{
create
(
:cluster_platform_kubernetes
,
token:
'default-AAA'
)
}
let
(
:review_env_cluster_kubernetes
)
{
create
(
:cluster_platform_kubernetes
,
token:
'review-AAA'
)
}
context
'when environment name is review/name'
do
let!
(
:environment
)
{
create
(
:environment
,
project:
project
,
name:
'review/name'
)
}
it
'returns variables from this service'
do
expect
(
project
.
deployment_variables
(
environment:
'review/name'
))
.
to
include
(
key:
'KUBE_TOKEN'
,
value:
'review-AAA'
,
public:
false
)
end
end
context
'when environment name is other'
do
let!
(
:environment
)
{
create
(
:environment
,
project:
project
,
name:
'staging/name'
)
}
it
'returns variables from this service'
do
expect
(
project
.
deployment_variables
(
environment:
'staging/name'
))
.
to
include
(
key:
'KUBE_TOKEN'
,
value:
'default-AAA'
,
public:
false
)
end
end
end
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