Class: Gitlab::QA::Runner
- Inherits:
-
Object
- Object
- Gitlab::QA::Runner
- Defined in:
- lib/gitlab/qa/runner.rb
Constant Summary collapse
- PASS_THROUGH_OPTS =
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
[ ['--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'], ['--loop', 'Execute tests in a loop'] ].freeze
Class Method Summary collapse
-
.run(args) ⇒ Object
rubocop:disable Metrics/AbcSize.
Class Method Details
.run(args) ⇒ Object
rubocop:disable Metrics/AbcSize
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/gitlab/qa/runner.rb', line 17 def self.run(args) = {} = OptionParser.new do |opts| opts. = 'Usage: gitlab-qa [options] Scenario URL [[--] path] [rspec_options]' PASS_THROUGH_OPTS.each do |opt| opts.on(*opt) end opts.on('--prepare-stage-reports FILES', 'Prepare separate reports for each Stage from the provided JUnit XML files') do |files| [:prepare_stage_reports] = true [:input_files] = files if files 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 if [:prepare_stage_reports] .delete(:prepare_stage_reports) Gitlab::QA::Report::PrepareStageReports.new(**).invoke! exit end Scenario .const_get(args.shift) .perform(*args) else puts exit 1 end end |