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
eef96832
Commit
eef96832
authored
Dec 07, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for deployment_variables
parent
db676b9f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
1 deletion
+44
-1
spec/ee/spec/models/ee/project_spec.rb
spec/ee/spec/models/ee/project_spec.rb
+1
-1
spec/models/project_spec.rb
spec/models/project_spec.rb
+43
-0
No files found.
spec/ee/spec/models/ee/project_spec.rb
View file @
eef96832
...
@@ -707,7 +707,7 @@ describe Project do
...
@@ -707,7 +707,7 @@ describe Project do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
context
'when environment is specified'
do
context
'when environment is specified'
do
let
(
:environment
)
{
create
(
:environment
,
name:
'review/name'
)
}
let
(
:environment
)
{
create
(
:environment
,
project:
project
,
name:
'review/name'
)
}
let!
(
:default_cluster
)
{
create
(
:cluster
,
:provided_by_user
,
projects:
[
project
],
environment_scope:
'*'
)
}
let!
(
:default_cluster
)
{
create
(
:cluster
,
:provided_by_user
,
projects:
[
project
],
environment_scope:
'*'
)
}
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_user
,
projects:
[
project
])
}
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_user
,
projects:
[
project
])
}
...
...
spec/models/project_spec.rb
View file @
eef96832
...
@@ -2384,6 +2384,49 @@ describe Project do
...
@@ -2384,6 +2384,49 @@ 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'
)
}
subject
{
project
.
deployment_variables
(
environment:
environment
)
}
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
(
subject
).
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
(
subject
).
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