gitlab_quality-test_tooling 1.17.0 → 1.18.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b8709476aafe6dc96d2b49d1d74b18b2e3dbf6c37cb8ebb0acd631d05dbfe2ac
4
- data.tar.gz: 26d4d54613a522014b5f3b93f38c0cb62027c2e209573727265a5c2b630a6d9d
3
+ metadata.gz: 948fbcd939a7800a4538113fddc717642c4d9fed7dab6d650cd9052c1832f19b
4
+ data.tar.gz: fbc4cee23cbcd3f7631ac6a03d41f2b8e287590777fef813289013d982efc4f7
5
5
  SHA512:
6
- metadata.gz: 194294ffed245e88a96e35480485f98c1748a8417766cdca1cf737ece2b090a4e29efc444fa449f5f569e292333ba50954f7c07a72fbb2f9225c9195c4b6f411
7
- data.tar.gz: 30cc7f3a5da1c15b5c3508e0850c007bddf9f22a85c9ec1361821be7bc330afd3869cd9fe74d3b424afc2d0ad2d180c4c0649b5f502f4740ca68f1b2c8119933
6
+ metadata.gz: 34c8a65eaf48e4ef9800df34a66f0086d3915252444091631fbd76273731008f70be149e3c92d5954644e55839d8a314eb3442411e3a389061e460d66c9d1ea2
7
+ data.tar.gz: 29f34824d1c5bba8dbe979a10c0e93a8c4c06e7b0b174b96b0150c19e3d6f71bb0fa9a8ef285a2d650af407547084a5e1a7bb2925817dce5d200b6755e864d4c
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab_quality-test_tooling (1.17.0)
5
- activesupport (>= 6.1, < 7.1)
4
+ gitlab_quality-test_tooling (1.18.0)
5
+ activesupport (>= 6.1, < 7.2)
6
6
  amatch (~> 0.4.1)
7
7
  gitlab (~> 4.19)
8
8
  http (~> 5.0)
@@ -16,10 +16,15 @@ PATH
16
16
  GEM
17
17
  remote: https://rubygems.org/
18
18
  specs:
19
- activesupport (7.0.8)
19
+ activesupport (7.1.3.2)
20
+ base64
21
+ bigdecimal
20
22
  concurrent-ruby (~> 1.0, >= 1.0.2)
23
+ connection_pool (>= 2.2.5)
24
+ drb
21
25
  i18n (>= 1.6, < 2)
22
26
  minitest (>= 5.1)
27
+ mutex_m
23
28
  tzinfo (~> 2.0)
24
29
  addressable (2.8.6)
25
30
  public_suffix (>= 2.0.2, < 6.0)
@@ -28,7 +33,9 @@ GEM
28
33
  tins (~> 1.0)
29
34
  ast (2.4.2)
30
35
  backport (1.2.0)
36
+ base64 (0.2.0)
31
37
  benchmark (0.3.0)
38
+ bigdecimal (3.1.6)
32
39
  binding_of_caller (1.0.0)
33
40
  debug_inspector (>= 0.0.1)
34
41
  byebug (11.1.3)
@@ -41,6 +48,7 @@ GEM
41
48
  coderay (1.1.3)
42
49
  colored2 (3.1.2)
43
50
  concurrent-ruby (1.2.3)
51
+ connection_pool (2.4.1)
44
52
  cork (0.3.0)
45
53
  colored2 (~> 3.1)
46
54
  crack (0.4.5)
@@ -65,6 +73,7 @@ GEM
65
73
  diff-lcs (1.5.0)
66
74
  docile (1.4.0)
67
75
  domain_name (0.6.20240107)
76
+ drb (2.2.1)
68
77
  e2mmap (0.1.0)
69
78
  faraday (2.9.0)
70
79
  faraday-net_http (>= 2.0, < 3.2)
@@ -119,7 +128,7 @@ GEM
119
128
  httparty (0.21.0)
120
129
  mini_mime (>= 1.0.0)
121
130
  multi_xml (>= 0.5.2)
122
- i18n (1.14.1)
131
+ i18n (1.14.4)
123
132
  concurrent-ruby (~> 1.0)
124
133
  jaro_winkler (1.5.6)
125
134
  json (2.7.1)
@@ -138,10 +147,11 @@ GEM
138
147
  method_source (1.0.0)
139
148
  mini_mime (1.1.5)
140
149
  mini_portile2 (2.8.5)
141
- minitest (5.21.2)
150
+ minitest (5.22.2)
142
151
  mize (0.4.1)
143
152
  protocol (~> 2.0)
144
153
  multi_xml (0.6.0)
154
+ mutex_m (0.2.0)
145
155
  nap (1.1.0)
146
156
  nenv (0.3.0)
147
157
  net-http (0.4.1)
@@ -31,6 +31,10 @@ options = OptionParser.new do |opts|
31
31
  params[:issue_url_file] = issue_url_file
32
32
  end
33
33
 
34
+ opts.on('--pipeline-stages STAGES', STRING, 'Comma-separated list of pipeline stages to include in test session issue') do |pipeline_stages|
35
+ params[:pipeline_stages] = pipeline_stages.split(',')
36
+ end
37
+
34
38
  opts.on('--confidential', "Makes test session issue confidential") do
35
39
  params[:confidential] = true
36
40
  end
@@ -27,7 +27,7 @@ module GitlabQuality
27
27
 
28
28
  raise if @retry_backoff > RETRY_BACK_OFF_DELAY * MAX_RETRY_ATTEMPTS
29
29
 
30
- warn("#{error.class.name} #{error.message}")
30
+ warn("#{e.class.name} #{e.message}")
31
31
  warn("Sleeping for #{@retry_backoff} seconds before retrying...")
32
32
  sleep @retry_backoff
33
33
 
@@ -7,15 +7,16 @@ module GitlabQuality
7
7
  module TestTooling
8
8
  module Report
9
9
  class GenerateTestSession < ReportAsIssue
10
- def initialize(ci_project_token:, **kwargs)
10
+ def initialize(ci_project_token:, pipeline_stages: nil, **kwargs)
11
11
  super
12
12
  @ci_project_token = ci_project_token
13
+ @pipeline_stages = Set.new(pipeline_stages)
13
14
  @issue_type = 'issue'
14
15
  end
15
16
 
16
17
  private
17
18
 
18
- attr_reader :ci_project_token
19
+ attr_reader :ci_project_token, :pipeline_stages
19
20
 
20
21
  # rubocop:disable Metrics/AbcSize
21
22
  def run!
@@ -27,6 +28,8 @@ module GitlabQuality
27
28
  TestResults::JsonTestResults.new(path).to_a
28
29
  end
29
30
 
31
+ tests = tests.select { |test| pipeline_stages.include? test.report["stage"] } unless pipeline_stages.empty?
32
+
30
33
  issue = gitlab.create_issue(
31
34
  title: "#{Time.now.strftime('%Y-%m-%d')} Test session report | #{Runtime::Env.qa_run_type}",
32
35
  description: generate_description(tests),
@@ -1,9 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'nokogiri'
4
- require 'active_support/core_ext/enumerable'
5
4
  require 'rubygems/text'
6
- require 'active_support/core_ext/integer/time'
7
5
  require 'amatch'
8
6
 
9
7
  module GitlabQuality
@@ -339,7 +337,7 @@ module GitlabQuality
339
337
  def new_issue_due_date(test)
340
338
  return unless test.product_group?
341
339
 
342
- Date.today + 1.month
340
+ Date.today.next_month
343
341
  end
344
342
 
345
343
  def update_reports(issue, test)
@@ -60,7 +60,6 @@ module GitlabQuality
60
60
  | Description | `#{test.name}` |
61
61
  | Test level | #{test.level} |
62
62
  | Hash | `#{test_hash(test)}` |
63
- | Reference duration | #{test.run_time} seconds |
64
63
  | Expected duration | < #{test.max_duration_for_test} seconds |
65
64
  #{"| Test case | #{test.testcase} |" if test.testcase}
66
65
  DESCRIPTION
@@ -93,7 +93,7 @@ module GitlabQuality
93
93
  current_reports_content: reports_note&.body.to_s,
94
94
  test: test,
95
95
  reports_section_header: REPORT_SECTION_HEADER,
96
- item_extra_content: found_label,
96
+ item_extra_content: "(#{test.run_time} seconds) #{found_label}",
97
97
  reports_extra_content: REPORTS_DOCUMENTATION
98
98
  )
99
99
  end
@@ -38,7 +38,7 @@ module GitlabQuality
38
38
  console_log = console_logger(source: source, level: Env.log_level)
39
39
  file_log = file_logger(source: source, path: log_path)
40
40
 
41
- console_log.extend(ActiveSupport::Logger.broadcast(file_log))
41
+ ActiveSupport::BroadcastLogger.new(console_log, file_log, file_log)
42
42
  end
43
43
  end
44
44
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module GitlabQuality
4
4
  module TestTooling
5
- VERSION = "1.17.0"
5
+ VERSION = "1.18.0"
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: 1.17.0
4
+ version: 1.18.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: 2024-03-01 00:00:00.000000000 Z
11
+ date: 2024-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control
@@ -201,7 +201,7 @@ dependencies:
201
201
  version: '6.1'
202
202
  - - "<"
203
203
  - !ruby/object:Gem::Version
204
- version: '7.1'
204
+ version: '7.2'
205
205
  type: :runtime
206
206
  prerelease: false
207
207
  version_requirements: !ruby/object:Gem::Requirement
@@ -211,7 +211,7 @@ dependencies:
211
211
  version: '6.1'
212
212
  - - "<"
213
213
  - !ruby/object:Gem::Version
214
- version: '7.1'
214
+ version: '7.2'
215
215
  - !ruby/object:Gem::Dependency
216
216
  name: amatch
217
217
  requirement: !ruby/object:Gem::Requirement