Class: Gitlab::QA::Component::SuggestedReviewer
- Inherits:
-
Object
- Object
- Gitlab::QA::Component::SuggestedReviewer
- Includes:
- Scenario::Actable
- Defined in:
- lib/gitlab/qa/component/suggested_reviewer.rb
Constant Summary collapse
- MANIFESTS_PATH =
File.('../../../../support/manifests/suggested_reviewer', __dir__)
Instance Method Summary collapse
- #create_cluster ⇒ Object
- #deploy_services ⇒ Object
-
#initialize ⇒ SuggestedReviewer
constructor
A new instance of SuggestedReviewer.
- #name ⇒ Object
- #prepare ⇒ Object
- #teardown ⇒ Object
- #teardown? ⇒ Boolean
- #wait_until_ready ⇒ Object
Methods included from Scenario::Actable
Constructor Details
#initialize ⇒ SuggestedReviewer
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_cluster ⇒ Object
24 25 26 |
# File 'lib/gitlab/qa/component/suggested_reviewer.rb', line 24 def create_cluster @cluster.create! end |
#deploy_services ⇒ Object
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 |
#name ⇒ Object
16 17 18 |
# File 'lib/gitlab/qa/component/suggested_reviewer.rb', line 16 def name @name ||= "suggested_reviewer" end |
#prepare ⇒ Object
20 21 22 |
# File 'lib/gitlab/qa/component/suggested_reviewer.rb', line 20 def prepare @cluster.create_registry_mirror end |
#teardown ⇒ Object
35 36 37 |
# File 'lib/gitlab/qa/component/suggested_reviewer.rb', line 35 def teardown @cluster.remove! end |
#teardown? ⇒ 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_ready ⇒ Object
39 |
# File 'lib/gitlab/qa/component/suggested_reviewer.rb', line 39 def wait_until_ready; end |