gitlab_quality-test_tooling 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09db516b126bd859b0d15c2a02eafe9be450b362253248d017f30f8e22c83b22'
|
4
|
+
data.tar.gz: 42a2999e91fb42a288985212156daf500e99e38084b10207385773b0ed130a8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edb9ac2763c96f21fdf584a2002ba6522eb5c6a61bbc7ce604453c4d61d87fc7103489f2f386afa5e5d8ba660a4377796ca5cf57765f4848425fb194ce006737
|
7
|
+
data.tar.gz: 33fb7a6951bbdfec91b2be742a82dd91528ca2f27fbb346ae722bc93ad8505e5344e65d77f276445e89bb7c431e509b6841b9a7cdc26629fda7786f2704571ca
|
data/Gemfile.lock
CHANGED
@@ -60,10 +60,10 @@ module GitlabQuality
|
|
60
60
|
puts " => Searching issues for test '#{test.name}'..."
|
61
61
|
|
62
62
|
begin
|
63
|
-
issue =
|
64
|
-
return unless issue
|
63
|
+
issue, issue_already_commented = find_and_link_issue(test)
|
64
|
+
return create_issue(test) unless issue || test.quarantine?
|
65
65
|
|
66
|
-
update_labels(issue, test)
|
66
|
+
update_labels(issue, test) unless issue_already_commented
|
67
67
|
rescue MultipleIssuesFound => e
|
68
68
|
warn(e.message)
|
69
69
|
end
|
@@ -71,19 +71,22 @@ module GitlabQuality
|
|
71
71
|
|
72
72
|
def find_and_link_issue(test)
|
73
73
|
issue, diff_ratio = find_failure_issue(test)
|
74
|
-
|
74
|
+
return [false, true] unless issue
|
75
75
|
|
76
|
-
|
76
|
+
issue_already_commented = issue_already_commented?(issue)
|
77
|
+
if issue_already_commented
|
78
|
+
puts " => Failure already commented on issue."
|
79
|
+
else
|
77
80
|
puts " => Found issue #{issue.web_url} for test '#{test.name}' with a diff ratio of #{(diff_ratio * 100).round(2)}%."
|
78
81
|
post_or_update_failed_job_note(issue, test)
|
79
82
|
@commented_issue_list.add(issue.web_url)
|
80
|
-
else
|
81
|
-
puts " => Failure already commented on issue." if issue_already_commented
|
82
|
-
|
83
|
-
return false
|
84
83
|
end
|
85
84
|
|
86
|
-
issue
|
85
|
+
[issue, issue_already_commented]
|
86
|
+
end
|
87
|
+
|
88
|
+
def issue_already_commented?(issue)
|
89
|
+
@commented_issue_list.include?(issue.web_url)
|
87
90
|
end
|
88
91
|
|
89
92
|
def create_issue(test)
|
@@ -94,8 +97,11 @@ module GitlabQuality
|
|
94
97
|
puts " => Will not create new issue for this failing spec"
|
95
98
|
similar_issues.each do |similar_issue|
|
96
99
|
puts "Please check issue: #{similar_issue.web_url}"
|
97
|
-
|
98
|
-
|
100
|
+
|
101
|
+
unless existing_failure_note(similar_issue, test.ci_job_url)
|
102
|
+
gitlab.create_issue_note(iid: similar_issue.iid,
|
103
|
+
note: "This failed job is most likely related: #{test.ci_job_url}")
|
104
|
+
end
|
99
105
|
end
|
100
106
|
return
|
101
107
|
end
|
@@ -309,9 +315,9 @@ module GitlabQuality
|
|
309
315
|
"Failure in #{super}"
|
310
316
|
end
|
311
317
|
|
312
|
-
def existing_failure_note(issue)
|
318
|
+
def existing_failure_note(issue, content = "Failed most recently in")
|
313
319
|
gitlab.find_issue_notes(iid: issue.iid)&.find do |note|
|
314
|
-
note.body.include?(
|
320
|
+
note.body.include?(content)
|
315
321
|
end
|
316
322
|
end
|
317
323
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab_quality-test_tooling
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitLab Quality
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: climate_control
|