Welcome to mirror list, hosted at ThFree Co, Russian Federation.

instance.rb « test « scenario « qa « qa - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b4098619e4e9c25830abcfb00efe5b60345176e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# frozen_string_literal: true

module QA
  module Scenario
    module Test
      # This class exists for back-compatibility so that gitlab-qa can continue
      # to call Test::Instance instead of Test::Instance::All until at least
      # the current latest GitLab version has the Test::Instance::All class.
      # As of Aug, 22nd 2018. Only GitLab >= 11.3 has this class.
      module Instance
        include Bootable

        def self.perform(*args)
          self.tap do |scenario|
            yield scenario if block_given?
            break scenario.do_perform(*args)
          end
        end

        def self.do_perform(address, *rspec_options)
          Runtime::Scenario.define(:gitlab_address, address)

          ##
          # Perform before hooks, which are different for CE and EE
          #
          Runtime::Release.perform_before_hooks

          Specs::Runner.perform do |specs|
            specs.tty = true
            specs.options = rspec_options if rspec_options.any?
          end
        end
      end
    end
  end
end