Sha256: 7175158c55ca63d4b397f429e46944c3a6f8b9151ed4bd48235f97e3af8709f0

Contents?: true

Size: 1.38 KB

Versions: 15

Compression:

Stored size: 1.38 KB

Contents

require 'optparse'

module Gitlab
  module QA
    class Runner
      # These options are implemented in the QA framework (i.e., in the CE/EE codebase)
      # They're included here so that gitlab-qa treats them as valid options
      PASS_THROUGH_OPTS = [
        ['--address URL', 'Address of the instance to test'],
        ['--enable-feature FEATURE_FLAG', 'Enable a feature before running tests'],
        ['--mattermost-address URL', 'Address of the Mattermost server'],
        ['--parallel', 'Execute tests in parallel']
      ].freeze

      # rubocop:disable Metrics/AbcSize
      def self.run(args)
        options = OptionParser.new do |opts|
          opts.banner = 'Usage: gitlab-qa [options] Scenario URL [[--] path] [rspec_options]'

          PASS_THROUGH_OPTS.each do |opt|
            opts.on(*opt)
          end

          opts.on_tail('-v', '--version', 'Show the version') do
            require 'gitlab/qa/version'
            puts "#{$PROGRAM_NAME} : #{VERSION}"
            exit
          end

          opts.on_tail('-h', '--help', 'Show the usage') do
            puts opts
            exit
          end

          opts.parse(args)
        end

        if args.size >= 1
          Scenario
            .const_get(args.shift)
            .perform(*args)
        else
          puts options
          exit 1
        end
      end
      # rubocop:enable Metrics/AbcSize
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
gitlab-qa-4.6.0 lib/gitlab/qa/runner.rb
gitlab-qa-4.5.0 lib/gitlab/qa/runner.rb
gitlab-qa-4.4.0 lib/gitlab/qa/runner.rb
gitlab-qa-4.3.3 lib/gitlab/qa/runner.rb
gitlab-qa-4.3.2 lib/gitlab/qa/runner.rb
gitlab-qa-4.2.2 lib/gitlab/qa/runner.rb
gitlab-qa-4.2.1 lib/gitlab/qa/runner.rb
gitlab-qa-4.2.0 lib/gitlab/qa/runner.rb
gitlab-qa-4.1.0 lib/gitlab/qa/runner.rb
gitlab-qa-4.0.5 lib/gitlab/qa/runner.rb
gitlab-qa-4.0.4 lib/gitlab/qa/runner.rb
gitlab-qa-4.0.3 lib/gitlab/qa/runner.rb
gitlab-qa-4.0.2 lib/gitlab/qa/runner.rb
gitlab-qa-4.0.1 lib/gitlab/qa/runner.rb
gitlab-qa-4.0.0 lib/gitlab/qa/runner.rb