Class: Gitlab::QA::Scenario::Test::Integration::GitalyCluster

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

Direct Known Subclasses

Praefect

Instance Attribute Summary collapse

Instance Method Summary collapse

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

perform

Constructor Details

#initializeGitalyCluster

Returns a new instance of GitalyCluster.



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

def initialize
  @spec_suite = 'Test::Instance::All'
  @env = {}
  @tag = 'gitaly_cluster'
  @config = Component::GitalyCluster::GitalyClusterConfig.new
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



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

def config
  @config
end

#gitlab_nameObject (readonly)

Returns the value of attribute gitlab_name.



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

def gitlab_name
  @gitlab_name
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#spec_suiteObject (readonly)

Returns the value of attribute spec_suite.



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

def spec_suite
  @spec_suite
end

Instance Method Details

#perform(release, *rspec_args) ⇒ Object



18
19
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
45
46
# File 'lib/gitlab/qa/scenario/test/integration/gitaly_cluster.rb', line 18

def perform(release, *rspec_args)
  Component::Gitlab.perform do |gitlab|
    gitlab.release = QA::Release.new(release)
    gitlab.name = config.gitlab_name
    gitlab.network = config.network
    gitlab.omnibus_configuration << gitlab_omnibus_configuration
    cluster = Component::GitalyCluster.perform do |cluster|
      cluster.release = release
      cluster.instance
    end
    gitlab.instance do
      cluster.join
      Runtime::Logger.info('Running Gitaly Cluster specs!')

      if @tag
        rspec_args << "--" unless rspec_args.include?('--')
        rspec_args << "--tag" << @tag
      end

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