gitlab_quality-test_tooling 0.6.1 → 0.6.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a822efcb98f1f0701146868a2ca82590fc8320f623620eadecba03d9407038b
4
- data.tar.gz: e8ef6e4c717e7d3a86ba0e1b71ab4811b1251a034e4f4191df49d432dc8f57aa
3
+ metadata.gz: 80c8edb6daa8bf924d294ef291d82fd60c8545898aaa0eac7e71b98dad4dc1c2
4
+ data.tar.gz: 9e414922f797ce645e951f3fc26adb394a7a7f48f2c01bf7ddd7d218a1229486
5
5
  SHA512:
6
- metadata.gz: 3df264eafd349e11cfbabf00816172a181960ae7398b9f488148ad6e7d22f5e251738190fec44877d912aae137ca01fa57b5fafec77df1bfbc944752152f69b4
7
- data.tar.gz: 1b8892425addf5b1300d34624fd3de3a06054c4ec50fecd8ad7e9775ed8364159a6959a980d3b4569fb155a0f3e7e8739a39f24015f5d8a05da3fe4681ba0230
6
+ metadata.gz: 573774ab0d7be7d23d2c262f0246377b824604240930ba451b088af914e7b166b8844e63425f3583a16f45bdc73be3779e5e5eb081218ff934fcb2e87698a8bf
7
+ data.tar.gz: f0ad9eb31e28e2c9f21c317b6d84e78645c36f5fff30baa8ada905d17f202710e087125a373f8fc38dd06612c08764839d2a35aaa835d133211219ee2778c37a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab_quality-test_tooling (0.6.1)
4
+ gitlab_quality-test_tooling (0.6.2)
5
5
  activesupport (~> 6.1)
6
6
  gitlab (~> 4.19)
7
7
  http (~> 5.0)
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 QA failure issues detection
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
@@ -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 QA failure issues detection') do |max_diff_ratio|
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 QA Bot",
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 unless pipeline == pipeline_env_from_job_url(job_url_from_issue)
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
- 'master'
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: 'QA' }).select do |issue|
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 ~QA and then filter further in Ruby
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?
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GitlabQuality
4
4
  module TestTooling
5
- VERSION = "0.6.1"
5
+ VERSION = "0.6.2"
6
6
  end
7
7
  end
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.1
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-05-31 00:00:00.000000000 Z
11
+ date: 2023-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control