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
5c2c9a3f
Commit
5c2c9a3f
authored
Dec 04, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve conflict in app/models/environment.rb
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
3a1aa0a5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
34 deletions
+3
-34
app/models/environment.rb
app/models/environment.rb
+3
-3
spec/models/environment_spec.rb
spec/models/environment_spec.rb
+0
-31
No files found.
app/models/environment.rb
View file @
5c2c9a3f
...
@@ -137,16 +137,16 @@ class Environment < ActiveRecord::Base
...
@@ -137,16 +137,16 @@ class Environment < ActiveRecord::Base
end
end
end
end
def
deployment_service_ready
?
def
has_terminals
?
project
.
deployment_platform
.
present?
&&
available?
&&
last_deployment
.
present?
project
.
deployment_platform
.
present?
&&
available?
&&
last_deployment
.
present?
end
end
def
terminals
def
terminals
project
.
deployment_platform
.
terminals
(
self
)
if
deployment_service_ready
?
project
.
deployment_platform
.
terminals
(
self
)
if
has_terminals
?
end
end
def
rollout_status
def
rollout_status
project
.
deployment_
service
.
rollout_status
(
self
)
if
deployment_service_ready
?
project
.
deployment_
platform
.
rollout_status
(
self
)
if
has_terminals
?
end
end
def
has_metrics?
def
has_metrics?
...
...
spec/models/environment_spec.rb
View file @
5c2c9a3f
...
@@ -386,17 +386,6 @@ describe Environment do
...
@@ -386,17 +386,6 @@ describe Environment do
end
end
end
end
<<<<<<<
HEAD
shared_examples
'same behavior between KubernetesService and Platform::Kubernetes'
do
it
'returns the terminals from the deployment service'
do
expect
(
project
.
deployment_platform
)
.
to
receive
(
:terminals
).
with
(
environment
)
.
and_return
(
:fake_terminals
)
is_expected
.
to
eq
(
:fake_terminals
)
end
end
context
'when user configured kubernetes from Integration > Kubernetes'
do
context
'when user configured kubernetes from Integration > Kubernetes'
do
let
(
:project
)
{
create
(
:kubernetes_project
)
}
let
(
:project
)
{
create
(
:kubernetes_project
)
}
...
@@ -408,19 +397,6 @@ describe Environment do
...
@@ -408,19 +397,6 @@ describe Environment do
let
(
:project
)
{
cluster
.
project
}
let
(
:project
)
{
cluster
.
project
}
it_behaves_like
'same behavior between KubernetesService and Platform::Kubernetes'
it_behaves_like
'same behavior between KubernetesService and Platform::Kubernetes'
=======
context
'when user configured kubernetes from Integration > Kubernetes'
do
let
(
:project
)
{
create
(
:kubernetes_project
)
}
it_behaves_like
'same behavior between KubernetesService and Platform::Kubernetes'
end
context
'when user configured kubernetes from CI/CD > Clusters'
do
let!
(
:cluster
)
{
create
(
:cluster
,
:project
,
:provided_by_gcp
)
}
let
(
:project
)
{
cluster
.
project
}
it_behaves_like
'same behavior between KubernetesService and Platform::Kubernetes'
>>>>>>>
origin
/
master
end
end
end
end
...
@@ -451,17 +427,10 @@ describe Environment do
...
@@ -451,17 +427,10 @@ describe Environment do
end
end
end
end
<<<<<<<
HEAD
it
'returns the rollout status from the deployment service'
do
expect
(
project
.
deployment_platform
)
.
to
receive
(
:rollout_status
).
with
(
environment
)
.
and_return
(
:fake_rollout_status
)
=======
context
'when the environment does not have rollout status'
do
context
'when the environment does not have rollout status'
do
before
do
before
do
allow
(
environment
).
to
receive
(
:has_terminals?
).
and_return
(
false
)
allow
(
environment
).
to
receive
(
:has_terminals?
).
and_return
(
false
)
end
end
>>>>>>>
origin
/
master
it
{
is_expected
.
to
eq
(
nil
)
}
it
{
is_expected
.
to
eq
(
nil
)
}
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