Class: Gitlab::QA::Scenario::Test::Integration::SuggestedReviewer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

perform

Constructor Details

#initializeSuggestedReviewer

Returns a new instance of SuggestedReviewer.



11
12
13
14
15
16
17
# File 'lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb', line 11

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

Instance Attribute Details

#spec_suiteObject (readonly)

Returns the value of attribute spec_suite.



9
10
11
# File 'lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb', line 9

def spec_suite
  @spec_suite
end

Instance Method Details

#perform(release, *rspec_args) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb', line 19

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

#suggested_reviewer_clusterObject



50
51
52
53
54
55
56
# File 'lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb', line 50

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