Class: Gitlab::QA::Scenario::Test::Instance::DeploymentBase

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

Overview

Base class to be used to define deployment environment scenarios

Instance Method Summary collapse

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

perform

Constructor Details

#initializeDeploymentBase

Returns a new instance of DeploymentBase.



12
13
14
# File 'lib/gitlab/qa/scenario/test/instance/deployment_base.rb', line 12

def initialize
  @suite = 'Test::Instance::All'
end

Instance Method Details

#deployment_componentObject

Raises:

  • (NotImplementedError)


40
41
42
# File 'lib/gitlab/qa/scenario/test/instance/deployment_base.rb', line 40

def deployment_component
  raise NotImplementedError, 'Please define the Component for the deployment environment associated with this scenario.'
end

#host_knapsack_report_pathObject



44
45
46
# File 'lib/gitlab/qa/scenario/test/instance/deployment_base.rb', line 44

def host_knapsack_report_path
  ENV["QA_KNAPSACK_REPORT_PATH"]
end

#non_rspec_argsObject



36
37
38
# File 'lib/gitlab/qa/scenario/test/instance/deployment_base.rb', line 36

def non_rspec_args
  [deployment_component::ADDRESS]
end

#perform(release_name = nil, *args) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/gitlab/qa/scenario/test/instance/deployment_base.rb', line 16

def perform(release_name = nil, *args)
  # EE_LICENSE variable should be unset otherwise the existing license may be accidentially replaced
  Runtime::Env.require_no_license!

  release = if release_name.nil? || release_name.start_with?('--')
              deployment_component.release
            else
              QA::Release.new(release_name)
            end

  args.unshift(release_name) if release_name&.start_with?('--')

  Component::Specs.perform do |specs|
    specs.suite = @suite
    specs.release = release
    specs.args = non_rspec_args.push(*args)
    specs.volumes[host_knapsack_report_path] = "/home/gitlab/qa/knapsack" if host_knapsack_report_path
  end
end