gitlab_quality-test_tooling 2.18.0 → 2.19.1

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: 7db77718644f72fd0a096182fdf76ad10c912002f0770e245ac782a9b238b690
4
- data.tar.gz: 7b67154f177663fdc2bd19882b128e5eaa3540f20c31c50fddcf73c6661590ff
3
+ metadata.gz: e14c5a03000218d4c10afb6d388605dac227ab1f436089e40239e87329b66d17
4
+ data.tar.gz: 499608ec04650db2746fa234c996c4b37c8fb99a544dbcf3fdb8d2de5768445e
5
5
  SHA512:
6
- metadata.gz: 0776f0aef2a4076a7a0bfd71c902d57400eea5388982e62583d689038137ed7fe1166368dabfb006999069e32525fd47d752faf92afffa536b9cbe72303c207f
7
- data.tar.gz: c3145f170b88abebe7e2a6875d94ccca55fccb370972f37c7679479257186a5e2d73eaedb6bb799139c72bfc32ade74f60e1e5cf07aebb5aa7e3bb8621c7a65d
6
+ metadata.gz: 1022bde869ad7de0c7dabc0f1b2084518616ef6987a22593948351f1a2924b8d9532ac9979adee193acaf1a279c1e4f8a197e7b1d60bbee8d884a76f19116d7b
7
+ data.tar.gz: 5fc60b6d49fd488f6007a11b585b8c32ccdb224b7b18be44cd559b708353fc42b9c8538234dc235859eb09492c9f336144efc6ac8b8a2dd909ab58b41cbe1386
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab_quality-test_tooling (2.18.0)
4
+ gitlab_quality-test_tooling (2.19.1)
5
5
  activesupport (>= 7.0, < 7.3)
6
6
  amatch (~> 0.4.1)
7
7
  fog-google (~> 1.24, >= 1.24.1)
@@ -4,8 +4,8 @@ module GitlabQuality
4
4
  module TestTooling
5
5
  module GitlabClient
6
6
  class IssuesDryClient < IssuesClient
7
- def create_issue(title:, description:, labels:, issue_type: 'issue', confidential: false)
8
- attrs = { description: description, labels: labels, confidential: confidential }
7
+ def create_issue(title:, description:, labels:, assignee_id: 'unknown', issue_type: 'issue', confidential: false)
8
+ attrs = { description: description, labels: labels, confidential: confidential, assignee_id: assignee_id }
9
9
 
10
10
  puts "The following #{issue_type} would have been created:"
11
11
  puts "project: #{project}, title: #{title}, attrs: #{attrs}"
@@ -12,7 +12,7 @@ module GitlabQuality
12
12
  # - Add a failure report in the "Failure reports" note
13
13
  class FailedTestIssue < HealthProblemReporter
14
14
  IDENTITY_LABELS = ['test', 'test-health:failures', 'automation:bot-authored'].freeze
15
- NEW_ISSUE_LABELS = Set.new(['type::maintenance', 'failure::new', 'priority::3', 'severity::3', *IDENTITY_LABELS]).freeze
15
+ NEW_ISSUE_LABELS = Set.new(['type::maintenance', 'failure::new', 'priority::3', 'severity::3', 'suppress-contributor-links', *IDENTITY_LABELS]).freeze
16
16
  REPORT_SECTION_HEADER = '#### Failure reports'
17
17
 
18
18
  FAILURE_STACKTRACE_REGEX = %r{(?:(?:.*Failure/Error:(?<stacktrace>.+))|(?<stacktrace>.+))}m
@@ -13,7 +13,7 @@ module GitlabQuality
13
13
  # - Add a flakiness report in the "Flakiness reports" note
14
14
  class FlakyTestIssue < HealthProblemReporter
15
15
  IDENTITY_LABELS = ['test', 'failure::flaky-test', 'test-health:pass-after-retry', 'automation:bot-authored'].freeze
16
- NEW_ISSUE_LABELS = Set.new(['type::maintenance', 'priority::3', 'severity::3', *IDENTITY_LABELS]).freeze
16
+ NEW_ISSUE_LABELS = Set.new(['type::maintenance', 'priority::3', 'severity::3', 'suppress-contributor-links', *IDENTITY_LABELS]).freeze
17
17
  REPORT_SECTION_HEADER = '### Flakiness reports'
18
18
  REPORTS_DOCUMENTATION = <<~DOC
19
19
  Flaky tests were detected. Please refer to the [Flaky tests reproducibility instructions](https://docs.gitlab.com/development/testing_guide/unhealthy_tests/#how-to-reproduce-a-flaky-test-locally)
@@ -33,7 +33,7 @@ module GitlabQuality
33
33
  issue = gitlab.create_issue(
34
34
  title: "#{Time.now.strftime('%Y-%m-%d')} Test session report | #{Runtime::Env.qa_run_type}",
35
35
  description: generate_description(tests),
36
- labels: ['automation:bot-authored', 'E2E', 'triage report', pipeline_name_label],
36
+ labels: ['automation:bot-authored', 'E2E', 'triage report', pipeline_name_label, 'suppress-contributor-links'],
37
37
  confidential: confidential
38
38
  )
39
39
 
@@ -34,7 +34,7 @@ module GitlabQuality
34
34
 
35
35
  handle_gitlab_api_error("creating issue") do
36
36
  issue = @client.create_issue(title: title, description: description, labels: labels.join(','))
37
- Runtime::Logger.info "Issue created successfully: #{issue.web_url}"
37
+ Runtime::Logger.info "Issue created successfully: #{issue.web_url}" if issue&.web_url
38
38
  end
39
39
  end
40
40
  end
@@ -18,7 +18,7 @@ module GitlabQuality
18
18
 
19
19
  NEW_ISSUE_LABELS = Set.new([
20
20
  'test', 'automation:bot-authored', 'type::maintenance', 'maintenance::performance',
21
- 'priority::3', 'severity::3', 'knapsack_report'
21
+ 'priority::3', 'severity::3', 'knapsack_report', 'suppress-contributor-links'
22
22
  ]).freeze
23
23
  SEARCH_LABELS = %w[test maintenance::performance knapsack_report].freeze
24
24
  JOB_TIMEOUT_EPIC_URL = 'https://gitlab.com/groups/gitlab-org/quality/engineering-productivity/-/epics/19'
@@ -28,7 +28,7 @@ module GitlabQuality
28
28
  FAILURE_STACKTRACE_REGEX = %r{(?:(?:.*Failure/Error:(?<stacktrace>.+))|(?<stacktrace>.+))}m
29
29
  ISSUE_STACKTRACE_REGEX = /### Stack trace\s*(```)#{FAILURE_STACKTRACE_REGEX}(```)\n*\n###/m
30
30
 
31
- NEW_ISSUE_LABELS = Set.new(%w[test failure::new priority::2 automation:bot-authored type::maintenance]).freeze
31
+ NEW_ISSUE_LABELS = Set.new(%w[test failure::new priority::2 automation:bot-authored type::maintenance suppress-contributor-links]).freeze
32
32
  SCREENSHOT_IGNORED_ERRORS = ['500 Internal Server Error', 'fabricate_via_api!', 'Error Code 500'].freeze
33
33
  FAILURE_ISSUE_GUIDE_URL = "https://handbook.gitlab.com/handbook/engineering/testing/guide-to-e2e-test-failure-issues/"
34
34
  FAILURE_ISSUE_HANDBOOK_GUIDE = "**:rotating_light: [End-to-End Test Failure Issue Debugging Guide](#{FAILURE_ISSUE_GUIDE_URL}) :rotating_light:**\n".freeze
@@ -88,16 +88,20 @@ module GitlabQuality
88
88
  def run!
89
89
  puts "Reporting test failures in `#{files.join(',')}` as issues in project `#{project}` via the API at `#{Runtime::Env.gitlab_api_base}`."
90
90
 
91
- if group_similar
92
- run_with_grouping!
93
- else
94
- TestResults::Builder.new(token: token, project: project, file_glob: files).test_results_per_file do |test_results|
95
- puts "=> Reporting #{test_results.count} tests in #{test_results.path}"
96
- process_test_results(test_results)
97
- end
91
+ run_with_grouping! if group_similar
92
+
93
+ return if similar_issues_grouped?
94
+
95
+ TestResults::Builder.new(token: token, project: project, file_glob: files).test_results_per_file do |test_results|
96
+ puts "=> Reporting #{test_results.count} tests in #{test_results.path}"
97
+ process_test_results(test_results)
98
98
  end
99
99
  end
100
100
 
101
+ def similar_issues_grouped?
102
+ grouper.summary[:grouped_issues].positive?
103
+ end
104
+
101
105
  def grouper
102
106
  @grouper ||= GitlabQuality::TestTooling::Report::GroupIssues::GroupResultsInIssues.new(
103
107
  gitlab: gitlab,
@@ -11,7 +11,8 @@ module GitlabQuality
11
11
  # - Add test metadata, duration to the issue with group and category labels
12
12
  class SlowTestIssue < HealthProblemReporter
13
13
  IDENTITY_LABELS = ['test', 'rspec:slow test', 'test-health:slow', 'rspec profiling', 'automation:bot-authored'].freeze
14
- NEW_ISSUE_LABELS = Set.new(['test', 'type::maintenance', 'maintenance::performance', 'priority::3', 'severity::3', *IDENTITY_LABELS]).freeze
14
+ NEW_ISSUE_LABELS = Set.new(
15
+ ['test', 'type::maintenance', 'maintenance::performance', 'priority::3', 'severity::3', 'suppress-contributor-links', *IDENTITY_LABELS]).freeze
15
16
  REPORT_SECTION_HEADER = '### Slowness reports'
16
17
  REPORTS_DOCUMENTATION = <<~DOC
17
18
  Slow tests were detected, please see the [test speed best practices guide](https://docs.gitlab.com/ee/development/testing_guide/best_practices.html#test-speed)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GitlabQuality
4
4
  module TestTooling
5
- VERSION = "2.18.0"
5
+ VERSION = "2.19.1"
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: 2.18.0
4
+ version: 2.19.1
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-08-08 00:00:00.000000000 Z
11
+ date: 2025-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control