Class: Gitlab::QA::Component::SuggestedReviewer

Inherits:
Object
  • Object
show all
Includes:
Scenario::Actable
Defined in:
lib/gitlab/qa/component/suggested_reviewer.rb

Constant Summary collapse

MANIFESTS_PATH =
File.expand_path('../../../../support/manifests/suggested_reviewer', __dir__)

Instance Method Summary collapse

Methods included from Scenario::Actable

#act, included

Constructor Details

#initializeSuggestedReviewer

Returns a new instance of SuggestedReviewer.



12
13
14
# File 'lib/gitlab/qa/component/suggested_reviewer.rb', line 12

def initialize
  @cluster = Service::KubernetesCluster.new(provider_class: Service::ClusterProvider::K3d)
end

Instance Method Details

#create_clusterObject



24
25
26
# File 'lib/gitlab/qa/component/suggested_reviewer.rb', line 24

def create_cluster
  @cluster.create!
end

#deploy_servicesObject



28
29
30
31
32
33
# File 'lib/gitlab/qa/component/suggested_reviewer.rb', line 28

def deploy_services
  Dir.glob(File.join(MANIFESTS_PATH, '**/*')).each do |file|
    Runtime::Logger.info("Applying manifest #{file}")
    @cluster.apply_manifest(File.read(file))
  end
end

#nameObject



16
17
18
# File 'lib/gitlab/qa/component/suggested_reviewer.rb', line 16

def name
  @name ||= "suggested_reviewer"
end

#prepareObject



20
21
22
# File 'lib/gitlab/qa/component/suggested_reviewer.rb', line 20

def prepare
  @cluster.create_registry_mirror
end

#teardownObject



35
36
37
# File 'lib/gitlab/qa/component/suggested_reviewer.rb', line 35

def teardown
  @cluster.remove!
end

#teardown?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/gitlab/qa/component/suggested_reviewer.rb', line 41

def teardown?
  !Runtime::Scenario.attributes.include?(:teardown) || Runtime::Scenario.teardown
end

#wait_until_readyObject



39
# File 'lib/gitlab/qa/component/suggested_reviewer.rb', line 39

def wait_until_ready; end