gitlab_quality-test_tooling 1.2.0 → 1.3.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 +1 -1
- data/lib/gitlab_quality/test_tooling/report/relate_failure_issue.rb +10 -4
- data/lib/gitlab_quality/test_tooling/report/report_as_issue.rb +5 -2
- data/lib/gitlab_quality/test_tooling/report/slow_test_issue.rb +1 -1
- data/lib/gitlab_quality/test_tooling/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8faeb526c0c3996945e423ca2c2d944f57bda93b1941beac376e9d4478bf8230
|
4
|
+
data.tar.gz: '09a401ff0c2c60effc2a9c55466ed266dceb7eed8b3c83aa1970c31837ec36dd'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7ba58f29fb1d459a82e5bc078791ecd08b5e06737530b09f52facd3813e1f7de699b7227748e58a788ef16099c3a9e6aef8a97607a5b0ccb0adc7bc96a59ab0
|
7
|
+
data.tar.gz: 88f89b94c695450d2f0716e4927e11865dd5e9c3d356f1f6c106ece8ff86ab5797db88459dd7285acf8ee0b7b37952c829bc681ee1b5678f42f35643cc51aeb9
|
data/Gemfile.lock
CHANGED
@@ -124,7 +124,7 @@ module GitlabQuality
|
|
124
124
|
|
125
125
|
def pipeline_issues_with_similar_stacktrace(test)
|
126
126
|
search_labels = (base_issue_labels + Set.new(%w[test failure::new])).to_a
|
127
|
-
gitlab.find_issues(options: {
|
127
|
+
gitlab.find_issues(options: { labels: search_labels,
|
128
128
|
created_after: past_timestamp(2) }).select do |issue|
|
129
129
|
job_url_from_issue = failed_issue_job_url(issue)
|
130
130
|
|
@@ -172,7 +172,7 @@ module GitlabQuality
|
|
172
172
|
end
|
173
173
|
|
174
174
|
def failure_issues(test)
|
175
|
-
find_issues(test, (base_issue_labels + Set.new(%w[test])).to_a)
|
175
|
+
find_issues(test, (base_issue_labels + Set.new(%w[test])).to_a) # Search for opened and closed issues
|
176
176
|
end
|
177
177
|
|
178
178
|
def full_stacktrace(test)
|
@@ -330,10 +330,16 @@ module GitlabQuality
|
|
330
330
|
end
|
331
331
|
|
332
332
|
def update_reports(issue, test)
|
333
|
-
|
333
|
+
# We reopen closed issues to not lose any history
|
334
|
+
state_event = issue.state == 'closed' ? 'reopen' : nil
|
335
|
+
|
336
|
+
issue_attrs = {
|
334
337
|
description: up_to_date_issue_description(issue.description, test),
|
335
338
|
labels: up_to_date_labels(test: test, issue: issue)
|
336
|
-
}
|
339
|
+
}
|
340
|
+
issue_attrs[:state_event] = state_event if state_event
|
341
|
+
|
342
|
+
gitlab.edit_issue(iid: issue.iid, options: issue_attrs)
|
337
343
|
puts " => Added a report in '#{issue.title}': #{issue.web_url}!"
|
338
344
|
end
|
339
345
|
|
@@ -125,8 +125,11 @@ module GitlabQuality
|
|
125
125
|
labels
|
126
126
|
end
|
127
127
|
|
128
|
-
def find_issues(test, labels)
|
129
|
-
|
128
|
+
def find_issues(test, labels, state: nil)
|
129
|
+
search_options = { labels: labels.to_a }
|
130
|
+
search_options[:state] = state if state
|
131
|
+
|
132
|
+
gitlab.find_issues(options: search_options).find_all do |issue|
|
130
133
|
issue_title = issue.title.strip
|
131
134
|
issue_title.include?(test.name) || issue_title.include?(partial_file_path(test.file))
|
132
135
|
end
|
@@ -49,7 +49,7 @@ module GitlabQuality
|
|
49
49
|
def create_slow_issue(test)
|
50
50
|
puts " => Finding existing issues for slow test '#{test.name}' (run time: #{test.run_time} seconds)..."
|
51
51
|
|
52
|
-
issues = find_issues(test, SEARCH_LABELS)
|
52
|
+
issues = find_issues(test, SEARCH_LABELS, state: 'opened')
|
53
53
|
|
54
54
|
issues.each do |issue|
|
55
55
|
puts " => Existing issue link #{issue['web_url']}"
|