gitlab_quality-test_tooling 0.6.1 → 0.6.2
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/README.md +1 -1
- data/exe/relate-failure-issue +1 -1
- data/lib/gitlab_quality/test_tooling/gitlab_issue_client.rb +1 -1
- data/lib/gitlab_quality/test_tooling/report/relate_failure_issue.rb +5 -5
- 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: 80c8edb6daa8bf924d294ef291d82fd60c8545898aaa0eac7e71b98dad4dc1c2
|
4
|
+
data.tar.gz: 9e414922f797ce645e951f3fc26adb394a7a7f48f2c01bf7ddd7d218a1229486
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 573774ab0d7be7d23d2c262f0246377b824604240930ba451b088af914e7b166b8844e63425f3583a16f45bdc73be3779e5e5eb081218ff934fcb2e87698a8bf
|
7
|
+
data.tar.gz: f0ad9eb31e28e2c9f21c317b6d84e78645c36f5fff30baa8ada905d17f202710e087125a373f8fc38dd06612c08764839d2a35aaa835d133211219ee2778c37a
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -80,7 +80,7 @@ Purpose: Relate test failures to failure issues from RSpec report files (JSON or
|
|
80
80
|
Usage: exe/relate-failure-issue [options]
|
81
81
|
-i, --input-files INPUT_FILES RSpec report files (JSON or JUnit XML)
|
82
82
|
--max-diff-ratio MAX_DIFF_RATO
|
83
|
-
Max stacktrace diff ratio for
|
83
|
+
Max stacktrace diff ratio for failure issues detection
|
84
84
|
-p, --project PROJECT Can be an integer or a group/project string
|
85
85
|
-t, --token TOKEN A valid access token with `api` scope and Maintainer permission in PROJECT
|
86
86
|
--system-log-files SYSTEM_LOG_FILES
|
data/exe/relate-failure-issue
CHANGED
@@ -15,7 +15,7 @@ options = OptionParser.new do |opts|
|
|
15
15
|
params[:input_files] = input_files
|
16
16
|
end
|
17
17
|
|
18
|
-
opts.on('--max-diff-ratio MAX_DIFF_RATO', Float, 'Max stacktrace diff ratio for
|
18
|
+
opts.on('--max-diff-ratio MAX_DIFF_RATO', Float, 'Max stacktrace diff ratio for failure issues detection') do |max_diff_ratio|
|
19
19
|
params[:max_diff_ratio] = max_diff_ratio
|
20
20
|
end
|
21
21
|
|
@@ -153,7 +153,7 @@ module GitlabQuality
|
|
153
153
|
slack_options = {
|
154
154
|
slack_webhook_url: ENV.fetch('CI_SLACK_WEBHOOK_URL', nil),
|
155
155
|
channel: channel,
|
156
|
-
username: "GitLab
|
156
|
+
username: "GitLab Quality Test Tooling",
|
157
157
|
icon_emoji: ':ci_failing:',
|
158
158
|
message: <<~MSG
|
159
159
|
An unexpected error occurred while reporting test results in issues.
|
@@ -118,10 +118,10 @@ module GitlabQuality
|
|
118
118
|
end
|
119
119
|
|
120
120
|
def pipeline_issues_with_similar_stacktrace(test)
|
121
|
-
gitlab.find_issues(options: { state: 'opened', labels: (base_issue_labels + %w[failure::new]).join(','),
|
121
|
+
gitlab.find_issues(options: { state: 'opened', labels: (base_issue_labels + %w[test failure::new]).join(','),
|
122
122
|
created_after: past_timestamp(2) }).select do |issue|
|
123
123
|
job_url_from_issue = failed_issue_job_url(issue)
|
124
|
-
next
|
124
|
+
next if pipeline != pipeline_env_from_job_url(job_url_from_issue)
|
125
125
|
|
126
126
|
stack_trace_from_issue = cleaned_stack_trace_from_issue(issue)
|
127
127
|
stack_trace_from_test = cleaned_stacktrace_from_test(test)
|
@@ -153,7 +153,7 @@ module GitlabQuality
|
|
153
153
|
if job_url.include?('/quality/')
|
154
154
|
job_url.partition('/quality/').last.partition('/').first
|
155
155
|
else
|
156
|
-
|
156
|
+
Runtime::Env.default_branch
|
157
157
|
end
|
158
158
|
end
|
159
159
|
|
@@ -163,7 +163,7 @@ module GitlabQuality
|
|
163
163
|
end
|
164
164
|
|
165
165
|
def failure_issues(test)
|
166
|
-
gitlab.find_issues(options: { state: 'opened', labels:
|
166
|
+
gitlab.find_issues(options: { state: 'opened', labels: base_issue_labels + %w[test] }).select do |issue|
|
167
167
|
issue_title = issue.title.strip
|
168
168
|
issue_title.include?(test.name) || issue_title.include?(partial_file_path(test.file))
|
169
169
|
end
|
@@ -202,7 +202,7 @@ module GitlabQuality
|
|
202
202
|
|
203
203
|
def find_relevant_failure_issues(test) # rubocop:disable Metrics/AbcSize
|
204
204
|
clean_first_test_failure_stacktrace = cleaned_stacktrace_from_test(test)
|
205
|
-
# Search with the `search` param returns 500 errors, so we filter by
|
205
|
+
# Search with the `search` param returns 500 errors, so we filter by `base_issue_labels` and then filter further in Ruby
|
206
206
|
failure_issues(test).each_with_object({}) do |issue, memo|
|
207
207
|
clean_relevant_issue_stacktrace = cleaned_stack_trace_from_issue(issue)
|
208
208
|
next if clean_relevant_issue_stacktrace.nil?
|
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.6.
|
4
|
+
version: 0.6.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-
|
11
|
+
date: 2023-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: climate_control
|