gitlab_quality-test_tooling 1.25.0 → 1.26.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 +4 -4
- data/Gemfile.lock +7 -8
- data/lib/gitlab_quality/test_tooling/report/failed_test_issue.rb +2 -1
- data/lib/gitlab_quality/test_tooling/test_metrics_exporter/config.rb +44 -0
- data/lib/gitlab_quality/test_tooling/test_metrics_exporter/formatter.rb +44 -0
- data/lib/gitlab_quality/test_tooling/{concerns → test_metrics_exporter}/influxdb_tools.rb +1 -1
- data/lib/gitlab_quality/test_tooling/{test_metric → test_metrics_exporter}/log_test_metrics.rb +6 -6
- data/lib/gitlab_quality/test_tooling/{concerns → test_metrics_exporter}/test_metrics.rb +2 -2
- data/lib/gitlab_quality/test_tooling/version.rb +1 -1
- metadata +25 -49
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e3ee730d9233005716cead9875a8a94b79db857b68ef7dcc16715e8f1ac3f281
|
|
4
|
+
data.tar.gz: 74d20185fa73cb46cdc998786267d79946c5f96e29966b4c5d57eac40b26c14e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7909fce13b1b085bef53aa1843029cda34199bd11757ec50a3175a933b3e2805d432a489e9fe157926c14c7f6819466b6a45970cd8b0d62f483df0b0ea422856
|
|
7
|
+
data.tar.gz: 2e28b30086187f268911b15c359bd5635958c6061dfddc0213e3176e686cbf27fdc96c5fd72594a608cd0ebf21ac3870ac9f0330a148a5112e252cb97d32a8fc
|
data/Gemfile.lock
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
gitlab_quality-test_tooling (1.
|
|
5
|
-
activesupport (
|
|
4
|
+
gitlab_quality-test_tooling (1.26.1)
|
|
5
|
+
activesupport (~> 7.1)
|
|
6
6
|
amatch (~> 0.4.1)
|
|
7
7
|
gitlab (~> 4.19)
|
|
8
8
|
http (~> 5.0)
|
|
9
|
+
influxdb-client (~> 3.1)
|
|
9
10
|
nokogiri (~> 1.10)
|
|
10
11
|
parallel (>= 1, < 2)
|
|
11
12
|
rainbow (>= 3, < 4)
|
|
@@ -35,7 +36,7 @@ GEM
|
|
|
35
36
|
backport (1.2.0)
|
|
36
37
|
base64 (0.2.0)
|
|
37
38
|
benchmark (0.3.0)
|
|
38
|
-
bigdecimal (3.1.
|
|
39
|
+
bigdecimal (3.1.8)
|
|
39
40
|
binding_of_caller (1.0.0)
|
|
40
41
|
debug_inspector (>= 0.0.1)
|
|
41
42
|
byebug (11.1.3)
|
|
@@ -128,7 +129,7 @@ GEM
|
|
|
128
129
|
httparty (0.21.0)
|
|
129
130
|
mini_mime (>= 1.0.0)
|
|
130
131
|
multi_xml (>= 0.5.2)
|
|
131
|
-
i18n (1.14.
|
|
132
|
+
i18n (1.14.5)
|
|
132
133
|
concurrent-ruby (~> 1.0)
|
|
133
134
|
influxdb-client (3.1.0)
|
|
134
135
|
jaro_winkler (1.5.6)
|
|
@@ -148,7 +149,7 @@ GEM
|
|
|
148
149
|
method_source (1.0.0)
|
|
149
150
|
mini_mime (1.1.5)
|
|
150
151
|
mini_portile2 (2.8.5)
|
|
151
|
-
minitest (5.
|
|
152
|
+
minitest (5.23.0)
|
|
152
153
|
mize (0.4.1)
|
|
153
154
|
protocol (~> 2.0)
|
|
154
155
|
multi_xml (0.6.0)
|
|
@@ -313,13 +314,11 @@ PLATFORMS
|
|
|
313
314
|
ruby
|
|
314
315
|
|
|
315
316
|
DEPENDENCIES
|
|
316
|
-
activesupport (>= 6.1, < 7.2)
|
|
317
317
|
climate_control (~> 1.2)
|
|
318
318
|
gitlab-dangerfiles (~> 3.8)
|
|
319
319
|
gitlab-styles (~> 10.0)
|
|
320
320
|
gitlab_quality-test_tooling!
|
|
321
321
|
guard-rspec (~> 4.7)
|
|
322
|
-
influxdb-client (~> 3.1)
|
|
323
322
|
lefthook (~> 1.3)
|
|
324
323
|
pry-byebug (= 3.10.1)
|
|
325
324
|
rake (~> 13.0)
|
|
@@ -331,4 +330,4 @@ DEPENDENCIES
|
|
|
331
330
|
webmock (= 3.7.0)
|
|
332
331
|
|
|
333
332
|
BUNDLED WITH
|
|
334
|
-
2.5.
|
|
333
|
+
2.5.6
|
|
@@ -33,10 +33,11 @@ module GitlabQuality
|
|
|
33
33
|
input_files:,
|
|
34
34
|
base_issue_labels: nil,
|
|
35
35
|
dry_run: false,
|
|
36
|
+
related_issues_file: nil,
|
|
36
37
|
project: nil,
|
|
37
38
|
max_diff_ratio: DEFAULT_MAX_DIFF_RATIO_FOR_DETECTION,
|
|
38
39
|
**_kwargs)
|
|
39
|
-
super(token: token, input_files: input_files, project: project, dry_run: dry_run)
|
|
40
|
+
super(token: token, input_files: input_files, related_issues_file: related_issues_file, project: project, dry_run: dry_run)
|
|
40
41
|
|
|
41
42
|
@base_issue_labels = Set.new(base_issue_labels)
|
|
42
43
|
@max_diff_ratio = max_diff_ratio.to_f
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "singleton"
|
|
4
|
+
|
|
5
|
+
module GitlabQuality
|
|
6
|
+
module TestTooling
|
|
7
|
+
module TestMetricsExporter
|
|
8
|
+
class Config
|
|
9
|
+
include Singleton
|
|
10
|
+
|
|
11
|
+
class << self
|
|
12
|
+
def configuration
|
|
13
|
+
Config.instance
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def configure
|
|
17
|
+
yield(configuration)
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
attr_accessor :influxdb_url,
|
|
22
|
+
:influxdb_token,
|
|
23
|
+
:influxdb_bucket,
|
|
24
|
+
:run_type
|
|
25
|
+
|
|
26
|
+
attr_writer :custom_keys_tags,
|
|
27
|
+
:custom_keys_fields,
|
|
28
|
+
:test_metric_file_name
|
|
29
|
+
|
|
30
|
+
def custom_keys_tags
|
|
31
|
+
@custom_keys_tags || []
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def custom_keys_fields
|
|
35
|
+
@custom_keys_fields || []
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def test_metric_file_name
|
|
39
|
+
@test_metric_file_name || "test_metrics.json"
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GitlabQuality
|
|
4
|
+
module TestTooling
|
|
5
|
+
module TestMetricsExporter
|
|
6
|
+
class Formatter < RSpec::Core::Formatters::BaseFormatter
|
|
7
|
+
RSpec::Core::Formatters.register(self, :stop)
|
|
8
|
+
|
|
9
|
+
def stop(notification)
|
|
10
|
+
setup_test_metrics_exporter(notification.examples)
|
|
11
|
+
|
|
12
|
+
log_test_metrics.push_test_metrics(
|
|
13
|
+
custom_keys_tags: config.custom_keys_tags,
|
|
14
|
+
custom_keys_fields: config.custom_keys_fields
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
log_test_metrics.save_test_metrics(
|
|
18
|
+
file_name: config.test_metric_file_name,
|
|
19
|
+
custom_keys_tags: config.custom_keys_tags,
|
|
20
|
+
custom_keys_fields: config.custom_keys_fields
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
private
|
|
25
|
+
|
|
26
|
+
attr_reader :log_test_metrics
|
|
27
|
+
|
|
28
|
+
def config
|
|
29
|
+
Config.configuration
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def setup_test_metrics_exporter(examples)
|
|
33
|
+
@log_test_metrics = LogTestMetrics.new(
|
|
34
|
+
examples: examples,
|
|
35
|
+
influxdb_url: config.influxdb_url,
|
|
36
|
+
influxdb_token: config.influxdb_token,
|
|
37
|
+
influxdb_bucket: config.influxdb_bucket,
|
|
38
|
+
run_type: config.run_type
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
data/lib/gitlab_quality/test_tooling/{test_metric → test_metrics_exporter}/log_test_metrics.rb
RENAMED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'json'
|
|
4
|
-
|
|
5
3
|
module GitlabQuality
|
|
6
4
|
module TestTooling
|
|
7
|
-
module
|
|
5
|
+
module TestMetricsExporter
|
|
8
6
|
class LogTestMetrics
|
|
9
|
-
include
|
|
10
|
-
include
|
|
7
|
+
include TestMetrics
|
|
8
|
+
include InfluxdbTools
|
|
11
9
|
|
|
12
10
|
CUSTOM_METRICS_KEY = :custom_test_metrics
|
|
13
11
|
|
|
@@ -39,7 +37,9 @@ module GitlabQuality
|
|
|
39
37
|
# @param [Array<String>] custom_keys_tags
|
|
40
38
|
# @param [Array<String>] custom_keys_fields
|
|
41
39
|
# @return [nil]
|
|
42
|
-
def save_test_metrics(file_name
|
|
40
|
+
def save_test_metrics(file_name:, custom_keys_tags: nil, custom_keys_fields: nil)
|
|
41
|
+
return Runtime::Logger.warn("No file_name provided, not saving test metrics") if file_name.nil?
|
|
42
|
+
|
|
43
43
|
@test_metrics ||= examples.filter_map { |example| parse_test_results(example, custom_keys_tags, custom_keys_fields) }
|
|
44
44
|
file = "tmp/#{file_name}"
|
|
45
45
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module GitlabQuality
|
|
4
4
|
module TestTooling
|
|
5
|
-
module
|
|
5
|
+
module TestMetricsExporter
|
|
6
6
|
module TestMetrics
|
|
7
7
|
# Single common timestamp for all exported example metrics to keep data points consistently grouped
|
|
8
8
|
#
|
|
@@ -30,7 +30,7 @@ module GitlabQuality
|
|
|
30
30
|
job_name: job_name,
|
|
31
31
|
merge_request: merge_request,
|
|
32
32
|
run_type: run_type,
|
|
33
|
-
|
|
33
|
+
feature_category: example.metadata[:feature_category],
|
|
34
34
|
product_group: example.metadata[:product_group],
|
|
35
35
|
exception_class: example.execution_result.exception&.class&.to_s,
|
|
36
36
|
**custom_metrics(example.metadata, custom_keys)
|
metadata
CHANGED
|
@@ -1,35 +1,15 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gitlab_quality-test_tooling
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.26.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: 2024-05-
|
|
11
|
+
date: 2024-05-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
-
- !ruby/object:Gem::Dependency
|
|
14
|
-
name: activesupport
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - ">="
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '6.1'
|
|
20
|
-
- - "<"
|
|
21
|
-
- !ruby/object:Gem::Version
|
|
22
|
-
version: '7.2'
|
|
23
|
-
type: :development
|
|
24
|
-
prerelease: false
|
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
26
|
-
requirements:
|
|
27
|
-
- - ">="
|
|
28
|
-
- !ruby/object:Gem::Version
|
|
29
|
-
version: '6.1'
|
|
30
|
-
- - "<"
|
|
31
|
-
- !ruby/object:Gem::Version
|
|
32
|
-
version: '7.2'
|
|
33
13
|
- !ruby/object:Gem::Dependency
|
|
34
14
|
name: climate_control
|
|
35
15
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -86,20 +66,6 @@ dependencies:
|
|
|
86
66
|
- - "~>"
|
|
87
67
|
- !ruby/object:Gem::Version
|
|
88
68
|
version: '4.7'
|
|
89
|
-
- !ruby/object:Gem::Dependency
|
|
90
|
-
name: influxdb-client
|
|
91
|
-
requirement: !ruby/object:Gem::Requirement
|
|
92
|
-
requirements:
|
|
93
|
-
- - "~>"
|
|
94
|
-
- !ruby/object:Gem::Version
|
|
95
|
-
version: '3.1'
|
|
96
|
-
type: :development
|
|
97
|
-
prerelease: false
|
|
98
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
99
|
-
requirements:
|
|
100
|
-
- - "~>"
|
|
101
|
-
- !ruby/object:Gem::Version
|
|
102
|
-
version: '3.1'
|
|
103
69
|
- !ruby/object:Gem::Dependency
|
|
104
70
|
name: lefthook
|
|
105
71
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -230,22 +196,16 @@ dependencies:
|
|
|
230
196
|
name: activesupport
|
|
231
197
|
requirement: !ruby/object:Gem::Requirement
|
|
232
198
|
requirements:
|
|
233
|
-
- - "
|
|
234
|
-
- !ruby/object:Gem::Version
|
|
235
|
-
version: '6.1'
|
|
236
|
-
- - "<"
|
|
199
|
+
- - "~>"
|
|
237
200
|
- !ruby/object:Gem::Version
|
|
238
|
-
version: '7.
|
|
201
|
+
version: '7.1'
|
|
239
202
|
type: :runtime
|
|
240
203
|
prerelease: false
|
|
241
204
|
version_requirements: !ruby/object:Gem::Requirement
|
|
242
205
|
requirements:
|
|
243
|
-
- - "
|
|
244
|
-
- !ruby/object:Gem::Version
|
|
245
|
-
version: '6.1'
|
|
246
|
-
- - "<"
|
|
206
|
+
- - "~>"
|
|
247
207
|
- !ruby/object:Gem::Version
|
|
248
|
-
version: '7.
|
|
208
|
+
version: '7.1'
|
|
249
209
|
- !ruby/object:Gem::Dependency
|
|
250
210
|
name: amatch
|
|
251
211
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -288,6 +248,20 @@ dependencies:
|
|
|
288
248
|
- - "~>"
|
|
289
249
|
- !ruby/object:Gem::Version
|
|
290
250
|
version: '5.0'
|
|
251
|
+
- !ruby/object:Gem::Dependency
|
|
252
|
+
name: influxdb-client
|
|
253
|
+
requirement: !ruby/object:Gem::Requirement
|
|
254
|
+
requirements:
|
|
255
|
+
- - "~>"
|
|
256
|
+
- !ruby/object:Gem::Version
|
|
257
|
+
version: '3.1'
|
|
258
|
+
type: :runtime
|
|
259
|
+
prerelease: false
|
|
260
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
261
|
+
requirements:
|
|
262
|
+
- - "~>"
|
|
263
|
+
- !ruby/object:Gem::Version
|
|
264
|
+
version: '3.1'
|
|
291
265
|
- !ruby/object:Gem::Dependency
|
|
292
266
|
name: nokogiri
|
|
293
267
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -438,8 +412,6 @@ files:
|
|
|
438
412
|
- lefthook.yml
|
|
439
413
|
- lib/gitlab_quality/test_tooling.rb
|
|
440
414
|
- lib/gitlab_quality/test_tooling/concerns/find_set_dri.rb
|
|
441
|
-
- lib/gitlab_quality/test_tooling/concerns/influxdb_tools.rb
|
|
442
|
-
- lib/gitlab_quality/test_tooling/concerns/test_metrics.rb
|
|
443
415
|
- lib/gitlab_quality/test_tooling/failed_jobs_table.rb
|
|
444
416
|
- lib/gitlab_quality/test_tooling/gitlab_client/branches_client.rb
|
|
445
417
|
- lib/gitlab_quality/test_tooling/gitlab_client/branches_dry_client.rb
|
|
@@ -497,8 +469,12 @@ files:
|
|
|
497
469
|
- lib/gitlab_quality/test_tooling/test_meta/processor/meta_processor.rb
|
|
498
470
|
- lib/gitlab_quality/test_tooling/test_meta/test_meta_updater.rb
|
|
499
471
|
- lib/gitlab_quality/test_tooling/test_metric/json_test_metric.rb
|
|
500
|
-
- lib/gitlab_quality/test_tooling/test_metric/log_test_metrics.rb
|
|
501
472
|
- lib/gitlab_quality/test_tooling/test_metrics/json_test_metric_collection.rb
|
|
473
|
+
- lib/gitlab_quality/test_tooling/test_metrics_exporter/config.rb
|
|
474
|
+
- lib/gitlab_quality/test_tooling/test_metrics_exporter/formatter.rb
|
|
475
|
+
- lib/gitlab_quality/test_tooling/test_metrics_exporter/influxdb_tools.rb
|
|
476
|
+
- lib/gitlab_quality/test_tooling/test_metrics_exporter/log_test_metrics.rb
|
|
477
|
+
- lib/gitlab_quality/test_tooling/test_metrics_exporter/test_metrics.rb
|
|
502
478
|
- lib/gitlab_quality/test_tooling/test_result/base_test_result.rb
|
|
503
479
|
- lib/gitlab_quality/test_tooling/test_result/j_unit_test_result.rb
|
|
504
480
|
- lib/gitlab_quality/test_tooling/test_result/json_test_result.rb
|