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

Inherits:
ReportAsIssue show all
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
MultipleIssuesFound =
Class.new(StandardError)

Constants inherited from ReportAsIssue

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

Instance Method Summary collapse

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.



19
20
21
22
23
24
# File 'lib/gitlab/qa/report/relate_failure_issue.rb', line 19

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