Class: Gitlab::QA::Scenario::Test::Integration::Elasticsearch

Inherits:
Gitlab::QA::Scenario::Template show all
Defined in:
lib/gitlab/qa/scenario/test/integration/elasticsearch.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Gitlab::QA::Scenario::Template

perform

Constructor Details

#initializeElasticsearch

Returns a new instance of Elasticsearch.



11
12
13
14
# File 'lib/gitlab/qa/scenario/test/integration/elasticsearch.rb', line 11

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

Instance Attribute Details

#gitlab_nameObject (readonly)

Returns the value of attribute gitlab_name.



9
10
11
# File 'lib/gitlab/qa/scenario/test/integration/elasticsearch.rb', line 9

def gitlab_name
  @gitlab_name
end

#spec_suiteObject (readonly)

Returns the value of attribute spec_suite.



9
10
11
# File 'lib/gitlab/qa/scenario/test/integration/elasticsearch.rb', line 9

def spec_suite
  @spec_suite
end

Instance Method Details

#before_perform(release) ⇒ Object

Raises:

  • (ArgumentError)


16
17
18
# File 'lib/gitlab/qa/scenario/test/integration/elasticsearch.rb', line 16

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

#empty_indexObject



46
47
48
# File 'lib/gitlab/qa/scenario/test/integration/elasticsearch.rb', line 46

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

#perform(release, *rspec_args) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/gitlab/qa/scenario/test/integration/elasticsearch.rb', line 20

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 = 'test'
      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

#setup_elasticsearch_on(instance) ⇒ Object



50
51
52
53
54
55
# File 'lib/gitlab/qa/scenario/test/integration/elasticsearch.rb', line 50

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