Class: GitlabQuality::TestTooling::Report::KnapsackReportIssue

Inherits:
ReportAsIssue
  • Object
show all
Includes:
Concerns::GroupAndCategoryLabels
Defined in:
lib/gitlab_quality/test_tooling/report/knapsack_report_issue.rb

Overview

Uses the API to create GitLab issues for spec run time exceeding Knapsack expectation

  • Takes the expected and actual Knapsack JSON reports from the knapsack output

  • Takes a project where issues should be created

  • For every test file reported with unexpectedly long run time:

    • Find issue by test file name, and if found:

      • Reopen issue if it already exists, but is closed

      • Update the issue with the new run time data

    • If not found:

      • Create a new issue with the run time data

Constant Summary collapse

NEW_ISSUE_LABELS =
Set.new([
  'test', 'automation:bot-authored', 'type::maintenance', 'maintenance::performance',
  'priority::3', 'severity::3', 'knapsack_report', 'suppress-contributor-links'
]).freeze
SEARCH_LABELS =
%w[test maintenance::performance knapsack_report].freeze
JOB_TIMEOUT_EPIC_URL =
'https://gitlab.com/groups/gitlab-org/quality/engineering-productivity/-/epics/19'

Constants included from Concerns::Utils

Concerns::Utils::MAX_TITLE_LENGTH

Instance Method Summary collapse

Methods included from Concerns::GroupAndCategoryLabels

#group_and_category_labels_for_test

Methods inherited from ReportAsIssue

#invoke!

Methods included from Concerns::Utils

#label_names_to_label_quick_action, #partial_file_path, #pipeline, #readable_duration, #search_safe, #title_from_test

Constructor Details

#initialize(token:, input_files:, expected_report:, project: nil, dry_run: false) ⇒ KnapsackReportIssue

Returns a new instance of KnapsackReportIssue.



26
27
28
29
30
# File 'lib/gitlab_quality/test_tooling/report/knapsack_report_issue.rb', line 26

def initialize(token:, input_files:, expected_report:, project: nil, dry_run: false)
  super

  @expected_report = expected_report
end