Class: Gitlab::QA::Report::RelateFailureIssue

Inherits:
ReportAsIssue show all
Includes:
FindSetDri
Defined in:
lib/gitlab/qa/report/relate_failure_issue.rb

Overview

Uses the API to create or update GitLab issues with the results of tests from RSpec report files.

Constant Summary collapse

DEFAULT_MAX_DIFF_RATIO_FOR_DETECTION =
0.15
FAILURE_STACKTRACE_REGEX =
%r{((.*Failure\/Error:(?<stacktrace>.+))|(?<stacktrace>.+))}m.freeze
ISSUE_STACKTRACE_REGEX =
/### Stack trace\s*(```)#{FAILURE_STACKTRACE_REGEX}(```)/m.freeze
NEW_ISSUE_LABELS =
Set.new(%w[QA Quality test failure::new priority::2]).freeze
IGNORE_EXCEPTIONS =
['Net::ReadTimeout'].freeze
MultipleIssuesFound =
Class.new(StandardError)

Constants inherited from ReportAsIssue

Gitlab::QA::Report::ReportAsIssue::MAX_TITLE_LENGTH

Instance Method Summary collapse

Methods included from FindSetDri

#set_dri_via_group

Methods inherited from ReportAsIssue

#invoke!

Constructor Details

#initialize(max_diff_ratio: DEFAULT_MAX_DIFF_RATIO_FOR_DETECTION, **kwargs) ⇒ RelateFailureIssue

Returns a new instance of RelateFailureIssue.



23
24
25
26
27
28
# File 'lib/gitlab/qa/report/relate_failure_issue.rb', line 23

def initialize(max_diff_ratio: DEFAULT_MAX_DIFF_RATIO_FOR_DETECTION, **kwargs)
  super
  @max_diff_ratio = max_diff_ratio.to_f
  @issue_type = 'issue'
  @commented_issue_list = Set.new
end