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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
53da3d97
Commit
53da3d97
authored
Nov 27, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replce kubernetes_service and deployment_service to deployment_platform
parent
1d7e3ef1
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
130 additions
and
183 deletions
+130
-183
app/controllers/projects/branches_controller.rb
app/controllers/projects/branches_controller.rb
+1
-1
app/helpers/auto_devops_helper.rb
app/helpers/auto_devops_helper.rb
+1
-1
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+1
-1
app/models/environment.rb
app/models/environment.rb
+2
-2
app/models/project.rb
app/models/project.rb
+8
-20
app/views/projects/clusters/new.html.haml
app/views/projects/clusters/new.html.haml
+1
-1
app/views/projects/edit.html.haml
app/views/projects/edit.html.haml
+1
-1
app/views/projects/show.html.haml
app/views/projects/show.html.haml
+1
-1
lib/gitlab/prometheus/queries/query_additional_metrics.rb
lib/gitlab/prometheus/queries/query_additional_metrics.rb
+1
-1
spec/controllers/projects/branches_controller_spec.rb
spec/controllers/projects/branches_controller_spec.rb
+12
-18
spec/features/auto_deploy_spec.rb
spec/features/auto_deploy_spec.rb
+11
-48
spec/features/projects/clusters/interchangeability_spec.rb
spec/features/projects/clusters/interchangeability_spec.rb
+0
-29
spec/models/clusters/platforms/kubernetes_spec.rb
spec/models/clusters/platforms/kubernetes_spec.rb
+46
-46
spec/models/environment_spec.rb
spec/models/environment_spec.rb
+20
-6
spec/models/project_services/kubernetes_service_spec.rb
spec/models/project_services/kubernetes_service_spec.rb
+1
-1
spec/models/project_spec.rb
spec/models/project_spec.rb
+21
-4
spec/support/prometheus/additional_metrics_shared_examples.rb
.../support/prometheus/additional_metrics_shared_examples.rb
+1
-1
spec/workers/reactive_caching_worker_spec.rb
spec/workers/reactive_caching_worker_spec.rb
+1
-1
No files found.
app/controllers/projects/branches_controller.rb
View file @
53da3d97
...
...
@@ -41,7 +41,7 @@ class Projects::BranchesController < Projects::ApplicationController
branch_name
=
sanitize
(
strip_tags
(
params
[
:branch_name
]))
branch_name
=
Addressable
::
URI
.
unescape
(
branch_name
)
redirect_to_autodeploy
=
project
.
empty_repo?
&&
project
.
deployment_
services
.
present?
redirect_to_autodeploy
=
project
.
empty_repo?
&&
project
.
deployment_
platform
.
present?
result
=
CreateBranchService
.
new
(
project
,
current_user
)
.
execute
(
branch_name
,
ref
)
...
...
app/helpers/auto_devops_helper.rb
View file @
53da3d97
...
...
@@ -10,7 +10,7 @@ module AutoDevopsHelper
def
auto_devops_warning_message
(
project
)
missing_domain
=
!
project
.
auto_devops
&
.
has_domain?
missing_service
=
!
project
.
kubernetes_service
&
.
active?
missing_service
=
!
project
.
deployment_platform
&
.
active?
if
missing_service
params
=
{
...
...
app/models/ci/pipeline.rb
View file @
53da3d97
...
...
@@ -365,7 +365,7 @@ module Ci
end
def
has_kubernetes_active?
project
.
kubernetes_service
&
.
active?
project
.
deployment_platform
&
.
active?
end
def
has_stage_seeds?
...
...
app/models/environment.rb
View file @
53da3d97
...
...
@@ -138,11 +138,11 @@ class Environment < ActiveRecord::Base
end
def
has_terminals?
project
.
deployment_
service
.
present?
&&
available?
&&
last_deployment
.
present?
project
.
deployment_
platform
.
present?
&&
available?
&&
last_deployment
.
present?
end
def
terminals
project
.
deployment_
service
.
terminals
(
self
)
if
has_terminals?
project
.
deployment_
platform
.
terminals
(
self
)
if
has_terminals?
end
def
has_metrics?
...
...
app/models/project.rb
View file @
53da3d97
...
...
@@ -123,7 +123,7 @@ class Project < ActiveRecord::Base
has_one
:bugzilla_service
has_one
:gitlab_issue_tracker_service
,
inverse_of: :project
has_one
:external_wiki_service
#
has_one :kubernetes_service, inverse_of: :project
has_one
:kubernetes_service
,
inverse_of: :project
has_one
:prometheus_service
,
inverse_of: :project
has_one
:mock_ci_service
has_one
:mock_deployment_service
...
...
@@ -902,16 +902,11 @@ class Project < ActiveRecord::Base
@ci_service
||=
ci_services
.
reorder
(
nil
).
find_by
(
active:
true
)
end
def
deployment_services
services
.
where
(
category: :deployment
)
end
def
deployment_service
deployment_platform
end
def
kubernetes_service
deployment_platform
# TODO: This will be extended for multiple enviroment clusters
# TODO: Add super nice tests to check this interchangeability
def
deployment_platform
@deployment_platform
||=
clusters
.
where
(
enabled:
true
).
first
&
.
platform_kubernetes
@deployment_platform
||=
services
.
where
(
category: :deployment
).
reorder
(
nil
).
find_by
(
active:
true
)
end
def
monitoring_services
...
...
@@ -1556,9 +1551,9 @@ class Project < ActiveRecord::Base
end
def
deployment_variables
return
[]
unless
deployment_
service
return
[]
unless
deployment_
platform
deployment_
service
.
predefined_variables
deployment_
platform
.
predefined_variables
end
def
auto_devops_variables
...
...
@@ -1851,11 +1846,4 @@ class Project < ActiveRecord::Base
raise
ex
end
# TODO: This will be extended for multiple enviroment clusters
# TODO: Add super nice tests to check this interchangeability
def
deployment_platform
@deployment_platform
||=
clusters
.
where
(
enabled:
true
).
first
&
.
platform_kubernetes
@deployment_platform
||=
deployment_services
.
reorder
(
nil
).
find_by
(
active:
true
)
end
end
app/views/projects/clusters/new.html.haml
View file @
53da3d97
...
...
@@ -5,7 +5,7 @@
.col-sm-4
=
render
'sidebar'
.col-sm-8
-
if
@project
.
kubernetes_service
&
.
active?
-
if
@project
.
deployment_platform
&
.
active?
%h4
.prepend-top-0
=
s_
(
'ClusterIntegration|Cluster management'
)
%p
=
s_
(
'ClusterIntegration|A cluster has been set up on this project through the Kubernetes integration page'
)
...
...
app/views/projects/edit.html.haml
View file @
53da3d97
...
...
@@ -147,7 +147,7 @@
%ul
%li
Be careful. Renaming a project's repository can have unintended side effects.
%li
You will need to update your local repositories to point to the new location.
-
if
@project
.
deployment_
services
.
any?
-
if
@project
.
deployment_
platform
.
any?
%li
Your deployment services will be broken, you will need to manually fix the services after renaming.
=
f
.
submit
'Rename project'
,
class:
"btn btn-warning"
-
if
can?
(
current_user
,
:change_namespace
,
@project
)
...
...
app/views/projects/show.html.haml
View file @
53da3d97
...
...
@@ -67,7 +67,7 @@
-
if
koding_enabled?
&&
@repository
.
koding_yml
.
blank?
%li
.missing
=
link_to
_
(
'Set up Koding'
),
add_koding_stack_path
(
@project
)
-
if
@repository
.
gitlab_ci_yml
.
blank?
&&
@project
.
deployment_
service
.
present?
-
if
@repository
.
gitlab_ci_yml
.
blank?
&&
@project
.
deployment_
platform
.
present?
%li
.missing
=
link_to
add_special_file_path
(
@project
,
file_name:
'.gitlab-ci.yml'
,
commit_message:
'Set up auto deploy'
,
branch_name:
'auto-deploy'
,
context:
'autodeploy'
)
do
#{
_
(
'Set up auto deploy'
)
}
...
...
lib/gitlab/prometheus/queries/query_additional_metrics.rb
View file @
53da3d97
...
...
@@ -76,7 +76,7 @@ module Gitlab
timeframe_start:
timeframe_start
,
timeframe_end:
timeframe_end
,
ci_environment_slug:
environment
.
slug
,
kube_namespace:
environment
.
project
.
kubernetes_service
&
.
actual_namespace
||
''
,
kube_namespace:
environment
.
project
.
deployment_platform
&
.
actual_namespace
||
''
,
environment_filter:
%{container_name!="POD",environment="#{environment.slug}"}
}
end
...
...
spec/controllers/projects/branches_controller_spec.rb
View file @
53da3d97
...
...
@@ -113,12 +113,10 @@ describe Projects::BranchesController do
expect
(
response
).
to
redirect_to
project_tree_path
(
project
,
branch
)
end
context
'when user configured kubernetes from Integration >
Kubernetes'
do
shared_examples
'correct behavior on KubernetesService and Platform::
Kubernetes'
do
it
'redirects to autodeploy setup page'
do
result
=
{
status: :success
,
branch:
double
(
name:
branch
)
}
project
.
services
<<
build
(
:kubernetes_service
)
expect_any_instance_of
(
CreateBranchService
).
to
receive
(
:execute
).
and_return
(
result
)
expect
(
SystemNoteService
).
to
receive
(
:new_issue_branch
).
and_return
(
true
)
...
...
@@ -133,24 +131,20 @@ describe Projects::BranchesController do
end
end
context
'when user configured kubernetes from CI/CD > Clusters'
do
it
'redirects to autodeploy setup page'
do
result
=
{
status: :success
,
branch:
double
(
name:
branch
)
}
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
expect_any_instance_of
(
CreateBranchService
).
to
receive
(
:execute
).
and_return
(
result
)
expect
(
SystemNoteService
).
to
receive
(
:new_issue_branch
).
and_return
(
true
)
context
'when user configured kubernetes from Integration > Kubernetes'
do
before
do
project
.
services
<<
build
(
:kubernetes_service
)
end
post
:create
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
.
to_param
,
branch_name:
branch
,
issue_iid:
issue
.
iid
it_behaves_like
'correct behavior on KubernetesService and Platform::Kubernetes'
end
expect
(
response
.
location
).
to
include
(
project_new_blob_path
(
project
,
branch
))
expect
(
response
).
to
have_gitlab_http_status
(
302
)
context
'when user configured kubernetes from CI/CD > Clusters'
do
before
do
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
end
it_behaves_like
'correct behavior on KubernetesService and Platform::Kubernetes'
end
end
...
...
spec/features/auto_deploy_spec.rb
View file @
53da3d97
...
...
@@ -4,13 +4,7 @@ describe 'Auto deploy' do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:repository
)
}
context
'when user configured kubernetes from Integration > Kubernetes'
do
before
do
create
:kubernetes_service
,
project:
project
project
.
team
<<
[
user
,
:master
]
sign_in
user
end
shared_examples
'correct behavior on KubernetesService and Platform::Kubernetes'
do
context
'when no deployment service is active'
do
before
do
project
.
kubernetes_service
.
update!
(
active:
false
)
...
...
@@ -55,54 +49,23 @@ describe 'Auto deploy' do
end
end
context
'when user configured kubernetes from
CI/CD > Cluster
s'
do
context
'when user configured kubernetes from
Integration > Kubernete
s'
do
before
do
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
create
:kubernetes_service
,
project:
project
project
.
team
<<
[
user
,
:master
]
sign_in
user
end
context
'when no deployment service is active'
do
before
do
project
.
kubernetes_service
.
update!
(
active:
false
)
end
it_behaves_like
'correct behavior on KubernetesService and Platform::Kubernetes'
end
it
'does not show a button to set up auto deploy'
do
visit
project_path
(
project
)
expect
(
page
).
to
have_no_content
(
'Set up auto deploy'
)
end
context
'when user configured kubernetes from CI/CD > Clusters'
do
before
do
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
project
.
team
<<
[
user
,
:master
]
sign_in
user
end
context
'when a deployment service is active'
do
before
do
project
.
kubernetes_service
.
update!
(
active:
true
)
visit
project_path
(
project
)
end
it
'shows a button to set up auto deploy'
do
expect
(
page
).
to
have_link
(
'Set up auto deploy'
)
end
it
'includes OpenShift as an available template'
,
:js
do
click_link
'Set up auto deploy'
click_button
'Apply a GitLab CI Yaml template'
within
'.gitlab-ci-yml-selector'
do
expect
(
page
).
to
have_content
(
'OpenShift'
)
end
end
it
'creates a merge request using "auto-deploy" branch'
,
:js
do
click_link
'Set up auto deploy'
click_button
'Apply a GitLab CI Yaml template'
within
'.gitlab-ci-yml-selector'
do
click_on
'OpenShift'
end
wait_for_requests
click_button
'Commit changes'
expect
(
page
).
to
have_content
(
'New Merge Request From auto-deploy into master'
)
end
end
it_behaves_like
'correct behavior on KubernetesService and Platform::Kubernetes'
end
end
spec/features/projects/clusters/interchangeability_spec.rb
View file @
53da3d97
require
'spec_helper'
feature
'Interchangeability between KubernetesService and Platform::Kubernetes'
do
let!
(
:project
)
{
create
(
:project
,
:repository
)
}
EXCEPT_METHODS
=
%i[test title description help fields initialize_properties namespace namespace= api_url api_url=]
EXCEPT_METHODS_GREP_V
=
%w[_touched? _changed? _was]
...
...
@@ -15,31 +13,4 @@ feature 'Interchangeability between KubernetesService and Platform::Kubernetes'
expect
(
expected_interfaces
-
Clusters
::
Platforms
::
Kubernetes
.
instance_methods
).
to
be_empty
end
shared_examples
'selects kubernetes instance'
do
context
'when user configured kubernetes from Integration > Kubernetes'
do
let!
(
:kubernetes_service
)
{
create
(
:kubernetes_service
,
project:
project
)
}
it
{
is_expected
.
to
eq
(
kubernetes_service
)
}
end
context
'when user configured kubernetes from CI/CD > Clusters'
do
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
let
(
:platform_kubernetes
)
{
cluster
.
platform_kubernetes
}
it
{
is_expected
.
to
eq
(
platform_kubernetes
)
}
end
end
describe
'Project#deployment_service'
do
subject
{
project
.
deployment_service
}
it_behaves_like
'selects kubernetes instance'
end
describe
'Project#kubernetes_service'
do
subject
{
project
.
kubernetes_service
}
it_behaves_like
'selects kubernetes instance'
end
end
spec/models/clusters/platforms/kubernetes_spec.rb
View file @
53da3d97
...
...
@@ -93,52 +93,52 @@ describe Clusters::Platforms::Kubernetes, :use_clean_rails_memory_store_caching
end
describe
'after_save from Clusters::Cluster'
do
context
'when platform_kubernetes is being cerated'
do
let
(
:enabled
)
{
true
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:cluster
)
{
build
(
:cluster
,
provider_type: :gcp
,
platform_type: :kubernetes
,
platform_kubernetes:
platform
,
provider_gcp:
provider
,
enabled:
enabled
,
projects:
[
project
])
}
let
(
:platform
)
{
build
(
:cluster_platform_kubernetes
,
:configured
)
}
let
(
:provider
)
{
build
(
:cluster_provider_gcp
)
}
let
(
:kubernetes_service
)
{
project
.
kubernetes_service
}
it
'updates KubernetesService'
do
cluster
.
save!
expect
(
kubernetes_service
.
active
).
to
eq
(
enabled
)
expect
(
kubernetes_service
.
api_url
).
to
eq
(
platform
.
api_url
)
expect
(
kubernetes_service
.
namespace
).
to
eq
(
platform
.
namespace
)
expect
(
kubernetes_service
.
ca_pem
).
to
eq
(
platform
.
ca_cert
)
end
end
context
'when platform_kubernetes has been created'
do
let
(
:enabled
)
{
false
}
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
let
(
:platform
)
{
cluster
.
platform
}
let
(
:kubernetes_service
)
{
project
.
kubernetes_service
}
it
'updates KubernetesService'
do
cluster
.
update
(
enabled:
enabled
)
expect
(
kubernetes_service
.
active
).
to
eq
(
enabled
)
end
end
context
'when kubernetes_service has been configured without cluster integration'
do
let!
(
:project
)
{
create
(
:project
)
}
let
(
:cluster
)
{
build
(
:cluster
,
provider_type: :gcp
,
platform_type: :kubernetes
,
platform_kubernetes:
platform
,
provider_gcp:
provider
,
projects:
[
project
])
}
let
(
:platform
)
{
build
(
:cluster_platform_kubernetes
,
:configured
,
api_url:
'https://111.111.111.111'
)
}
let
(
:provider
)
{
build
(
:cluster_provider_gcp
)
}
before
do
create
(
:kubernetes_service
,
project:
project
)
end
it
'raises an error'
do
expect
{
cluster
.
save!
}.
to
raise_error
(
'Kubernetes service already configured'
)
end
end
#
context 'when platform_kubernetes is being cerated' do
#
let(:enabled) { true }
#
let(:project) { create(:project) }
#
let(:cluster) { build(:cluster, provider_type: :gcp, platform_type: :kubernetes, platform_kubernetes: platform, provider_gcp: provider, enabled: enabled, projects: [project]) }
#
let(:platform) { build(:cluster_platform_kubernetes, :configured) }
#
let(:provider) { build(:cluster_provider_gcp) }
#
let(:kubernetes_service) { project.kubernetes_service }
#
it 'updates KubernetesService' do
#
cluster.save!
#
expect(kubernetes_service.active).to eq(enabled)
#
expect(kubernetes_service.api_url).to eq(platform.api_url)
#
expect(kubernetes_service.namespace).to eq(platform.namespace)
#
expect(kubernetes_service.ca_pem).to eq(platform.ca_cert)
#
end
#
end
#
context 'when platform_kubernetes has been created' do
#
let(:enabled) { false }
#
let!(:project) { create(:project) }
#
let!(:cluster) { create(:cluster, :provided_by_gcp, projects: [project]) }
#
let(:platform) { cluster.platform }
#
let(:kubernetes_service) { project.kubernetes_service }
#
it 'updates KubernetesService' do
#
cluster.update(enabled: enabled)
#
expect(kubernetes_service.active).to eq(enabled)
#
end
#
end
#
context 'when kubernetes_service has been configured without cluster integration' do
#
let!(:project) { create(:project) }
#
let(:cluster) { build(:cluster, provider_type: :gcp, platform_type: :kubernetes, platform_kubernetes: platform, provider_gcp: provider, projects: [project]) }
#
let(:platform) { build(:cluster_platform_kubernetes, :configured, api_url: 'https://111.111.111.111') }
#
let(:provider) { build(:cluster_provider_gcp) }
#
before do
#
create(:kubernetes_service, project: project)
#
end
#
it 'raises an error' do
#
expect { cluster.save! }.to raise_error('Kubernetes service already configured')
#
end
#
end
end
describe
'#actual_namespace'
do
...
...
spec/models/environment_spec.rb
View file @
53da3d97
...
...
@@ -369,7 +369,6 @@ describe Environment do
end
describe
'#terminals'
do
let
(
:project
)
{
create
(
:kubernetes_project
)
}
subject
{
environment
.
terminals
}
context
'when the environment has terminals'
do
...
...
@@ -377,12 +376,27 @@ describe Environment do
allow
(
environment
).
to
receive
(
:has_terminals?
).
and_return
(
true
)
end
it
'returns the terminals from the deployment service'
do
expect
(
project
.
deployment_service
)
.
to
receive
(
:terminals
).
with
(
environment
)
.
and_return
(
:fake_terminals
)
shared_examples
'correct behavior on 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
)
is_expected
.
to
eq
(
:fake_terminals
)
end
end
context
'when user configured kubernetes from Integration > Kubernetes'
do
let
(
:project
)
{
create
(
:kubernetes_project
)
}
it_behaves_like
'correct behavior on 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
'correct behavior on KubernetesService and Platform::Kubernetes'
end
end
...
...
spec/models/project_services/kubernetes_service_spec.rb
View file @
53da3d97
...
...
@@ -5,7 +5,7 @@ describe KubernetesService, :use_clean_rails_memory_store_caching do
include
ReactiveCachingHelpers
let
(
:project
)
{
build_stubbed
(
:kubernetes_project
)
}
let
(
:service
)
{
project
.
kubernetes_service
}
let
(
:service
)
{
project
.
deployment_platform
}
describe
'Associations'
do
it
{
is_expected
.
to
belong_to
:project
}
...
...
spec/models/project_spec.rb
View file @
53da3d97
...
...
@@ -2002,10 +2002,10 @@ describe Project do
end
context
'when project has a deployment service'
do
shared_examples
'correct behavior
with variabl
es'
do
shared_examples
'correct behavior
on KubernetesService and Platform::Kubernet
es'
do
it
'returns variables from this service'
do
expect
(
project
.
deployment_variables
).
to
include
(
{
key:
'KUBE_TOKEN'
,
value:
project
.
kubernetes_service
.
token
,
public:
false
}
{
key:
'KUBE_TOKEN'
,
value:
project
.
deployment_platform
.
token
,
public:
false
}
)
end
end
...
...
@@ -2013,14 +2013,14 @@ describe Project do
context
'when user configured kubernetes from Integration > Kubernetes'
do
let
(
:project
)
{
create
(
:kubernetes_project
)
}
it_behaves_like
'correct behavior
with variabl
es'
it_behaves_like
'correct behavior
on KubernetesService and Platform::Kubernet
es'
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
'correct behavior
with variabl
es'
it_behaves_like
'correct behavior
on KubernetesService and Platform::Kubernet
es'
end
end
end
...
...
@@ -3096,4 +3096,21 @@ describe Project do
expect
(
project
.
wiki_repository_exists?
).
to
eq
(
false
)
end
end
describe
'#deployment_platform'
do
subject
{
project
.
deployment_platform
}
context
'when user configured kubernetes from Integration > Kubernetes'
do
let!
(
:kubernetes_service
)
{
create
(
:kubernetes_service
,
project:
project
)
}
it
{
is_expected
.
to
eq
(
kubernetes_service
)
}
end
context
'when user configured kubernetes from CI/CD > Clusters'
do
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
let
(
:platform_kubernetes
)
{
cluster
.
platform_kubernetes
}
it
{
is_expected
.
to
eq
(
platform_kubernetes
)
}
end
end
end
spec/support/prometheus/additional_metrics_shared_examples.rb
View file @
53da3d97
...
...
@@ -43,7 +43,7 @@ RSpec.shared_examples 'additional metrics query' do
describe
'project has Kubernetes service'
do
shared_examples
'correct behavior with metrics'
do
let
(
:environment
)
{
create
(
:environment
,
slug:
'environment-slug'
,
project:
project
)
}
let
(
:kube_namespace
)
{
project
.
kubernetes_service
.
actual_namespace
}
let
(
:kube_namespace
)
{
project
.
deployment_platform
.
actual_namespace
}
it_behaves_like
'query context containing environment slug and filter'
...
...
spec/workers/reactive_caching_worker_spec.rb
View file @
53da3d97
require
'spec_helper'
describe
ReactiveCachingWorker
do
let
(
:service
)
{
project
.
deployment_
service
}
let
(
:service
)
{
project
.
deployment_
platform
}
subject
{
described_class
.
new
.
perform
(
"KubernetesService"
,
service
.
id
)
}
describe
'#perform'
do
...
...
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