summaryrefslogtreecommitdiff
path: root/qa/qa/scenario/entrypoint.rb
blob: 6d205cc6e2fd551eff3060c211d2e258f28a923e (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
module QA
  module Scenario
    ##
    # Run test suite against any GitLab instance,
    # including staging and on-premises installation.
    #
    class Entrypoint < Template
      def self.tags(*tags)
        @tags = tags
      end

      def self.tag_switches
        @tags.map { |tag| ['-t', tag.to_s] }
      end

      def perform(address, *files)
        Specs::Config.perform do |specs|
          specs.address = address
        end

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

        Specs::Runner.perform do |specs|
          specs.rspec('--tty', self.class.tag_switches, files.any? ? files : 'qa/specs/features')
        end
      end
    end
  end
end