gitlab-qa 7.23.0 → 7.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2f7604899a14fd7faaae2ee398b5b0769df8dde4badfd2123fa27993b1a0cbda
4
- data.tar.gz: c3fea270e1583201349b1c73c10aab49a5db9c969714ab842ab21436155c8d96
3
+ metadata.gz: '099111f747da2553c13f0ad32cf6865a45324907cd8244bfb42ca15eec16108c'
4
+ data.tar.gz: 05b451d3a5217ae20a9a75aceac1d0b827771722011314055863944cbf6df829
5
5
  SHA512:
6
- metadata.gz: 404e72b88f829f186a99bf2302fa92161b5267494b6ac3e91209c19882da58f348814394a5c23f02edfa3462715bcc4b4b5e136d2bd13c1e5bfa6c475f164c6c
7
- data.tar.gz: f043de46cddd1b120fbd972224e4eef339b3b22acfd25e28e972e9407c93d38c65234d4c67049d517366b5bbf2b54177da5cc336615cdb1ee4af572c9ba9467c
6
+ metadata.gz: af14883ec9bbf29d306e3de0558f380de4703a1cc0d8a62f98f70297264d89344c30cb4143a2d8dfbed74c84fd346ed14594d8aa222a9aec6aa9e3edeb8e32ed
7
+ data.tar.gz: 35f8761799ba3ed8904d97f28b4a7da6255ceb57970c621b0f26e26e9e21ea7914ef8780bc79c911f6cbbc0e9645d68a6515335bca54f4f70e690c762af20286
@@ -12,7 +12,7 @@ module Gitlab
12
12
  DEFAULT_MAX_DIFF_RATIO_FOR_DETECTION = 0.15
13
13
  FAILURE_STACKTRACE_REGEX = %r{((.*Failure\/Error:(?<stacktrace>.+))|(?<stacktrace>.+))}m.freeze
14
14
  ISSUE_STACKTRACE_REGEX = /### Stack trace\s*(```)#{FAILURE_STACKTRACE_REGEX}(```)/m.freeze
15
- NEW_ISSUE_LABELS = Set.new(%w[QA Quality test failure::investigating priority::2]).freeze
15
+ NEW_ISSUE_LABELS = Set.new(%w[QA Quality test failure::new priority::2]).freeze
16
16
 
17
17
  MultipleIssuesFound = Class.new(StandardError)
18
18
 
@@ -35,41 +35,44 @@ module Gitlab
35
35
  test_results.each do |test|
36
36
  next if test.failures.empty?
37
37
 
38
- relate_test_to_issue(test)
38
+ relate_failure_to_issue(test)
39
39
  end
40
40
 
41
41
  test_results.write
42
42
  end
43
43
  end
44
44
 
45
- def relate_test_to_issue(test)
45
+ def relate_failure_to_issue(test)
46
46
  puts " => Searching issues for test '#{test.name}'..."
47
47
 
48
48
  begin
49
- issue = find_or_create_issue(test)
49
+ issue = find_and_link_issue(test) || create_issue(test)
50
50
  return unless issue
51
51
 
52
52
  update_labels(issue, test)
53
- post_failed_job_note(issue, test)
54
- puts " => Marked #{issue.web_url} as related to #{test.testcase}."
55
53
  rescue MultipleIssuesFound => e
56
54
  warn(e.message)
57
55
  end
58
56
  end
59
57
 
60
- def find_or_create_issue(test)
58
+ def find_and_link_issue(test)
61
59
  issue, diff_ratio = find_failure_issue(test)
62
60
 
63
61
  if issue
64
62
  puts " => Found issue #{issue.web_url} for test '#{test.name}' with a diff ratio of #{(diff_ratio * 100).round(2)}%."
65
- else
66
- issue = create_issue(test)
67
- puts "for test '#{test.name}'."
63
+ post_failed_job_note(issue, test)
68
64
  end
69
65
 
70
66
  issue
71
67
  end
72
68
 
69
+ def create_issue(test)
70
+ issue = super
71
+ puts "for test '#{test.name}'."
72
+
73
+ issue
74
+ end
75
+
73
76
  def failure_issues(test)
74
77
  gitlab.find_issues(options: { state: 'opened', labels: 'QA' }).select do |issue|
75
78
  issue_title = issue.title.strip
@@ -146,7 +149,8 @@ module Gitlab
146
149
  super + [
147
150
  "\n\n### Stack trace",
148
151
  "```\n#{test.failures.first['message_lines'].join("\n")}\n```",
149
- "First happened in #{test.ci_job_url}."
152
+ "First happened in #{test.ci_job_url}.",
153
+ "Related test case: #{test.testcase}."
150
154
  ].join("\n\n")
151
155
  end
152
156
 
@@ -159,7 +163,8 @@ module Gitlab
159
163
  end
160
164
 
161
165
  def post_failed_job_note(issue, test)
162
- gitlab.create_issue_note(iid: issue.iid, note: "/relate #{test.testcase}")
166
+ gitlab.create_issue_note(iid: issue.iid, note: "Failure occurred in #{pipeline} pipeline: #{test.ci_job_url}")
167
+ puts " => Linked #{test.ci_job_url} to #{issue.web_url}."
163
168
  end
164
169
 
165
170
  def new_issue_title(test)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  module QA
5
- VERSION = '7.23.0'
5
+ VERSION = '7.23.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-qa
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.23.0
4
+ version: 7.23.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitLab Quality
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-15 00:00:00.000000000 Z
11
+ date: 2022-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control