Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cluster_configure_istio_worker_spec.rb « workers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5d949fde9734439095b4c6a133d9c07ad0909a18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe ClusterConfigureIstioWorker do
  describe '#perform' do
    shared_examples 'configure istio service' do
      it 'configures istio' do
        expect_any_instance_of(Clusters::Kubernetes::ConfigureIstioIngressService).to receive(:execute)

        described_class.new.perform(cluster.id)
      end
    end

    context 'when provider type is gcp' do
      let(:cluster) { create(:cluster, :project, :provided_by_gcp) }

      it_behaves_like 'configure istio service'
    end

    context 'when provider type is aws' do
      let(:cluster) { create(:cluster, :project, :provided_by_aws) }

      it_behaves_like 'configure istio service'
    end

    context 'when provider type is user' do
      let(:cluster) { create(:cluster, :project, :provided_by_user) }

      it_behaves_like 'configure istio service'
    end

    context 'when cluster does not exist' do
      it 'does not provision a cluster' do
        expect_any_instance_of(Clusters::Kubernetes::ConfigureIstioIngressService).not_to receive(:execute)

        described_class.new.perform(123)
      end
    end
  end
end