Sha256: b104cdd0bd770b3f16550286e8b9ec1f5492b54ed3d1423ec743c43f63ccd519

Contents?: true

Size: 1.89 KB

Versions: 64

Compression:

Stored size: 1.89 KB

Contents

# frozen_string_literal: true

module Gitlab
  module QA
    module Scenario
      module Test
        module Integration
          class SuggestedReviewer < Scenario::Template
            attr_reader :spec_suite

            def initialize
              @spec_suite = 'Test::Instance::All'
              @network = 'test'
              @env = {}
              @tag = 'suggested_reviewer'
              @gitlab_name = 'gitlab-suggested-reviewer'
            end

            def perform(release, *rspec_args)
              Component::Gitlab.perform do |gitlab|
                gitlab.release = QA::Release.new(release)
                gitlab.name = @gitlab_name
                gitlab.network = @network

                gitlab.instance do
                  # Wait for the suggested reviewer services to be ready before attempting to run specs
                  @cluster = suggested_reviewer_cluster
                  @cluster.wait_until_ready

                  Runtime::Logger.info('Running Suggested Reviewer 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
            ensure
              @cluster&.teardown if @cluster&.teardown?
            end

            def suggested_reviewer_cluster
              Component::SuggestedReviewer.new.tap do |sr|
                sr.prepare
                sr.create_cluster
                sr.deploy_services
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
gitlab-qa-14.9.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.8.1 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.8.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.7.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.6.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.5.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.4.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.3.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.2.1 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.2.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.1.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.0.2 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.0.1 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.0.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-13.2.1 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-13.2.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-13.1.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-13.0.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-12.5.1 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-12.5.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb