Sha256: 61f63c92d1c851b8035a96f596c65cadbab857a0a23ad28244bec4c47563f45e

Contents?: true

Size: 1.92 KB

Versions: 13

Compression:

Stored size: 1.92 KB

Contents

# frozen_string_literal: true

module Gitlab
  module QA
    module Scenario
      module Test
        module Integration
          class Elasticsearch < Scenario::Template
            attr_reader :gitlab_name, :spec_suite

            def initialize
              @gitlab_name = 'gitlab-elastic'
              @spec_suite = 'QA::EE::Scenario::Test::Integration::Elasticsearch'
            end

            def before_perform(release)
              raise ArgumentError, 'Elasticsearch is an EE only feature!' unless release.ee?
            end

            def perform(release, *rspec_args)
              release = QA::Release.new(release)
              before_perform(release)

              Component::Gitlab.perform do |gitlab|
                gitlab.release = release
                setup_elasticsearch_on gitlab

                Component::Elasticsearch.perform do |elastic|
                  elastic.network = Runtime::Env.docker_network
                  elastic.instance do
                    gitlab.instance do
                      Runtime::Logger.info("Running #{spec_suite} specs!")

                      Component::Specs.perform do |specs|
                        specs.suite = spec_suite
                        specs.release = gitlab.release
                        specs.network = gitlab.network
                        specs.args = [gitlab.address, *rspec_args]
                      end
                    end
                  end
                end
              end
            end

            def empty_index
              @empty_index ||= ["gitlab-rake gitlab:elastic:create_empty_index"]
            end

            def setup_elasticsearch_on(instance)
              instance.name = gitlab_name
              instance.network = Runtime::Env.docker_network
              instance.elastic_url = 'http://elastic68:9200'
              instance.exec_commands = empty_index
            end
          end
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
gitlab-qa-14.21.0 lib/gitlab/qa/scenario/test/integration/elasticsearch.rb
gitlab-qa-14.20.0 lib/gitlab/qa/scenario/test/integration/elasticsearch.rb
gitlab-qa-14.19.2 lib/gitlab/qa/scenario/test/integration/elasticsearch.rb
gitlab-qa-14.19.1 lib/gitlab/qa/scenario/test/integration/elasticsearch.rb
gitlab-qa-14.19.0 lib/gitlab/qa/scenario/test/integration/elasticsearch.rb
gitlab-qa-14.18.0 lib/gitlab/qa/scenario/test/integration/elasticsearch.rb
gitlab-qa-14.17.0 lib/gitlab/qa/scenario/test/integration/elasticsearch.rb
gitlab-qa-14.16.0 lib/gitlab/qa/scenario/test/integration/elasticsearch.rb
gitlab-qa-14.15.0 lib/gitlab/qa/scenario/test/integration/elasticsearch.rb
gitlab-qa-14.14.0 lib/gitlab/qa/scenario/test/integration/elasticsearch.rb
gitlab-qa-14.13.0 lib/gitlab/qa/scenario/test/integration/elasticsearch.rb
gitlab-qa-14.12.0 lib/gitlab/qa/scenario/test/integration/elasticsearch.rb
gitlab-qa-14.11.0 lib/gitlab/qa/scenario/test/integration/elasticsearch.rb