gitlab_quality-test_tooling 2.7.0 → 2.9.0
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 +4 -4
- data/Gemfile.lock +2 -2
- data/lib/gitlab_quality/test_tooling/report/concerns/group_and_category_labels.rb +5 -11
- data/lib/gitlab_quality/test_tooling/report/concerns/utils.rb +4 -0
- data/lib/gitlab_quality/test_tooling/report/failed_test_issue.rb +9 -5
- data/lib/gitlab_quality/test_tooling/report/flaky_test_issue.rb +15 -7
- data/lib/gitlab_quality/test_tooling/report/health_problem_reporter.rb +18 -7
- data/lib/gitlab_quality/test_tooling/report/knapsack_report_issue.rb +4 -0
- data/lib/gitlab_quality/test_tooling/report/relate_failure_issue.rb +8 -4
- data/lib/gitlab_quality/test_tooling/report/report_as_issue.rb +3 -0
- data/lib/gitlab_quality/test_tooling/report/slow_test_issue.rb +11 -3
- data/lib/gitlab_quality/test_tooling/test_result/base_test_result.rb +2 -1
- data/lib/gitlab_quality/test_tooling/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 737a2e86ac9d3545cf1c5f5b9344fead1e03d12dd4a6fe0f9b7ed44b00f604e6
|
4
|
+
data.tar.gz: 99cac62fe8e0672f28930be527ad4ef73743ca8d63c5e59734f610e2e3624ca9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dac0023706ab1428abc046d6189e7c6df3ad684e4a7f70fcbed84633505c20a515e399e4050c3427584abceb1008e61908c9aacc5286f9dd74431d04e1423149
|
7
|
+
data.tar.gz: 876fa1ec99dcba949757b9f9073a4b118c4f98d877c1c2edfd3bcb55850cbf9de48683684de427536d13b21639d7f66aff98a552abe6d80ec1bd582db6385058
|
data/Gemfile.lock
CHANGED
@@ -5,20 +5,14 @@ module GitlabQuality
|
|
5
5
|
module Report
|
6
6
|
module Concerns
|
7
7
|
module GroupAndCategoryLabels
|
8
|
-
def
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
def new_issue_labels(test)
|
13
|
-
debug_line = ' => [DEBUG] '
|
14
|
-
debug_line += "product_group: #{test&.product_group}; " if test.respond_to?(:product_group)
|
15
|
-
debug_line += "feature_category: #{test&.feature_category}" if test.respond_to?(:feature_category)
|
16
|
-
puts debug_line
|
8
|
+
def group_and_category_labels_for_test(test)
|
9
|
+
labels_inference = GitlabQuality::TestTooling::LabelsInference.new
|
10
|
+
new_labels = Set.new
|
17
11
|
|
18
|
-
new_labels = self.class::NEW_ISSUE_LABELS
|
19
12
|
new_labels += labels_inference.infer_labels_from_product_group(test.product_group) if test.respond_to?(:product_group)
|
20
13
|
new_labels += labels_inference.infer_labels_from_feature_category(test.feature_category) if test.respond_to?(:feature_category)
|
21
|
-
|
14
|
+
|
15
|
+
new_labels
|
22
16
|
end
|
23
17
|
end
|
24
18
|
end
|
@@ -15,6 +15,10 @@ module GitlabQuality
|
|
15
15
|
"#{title[...MAX_TITLE_LENGTH - 3]}..."
|
16
16
|
end
|
17
17
|
|
18
|
+
def label_names_to_label_quick_action(label_names)
|
19
|
+
%(/label #{label_names.map { |label| %(~"#{label}") }.join(' ')})
|
20
|
+
end
|
21
|
+
|
18
22
|
def new_issue_title(test)
|
19
23
|
"[Test] #{partial_file_path(test.file)} | #{search_safe(test.name)}".strip
|
20
24
|
end
|
@@ -57,7 +57,7 @@ module GitlabQuality
|
|
57
57
|
current_reports_note = find_failure_discussion_note(issue: issue, test: test, reports_discussion: reports_discussion)
|
58
58
|
|
59
59
|
new_reports_list = new_reports_list(current_reports_note: current_reports_note, test: test)
|
60
|
-
note_body =
|
60
|
+
note_body = append_quick_actions_to_note(
|
61
61
|
new_reports_list: new_reports_list,
|
62
62
|
related_issues: related_issues,
|
63
63
|
options: {
|
@@ -105,6 +105,14 @@ module GitlabQuality
|
|
105
105
|
IDENTITY_LABELS
|
106
106
|
end
|
107
107
|
|
108
|
+
def new_issue_labels(test)
|
109
|
+
up_to_date_labels(test: test, new_labels: NEW_ISSUE_LABELS + group_and_category_labels_for_test(test))
|
110
|
+
end
|
111
|
+
|
112
|
+
def up_to_date_labels(test:, issue: nil, new_labels: Set.new)
|
113
|
+
(base_issue_labels + super).to_a
|
114
|
+
end
|
115
|
+
|
108
116
|
def report_section_header
|
109
117
|
REPORT_SECTION_HEADER
|
110
118
|
end
|
@@ -139,10 +147,6 @@ module GitlabQuality
|
|
139
147
|
quick_actions.join("\n")
|
140
148
|
end
|
141
149
|
|
142
|
-
def up_to_date_labels(test:, issue: nil, new_labels: Set.new)
|
143
|
-
(base_issue_labels + super).to_a
|
144
|
-
end
|
145
|
-
|
146
150
|
def find_failure_discussion_note(issue:, test:, reports_discussion:)
|
147
151
|
return unless reports_discussion
|
148
152
|
|
@@ -44,6 +44,14 @@ module GitlabQuality
|
|
44
44
|
IDENTITY_LABELS
|
45
45
|
end
|
46
46
|
|
47
|
+
def new_issue_labels(test)
|
48
|
+
up_to_date_labels(test: test, new_labels: NEW_ISSUE_LABELS)
|
49
|
+
end
|
50
|
+
|
51
|
+
def up_to_date_labels(test:, issue: nil, new_labels: Set.new)
|
52
|
+
(base_issue_labels + super).to_a
|
53
|
+
end
|
54
|
+
|
47
55
|
def report_section_header
|
48
56
|
REPORT_SECTION_HEADER
|
49
57
|
end
|
@@ -52,22 +60,22 @@ module GitlabQuality
|
|
52
60
|
REPORTS_DOCUMENTATION
|
53
61
|
end
|
54
62
|
|
55
|
-
def health_problem_status_label_quick_action(reports_list,
|
63
|
+
def health_problem_status_label_quick_action(reports_list, options: {})
|
56
64
|
case reports_list.reports_count
|
57
65
|
when 399..Float::INFINITY
|
58
|
-
'
|
66
|
+
label_names = Set.new(['flakiness::1'])
|
67
|
+
label_names += group_and_category_labels_for_test(options[:test]) if options.key?(:test)
|
68
|
+
label_names_to_label_quick_action(label_names)
|
59
69
|
when 37..398
|
60
|
-
'
|
70
|
+
label_names = Set.new(['flakiness::2'])
|
71
|
+
label_names += group_and_category_labels_for_test(options[:test]) if options.key?(:test)
|
72
|
+
label_names_to_label_quick_action(label_names)
|
61
73
|
when 13..36
|
62
74
|
'/label ~"flakiness::3"'
|
63
75
|
else
|
64
76
|
'/label ~"flakiness::4"'
|
65
77
|
end
|
66
78
|
end
|
67
|
-
|
68
|
-
def up_to_date_labels(test:, issue: nil, new_labels: Set.new)
|
69
|
-
(base_issue_labels + super).to_a
|
70
|
-
end
|
71
79
|
end
|
72
80
|
end
|
73
81
|
end
|
@@ -45,6 +45,10 @@ module GitlabQuality
|
|
45
45
|
[]
|
46
46
|
end
|
47
47
|
|
48
|
+
def new_issue_labels(_test)
|
49
|
+
[]
|
50
|
+
end
|
51
|
+
|
48
52
|
def search_labels
|
49
53
|
BASE_SEARCH_LABELS
|
50
54
|
end
|
@@ -57,10 +61,6 @@ module GitlabQuality
|
|
57
61
|
''
|
58
62
|
end
|
59
63
|
|
60
|
-
def health_problem_status_label_quick_action(*)
|
61
|
-
''
|
62
|
-
end
|
63
|
-
|
64
64
|
def item_extra_content(_test)
|
65
65
|
found_label
|
66
66
|
end
|
@@ -115,7 +115,13 @@ module GitlabQuality
|
|
115
115
|
current_reports_note = existing_reports_note(issue_iid: issue.iid)
|
116
116
|
|
117
117
|
new_reports_list = new_reports_list(current_reports_note: current_reports_note, test: test)
|
118
|
-
note_body =
|
118
|
+
note_body = append_quick_actions_to_note(
|
119
|
+
new_reports_list: new_reports_list,
|
120
|
+
related_issues: related_issues,
|
121
|
+
options: {
|
122
|
+
test: test
|
123
|
+
}
|
124
|
+
)
|
119
125
|
|
120
126
|
if current_reports_note
|
121
127
|
gitlab.edit_issue_note(
|
@@ -138,7 +144,7 @@ module GitlabQuality
|
|
138
144
|
)
|
139
145
|
end
|
140
146
|
|
141
|
-
def
|
147
|
+
def append_quick_actions_to_note(new_reports_list:, related_issues:, options: {})
|
142
148
|
report = new_reports_list
|
143
149
|
|
144
150
|
quick_actions = [
|
@@ -164,10 +170,15 @@ module GitlabQuality
|
|
164
170
|
end
|
165
171
|
end
|
166
172
|
|
173
|
+
# Defined in subclasses
|
174
|
+
def health_problem_status_label_quick_action(*)
|
175
|
+
''
|
176
|
+
end
|
177
|
+
|
167
178
|
def identity_labels_quick_action
|
168
179
|
return if identity_labels.empty?
|
169
180
|
|
170
|
-
|
181
|
+
label_names_to_label_quick_action(identity_labels)
|
171
182
|
end
|
172
183
|
|
173
184
|
def relate_issues_quick_actions(issues)
|
@@ -39,6 +39,10 @@ module GitlabQuality
|
|
39
39
|
search_and_create_issue
|
40
40
|
end
|
41
41
|
|
42
|
+
def new_issue_labels(test)
|
43
|
+
up_to_date_labels(test: test, new_labels: NEW_ISSUE_LABELS + group_and_category_labels_for_test(test))
|
44
|
+
end
|
45
|
+
|
42
46
|
def search_and_create_issue
|
43
47
|
filtered_report = KnapsackReports::SpecRunTimeReport.new(
|
44
48
|
token: token,
|
@@ -80,6 +80,14 @@ module GitlabQuality
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
+
def new_issue_labels(test)
|
84
|
+
up_to_date_labels(test: test, new_labels: NEW_ISSUE_LABELS + group_and_category_labels_for_test(test))
|
85
|
+
end
|
86
|
+
|
87
|
+
def up_to_date_labels(test:, issue: nil, new_labels: Set.new)
|
88
|
+
(Set.new(base_issue_labels) + (super << pipeline_name_label)).to_a
|
89
|
+
end
|
90
|
+
|
83
91
|
def test_metric_collections
|
84
92
|
@test_metric_collections ||= Dir.glob(metrics_files).map do |path|
|
85
93
|
TestMetrics::JsonTestMetricCollection.new(path)
|
@@ -448,10 +456,6 @@ module GitlabQuality
|
|
448
456
|
section
|
449
457
|
end
|
450
458
|
|
451
|
-
def up_to_date_labels(test:, issue: nil, new_labels: Set.new)
|
452
|
-
(Set.new(base_issue_labels) + (super << pipeline_name_label)).to_a
|
453
|
-
end
|
454
|
-
|
455
459
|
def new_issue_assignee_id(test)
|
456
460
|
return unless test.product_group?
|
457
461
|
|
@@ -144,6 +144,9 @@ module GitlabQuality
|
|
144
144
|
gitlab.edit_issue(iid: issue.iid, options: { labels: labels.to_a })
|
145
145
|
end
|
146
146
|
|
147
|
+
# Infer labels from the test, and optionally from the issue and new_labels in arguments
|
148
|
+
#
|
149
|
+
# Called when we're updating a test health issue with a new test report.
|
147
150
|
def up_to_date_labels(test:, issue: nil, new_labels: Set.new)
|
148
151
|
labels = issue_labels(issue)
|
149
152
|
labels |= new_labels.to_set
|
@@ -34,6 +34,10 @@ module GitlabQuality
|
|
34
34
|
IDENTITY_LABELS
|
35
35
|
end
|
36
36
|
|
37
|
+
def new_issue_labels(test)
|
38
|
+
up_to_date_labels(test: test, new_labels: NEW_ISSUE_LABELS)
|
39
|
+
end
|
40
|
+
|
37
41
|
def report_section_header
|
38
42
|
REPORT_SECTION_HEADER
|
39
43
|
end
|
@@ -42,12 +46,16 @@ module GitlabQuality
|
|
42
46
|
REPORTS_DOCUMENTATION
|
43
47
|
end
|
44
48
|
|
45
|
-
def health_problem_status_label_quick_action(reports_list,
|
49
|
+
def health_problem_status_label_quick_action(reports_list, options: {})
|
46
50
|
case reports_list.reports_count
|
47
51
|
when 6099..Float::INFINITY
|
48
|
-
'
|
52
|
+
label_names = Set.new(['slowness::1'])
|
53
|
+
label_names += group_and_category_labels_for_test(options[:test]) if options.key?(:test)
|
54
|
+
label_names_to_label_quick_action(label_names)
|
49
55
|
when 2177..6098
|
50
|
-
'
|
56
|
+
label_names = Set.new(['slowness::2'])
|
57
|
+
label_names += group_and_category_labels_for_test(options[:test]) if options.key?(:test)
|
58
|
+
label_names_to_label_quick_action(label_names)
|
51
59
|
when 521..2176
|
52
60
|
'/label ~"slowness::3"'
|
53
61
|
else
|
@@ -13,7 +13,8 @@ module GitlabQuality
|
|
13
13
|
"could not be found (502)",
|
14
14
|
"Error reference number: 502",
|
15
15
|
"(502): `GitLab is not responding`",
|
16
|
-
"<head><title>502 Bad Gateway</title></head>"
|
16
|
+
"<head><title>502 Bad Gateway</title></head>",
|
17
|
+
"14:connections to all backends failing"
|
17
18
|
].freeze
|
18
19
|
|
19
20
|
SHARED_EXAMPLES_CALLERS = %w[include_examples it_behaves_like].freeze
|
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: 2.
|
4
|
+
version: 2.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitLab Quality
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: climate_control
|
@@ -215,7 +215,7 @@ dependencies:
|
|
215
215
|
version: '7.0'
|
216
216
|
- - "<"
|
217
217
|
- !ruby/object:Gem::Version
|
218
|
-
version: '7.
|
218
|
+
version: '7.3'
|
219
219
|
type: :runtime
|
220
220
|
prerelease: false
|
221
221
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -225,7 +225,7 @@ dependencies:
|
|
225
225
|
version: '7.0'
|
226
226
|
- - "<"
|
227
227
|
- !ruby/object:Gem::Version
|
228
|
-
version: '7.
|
228
|
+
version: '7.3'
|
229
229
|
- !ruby/object:Gem::Dependency
|
230
230
|
name: amatch
|
231
231
|
requirement: !ruby/object:Gem::Requirement
|
@@ -554,14 +554,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
554
554
|
requirements:
|
555
555
|
- - ">="
|
556
556
|
- !ruby/object:Gem::Version
|
557
|
-
version: 3.
|
557
|
+
version: 3.2.0
|
558
558
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
559
559
|
requirements:
|
560
560
|
- - ">="
|
561
561
|
- !ruby/object:Gem::Version
|
562
562
|
version: '0'
|
563
563
|
requirements: []
|
564
|
-
rubygems_version: 3.
|
564
|
+
rubygems_version: 3.5.22
|
565
565
|
signing_key:
|
566
566
|
specification_version: 4
|
567
567
|
summary: A collection of test-related tools.
|