diff options
author | James Fargher <proglottis@gmail.com> | 2019-06-18 03:01:56 +0300 |
---|---|---|
committer | Thong Kuah <tkuah@gitlab.com> | 2019-06-18 03:01:56 +0300 |
commit | 6b9157d5dc9b45cc6d70f10d075bbf149af5f266 (patch) | |
tree | 29161152edd2c8cfbf1e4097beced805cdd47a72 /spec/features/projects | |
parent | 04307096bcc776259d8080bebd688ff6073d07c4 (diff) |
Make KubernetesService readonly
We are deprecating this service in favor of instance wide clusters.
Therefore we removed some code that is not anymore needed for a
readonly cluster and also we added some flags to allow for this
deprecation. These flags are to be removed in the next release when
we finally completelly remove KubernetesService.
Diffstat (limited to 'spec/features/projects')
3 files changed, 8 insertions, 44 deletions
diff --git a/spec/features/projects/clusters/interchangeability_spec.rb b/spec/features/projects/clusters/interchangeability_spec.rb deleted file mode 100644 index 0033e12b6b1..00000000000 --- a/spec/features/projects/clusters/interchangeability_spec.rb +++ /dev/null @@ -1,16 +0,0 @@ -require 'spec_helper' - -describe 'Interchangeability between KubernetesService and Platform::Kubernetes' do - EXCEPT_METHODS = %i[test title description help fields initialize_properties namespace namespace= api_url api_url= deprecated? deprecation_message].freeze - EXCEPT_METHODS_GREP_V = %w[_touched? _changed? _was].freeze - - it 'Clusters::Platform::Kubernetes covers core interfaces in KubernetesService' do - expected_interfaces = KubernetesService.instance_methods(false) - expected_interfaces = expected_interfaces - EXCEPT_METHODS - EXCEPT_METHODS_GREP_V.each do |g| - expected_interfaces = expected_interfaces.grep_v(/#{Regexp.escape(g)}\z/) - end - - expect(expected_interfaces - Clusters::Platforms::Kubernetes.instance_methods).to be_empty - end -end diff --git a/spec/features/projects/environments/environment_spec.rb b/spec/features/projects/environments/environment_spec.rb index da4ef6428d4..fbaf12be64e 100644 --- a/spec/features/projects/environments/environment_spec.rb +++ b/spec/features/projects/environments/environment_spec.rb @@ -155,7 +155,10 @@ describe 'Environment' do end context 'with terminal' do - shared_examples 'same behavior between KubernetesService and Platform::Kubernetes' do + context 'when user configured kubernetes from CI/CD > Clusters' do + let!(:cluster) { create(:cluster, :project, :provided_by_gcp) } + let(:project) { cluster.project } + context 'for project maintainer' do let(:role) { :maintainer } @@ -191,19 +194,6 @@ describe 'Environment' do end end end - - context 'when user configured kubernetes from Integration > Kubernetes' do - let(:project) { create(:kubernetes_project, :test_repo) } - - 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' - end end context 'when environment is available' do diff --git a/spec/features/projects/environments/environments_spec.rb b/spec/features/projects/environments/environments_spec.rb index 7b7e45312d9..1b5d9083932 100644 --- a/spec/features/projects/environments/environments_spec.rb +++ b/spec/features/projects/environments/environments_spec.rb @@ -248,7 +248,10 @@ describe 'Environments page', :js do end context 'when kubernetes terminal is available' do - shared_examples 'same behavior between KubernetesService and Platform::Kubernetes' do + context 'when user configured kubernetes from CI/CD > Clusters' do + let(:cluster) { create(:cluster, :provided_by_gcp, projects: [create(:project, :repository)]) } + let(:project) { cluster.project } + context 'for project maintainer' do let(:role) { :maintainer } @@ -265,19 +268,6 @@ describe 'Environments page', :js do end end end - - context 'when user configured kubernetes from Integration > Kubernetes' do - let(:project) { create(:kubernetes_project, :test_repo) } - - 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, :provided_by_gcp, projects: [create(:project, :repository)]) } - let(:project) { cluster.project } - - it_behaves_like 'same behavior between KubernetesService and Platform::Kubernetes' - end end end |