Sha256: 6f40bcdb60076736c3803c80097ebea460bc481273a6f381bff8f7f24e70b8ff

Contents?: true

Size: 1.74 KB

Versions: 29

Compression:

Stored size: 1.74 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, 'JSON rspec-retry report files') 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('--base-issue-labels BASE_ISSUE_LABELS', String,
    'Comma-separated labels (without tilde) to add to new flaky test issues') do |base_issue_labels|
    params[:base_issue_labels] = base_issue_labels.split(',')
  end

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

  opts.on('-r', '--related-issues-file RELATED_ISSUES_FILE', String, 'The file path for the related issues') do |related_issues_file|
    params[:related_issues_file] = related_issues_file
  end

  opts.on('--dry-run', "Perform a dry-run (don't create issues)") 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: Create flaky test issues for any passed test coming from rspec-retry JSON report files."
    puts opts
    exit
  end

  opts.parse(ARGV)
end

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

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
gitlab_quality-test_tooling-2.2.0 exe/flaky-test-issues
gitlab_quality-test_tooling-2.1.0 exe/flaky-test-issues
gitlab_quality-test_tooling-2.0.0 exe/flaky-test-issues
gitlab_quality-test_tooling-1.39.0 exe/flaky-test-issues
gitlab_quality-test_tooling-1.38.1 exe/flaky-test-issues
gitlab_quality-test_tooling-1.38.0 exe/flaky-test-issues
gitlab_quality-test_tooling-1.37.0 exe/flaky-test-issues
gitlab_quality-test_tooling-1.36.0 exe/flaky-test-issues
gitlab_quality-test_tooling-1.35.0 exe/flaky-test-issues
gitlab_quality-test_tooling-1.34.0 exe/flaky-test-issues
gitlab_quality-test_tooling-1.33.0 exe/flaky-test-issues
gitlab_quality-test_tooling-1.32.1 exe/flaky-test-issues
gitlab_quality-test_tooling-1.32.0 exe/flaky-test-issues
gitlab_quality-test_tooling-1.31.0 exe/flaky-test-issues
gitlab_quality-test_tooling-1.30.0 exe/flaky-test-issues
gitlab_quality-test_tooling-1.29.1 exe/flaky-test-issues
gitlab_quality-test_tooling-1.29.0 exe/flaky-test-issues
gitlab_quality-test_tooling-1.28.0 exe/flaky-test-issues
gitlab_quality-test_tooling-1.24.0 exe/flaky-test-issues
gitlab_quality-test_tooling-1.23.0 exe/flaky-test-issues