gitlab_quality-test_tooling 2.7.0 → 2.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- 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/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8547ed9407707737f7d776f263543f3681e19706d7705591968f2e0ec348ed88
|
4
|
+
data.tar.gz: 84f1fb8007ce5c5dd96a1782cfa7b75207d456df2b9c163ddde5900f3efe6ad2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43e26da079892ae22a44025b4c96a076b65499e1ab1a5574da130132e9c70358ed12ae9ba123bb645b757b8e177bb59c11fd036f5e8d9d14e22620c5c0616958
|
7
|
+
data.tar.gz: f236ba27bc98161951cc4d98e4ff22321eeee476b6e305c0b67e2d58b09f6329a0361c9d834c20ff3efa86b41f5763733eb278c755fffa1e5fa49d25c556c1a9
|
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
|
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.8.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-02-
|
11
|
+
date: 2025-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: climate_control
|