Sha256: 1ea8764d3c0b25408f4b756f5129851cba0649414171109762b3c846e17df2ca

Contents?: true

Size: 1.63 KB

Versions: 8

Compression:

Stored size: 1.63 KB

Contents

# frozen_string_literal: true

module Gitlab
  module QA
    module Scenario
      module Test
        module Instance
          ##
          # Base class to be used to define deployment environment scenarios
          #
          class DeploymentBase < Scenario::Template
            def initialize
              @suite = 'Test::Instance::All'
            end

            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

            def non_rspec_args
              [deployment_component::ADDRESS]
            end

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

            def host_knapsack_report_path
              ENV["QA_KNAPSACK_REPORT_PATH"]
            end
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
gitlab-qa-8.3.2 lib/gitlab/qa/scenario/test/instance/deployment_base.rb
gitlab-qa-8.3.1 lib/gitlab/qa/scenario/test/instance/deployment_base.rb
gitlab-qa-8.3.0 lib/gitlab/qa/scenario/test/instance/deployment_base.rb
gitlab-qa-8.2.0 lib/gitlab/qa/scenario/test/instance/deployment_base.rb
gitlab-qa-8.1.0 lib/gitlab/qa/scenario/test/instance/deployment_base.rb
gitlab-qa-8.0.0 lib/gitlab/qa/scenario/test/instance/deployment_base.rb
gitlab-qa-7.36.0 lib/gitlab/qa/scenario/test/instance/deployment_base.rb
gitlab-qa-7.35.0 lib/gitlab/qa/scenario/test/instance/deployment_base.rb