Sha256: 4b573c801724522e6b17da05eba82813f805ac27027c3876026a6ba105ce6e9a

Contents?: true

Size: 1.58 KB

Versions: 1

Compression:

Stored size: 1.58 KB

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require "bundler/setup"
require "optparse"

require_relative "../lib/gitlab_quality/test_tooling"

params = {}

options = OptionParser.new do |opts|
  opts.banner = "Usage: #{$PROGRAM_NAME} [options]"

  opts.on('-i', '--input-files INPUT_FILES', String, 'RSpec report files (JSON or JUnit XML)') do |input_files|
    params[:input_files] = input_files
  end

  opts.on('-p', '--project PROJECT', String, 'Can be an integer or a group/project string') do |project|
    params[:project] = project
  end

  opts.on('-t', '--token TOKEN', String, 'A valid access token with `api` scope and Reporter permission in PROJECT') do |token|
    params[:token] = token
  end

  opts.on('-c', '--ci-project-token CI_PROJECT_TOKEN', String, 'A valid access token with `read_api` scope permission in current ENV["CI_PROJECT_ID"]') do |ci_project_token|
    params[:ci_project_token] = ci_project_token
  end

  opts.on('--dry-run', "Perform a dry-run (don't create or update issues or test cases)") do
    params[:dry_run] = true
  end

  opts.on_tail('-v', '--version', 'Show the version') do
    require_relative "../lib/gitlab_quality/test_tooling/version"
    puts "#{$PROGRAM_NAME} : #{GitlabQuality::TestTooling::VERSION}"
    exit
  end

  opts.on_tail('-h', '--help', 'Show the usage') do
    puts "Purpose: Generate test session report based on RSpec report files (JSON or JUnit XML)"
    puts opts
    exit
  end

  opts.parse(ARGV)
end

if params.any?
  GitlabQuality::TestTooling::Report::GenerateTestSession.new(**params).invoke!
else
  puts options
  exit 1
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gitlab_quality-test_tooling-0.3.0 exe/generate-test-session