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

Direct Known Subclasses

Preprod, Production, Staging

Instance Method Summary collapse

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

perform

Instance Method Details

#deployment_componentObject

Raises:

  • (NotImplementedError)


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

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

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



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
# File 'lib/gitlab/qa/scenario/test/instance/deployment_base.rb', line 10

def perform(release_name = nil, *args)
  Runtime::Env.require_no_license!

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

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

  if release.dev_gitlab_org?
    Docker::Command.execute(
      [
        'login',
        '--username gitlab-qa-bot',
        %(--password "#{Runtime::Env.dev_access_token_variable}"),
        Release::DEV_REGISTRY
      ]
    )
  end

  Component::Specs.perform do |specs|
    specs.suite = 'Test::Instance::All'
    specs.release = release
    specs.args = [deployment_component::ADDRESS, *args]
  end
end