Sha256: 2cf3c216a273b73c32212d85535bcfcf63732111e47d52965d893e26b174743b

Contents?: true

Size: 1.91 KB

Versions: 17

Compression:

Stored size: 1.91 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 = Runtime::Env.docker_network
              @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

17 entries across 17 versions & 1 rubygems

Version Path
gitlab-qa-15.3.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-15.2.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-15.1.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-15.0.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.21.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.20.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.19.2 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.19.1 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.19.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.18.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.17.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.16.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.15.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.14.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.13.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.12.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
gitlab-qa-14.11.0 lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb