gitlab_quality-test_tooling 1.26.0 → 1.27.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 +4 -4
- data/Gemfile.lock +6 -7
- data/lib/gitlab_quality/test_tooling/report/failed_test_issue.rb +9 -8
- data/lib/gitlab_quality/test_tooling/report/flaky_test_issue.rb +9 -8
- data/lib/gitlab_quality/test_tooling/report/report_as_issue.rb +20 -3
- data/lib/gitlab_quality/test_tooling/report/slow_test_issue.rb +7 -1
- data/lib/gitlab_quality/test_tooling/runtime/env.rb +1 -3
- data/lib/gitlab_quality/test_tooling/test_metrics_exporter/config.rb +10 -10
- data/lib/gitlab_quality/test_tooling/test_metrics_exporter/formatter.rb +4 -4
- data/lib/gitlab_quality/test_tooling/test_metrics_exporter/influxdb_tools.rb +2 -0
- data/lib/gitlab_quality/test_tooling/version.rb +1 -1
- metadata +20 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5b3317b1df5c3f923259fb0dbb71e9cfdf9b4e32f9338b2189758538aaacb30
|
4
|
+
data.tar.gz: 60fda58d2a830e1849c8175347050cb81f62658a20e1ee4c9bdde2cb3049d965
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c70f1860b051ccd633aae6cb58298a90edecdd8a93a598e76f90ac8b2a337f755d77e30fa8b1dd6bcd3df7473c9af31c8a6e46509b59a5047d1be03a4bb2910
|
7
|
+
data.tar.gz: 1ae2fbf63375f49d43ef28cb5a5ec44af6940a5ffd46b43a07c07855085449994858bc49b4ca61c0cd73737c7d4960de9f5f092019681668ad339326f069c741
|
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.27.0)
|
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)
|
@@ -29,15 +29,10 @@ module GitlabQuality
|
|
29
29
|
MultipleNotesFound = Class.new(StandardError)
|
30
30
|
|
31
31
|
def initialize(
|
32
|
-
token:,
|
33
|
-
input_files:,
|
34
32
|
base_issue_labels: nil,
|
35
|
-
dry_run: false,
|
36
|
-
related_issues_file: nil,
|
37
|
-
project: nil,
|
38
33
|
max_diff_ratio: DEFAULT_MAX_DIFF_RATIO_FOR_DETECTION,
|
39
|
-
**
|
40
|
-
super(
|
34
|
+
**kwargs)
|
35
|
+
super(**kwargs)
|
41
36
|
|
42
37
|
@base_issue_labels = Set.new(base_issue_labels)
|
43
38
|
@max_diff_ratio = max_diff_ratio.to_f
|
@@ -64,7 +59,13 @@ module GitlabQuality
|
|
64
59
|
puts " => Reporting failure for test '#{test.name}'..."
|
65
60
|
|
66
61
|
issues = find_issues_by_hash(test_hash(test), state: 'opened', labels: SEARCH_LABELS)
|
67
|
-
|
62
|
+
|
63
|
+
if issues.empty?
|
64
|
+
issues << create_issue(test)
|
65
|
+
else
|
66
|
+
# Keep issues description up-to-date
|
67
|
+
update_issues(issues, test)
|
68
|
+
end
|
68
69
|
|
69
70
|
update_reports(issues, test)
|
70
71
|
collect_issues(test, issues)
|
@@ -27,14 +27,9 @@ module GitlabQuality
|
|
27
27
|
DOC
|
28
28
|
|
29
29
|
def initialize(
|
30
|
-
token:,
|
31
|
-
input_files:,
|
32
30
|
base_issue_labels: nil,
|
33
|
-
|
34
|
-
|
35
|
-
project: nil,
|
36
|
-
**_kwargs)
|
37
|
-
super(token: token, input_files: input_files, project: project, confidential: confidential, dry_run: dry_run)
|
31
|
+
**kwargs)
|
32
|
+
super(**kwargs)
|
38
33
|
|
39
34
|
@base_issue_labels = Set.new(base_issue_labels)
|
40
35
|
end
|
@@ -60,7 +55,13 @@ module GitlabQuality
|
|
60
55
|
puts " => Reporting flakiness for test '#{test.name}'..."
|
61
56
|
|
62
57
|
issues = find_issues_by_hash(test_hash(test), state: 'opened', labels: SEARCH_LABELS)
|
63
|
-
|
58
|
+
|
59
|
+
if issues.empty?
|
60
|
+
issues << create_issue(test)
|
61
|
+
else
|
62
|
+
# Keep issues description up-to-date
|
63
|
+
update_issues(issues, test)
|
64
|
+
end
|
64
65
|
|
65
66
|
update_reports(issues, test)
|
66
67
|
collect_issues(test, issues)
|
@@ -51,17 +51,19 @@ module GitlabQuality
|
|
51
51
|
|
52
52
|
def new_issue_description(test)
|
53
53
|
<<~DESCRIPTION
|
54
|
-
### Test metadata
|
54
|
+
### Test metadata
|
55
55
|
|
56
|
+
<!-- Don't modify this section as it's auto-generated -->
|
56
57
|
| Field | Value |
|
57
58
|
| ------ | ------ |
|
58
59
|
| File URL | #{test.test_file_link} |
|
59
60
|
| Filename | `#{test.file}` |
|
60
61
|
| Description | `#{test.name}` |
|
61
|
-
| Test level |
|
62
|
+
| Test level | `#{test.level}` |
|
62
63
|
| Hash | `#{test_hash(test)}` |
|
63
|
-
|
|
64
|
+
| Max expected duration | < #{test.max_duration_for_test} seconds |
|
64
65
|
#{"| Test case | #{test.testcase} |" if test.testcase}
|
66
|
+
<!-- Don't modify this section as it's auto-generated -->
|
65
67
|
DESCRIPTION
|
66
68
|
end
|
67
69
|
|
@@ -111,6 +113,21 @@ module GitlabQuality
|
|
111
113
|
end
|
112
114
|
end
|
113
115
|
|
116
|
+
def update_issues(issues, test)
|
117
|
+
issues.each do |issue|
|
118
|
+
update_issue(issue, test)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
def update_issue(issue, test)
|
123
|
+
issue_attrs = {
|
124
|
+
description: new_issue_description(test)
|
125
|
+
}
|
126
|
+
return if issue.description == issue_attrs[:description]
|
127
|
+
|
128
|
+
gitlab.edit_issue(iid: issue.iid, options: issue_attrs)
|
129
|
+
end
|
130
|
+
|
114
131
|
def issue_labels(issue)
|
115
132
|
issue&.labels&.to_set || Set.new
|
116
133
|
end
|
@@ -45,7 +45,13 @@ module GitlabQuality
|
|
45
45
|
puts " => Reporting slowness for test '#{test.name}'..."
|
46
46
|
|
47
47
|
issues = find_issues_by_hash(test_hash(test), state: 'opened', labels: SEARCH_LABELS)
|
48
|
-
|
48
|
+
|
49
|
+
if issues.empty?
|
50
|
+
issues << create_issue(test)
|
51
|
+
else
|
52
|
+
# Keep issues description up-to-date
|
53
|
+
update_issues(issues, test)
|
54
|
+
end
|
49
55
|
|
50
56
|
update_reports(issues, test)
|
51
57
|
collect_issues(test, issues)
|
@@ -81,9 +81,7 @@ module GitlabQuality
|
|
81
81
|
live_envs = %w[staging staging-canary staging-ref canary preprod production]
|
82
82
|
return unless live_envs.include?(ci_project_name)
|
83
83
|
|
84
|
-
test_subset = if env_var_value_if_defined('
|
85
|
-
'sanity-no-admin'
|
86
|
-
elsif env_var_value_if_defined('SMOKE_ONLY') == 'true'
|
84
|
+
test_subset = if env_var_value_if_defined('SMOKE_ONLY') == 'true'
|
87
85
|
'sanity'
|
88
86
|
else
|
89
87
|
'full'
|
@@ -5,19 +5,19 @@ require "singleton"
|
|
5
5
|
module GitlabQuality
|
6
6
|
module TestTooling
|
7
7
|
module TestMetricsExporter
|
8
|
-
class << self
|
9
|
-
def configuration
|
10
|
-
Config.instance
|
11
|
-
end
|
12
|
-
|
13
|
-
def configure
|
14
|
-
yield(configuration)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
8
|
class Config
|
19
9
|
include Singleton
|
20
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
21
|
attr_accessor :influxdb_url,
|
22
22
|
:influxdb_token,
|
23
23
|
:influxdb_bucket,
|
@@ -6,8 +6,8 @@ module GitlabQuality
|
|
6
6
|
class Formatter < RSpec::Core::Formatters::BaseFormatter
|
7
7
|
RSpec::Core::Formatters.register(self, :stop)
|
8
8
|
|
9
|
-
def stop(
|
10
|
-
setup_test_metrics_exporter
|
9
|
+
def stop(notification)
|
10
|
+
setup_test_metrics_exporter(notification.examples)
|
11
11
|
|
12
12
|
log_test_metrics.push_test_metrics(
|
13
13
|
custom_keys_tags: config.custom_keys_tags,
|
@@ -29,9 +29,9 @@ module GitlabQuality
|
|
29
29
|
Config.configuration
|
30
30
|
end
|
31
31
|
|
32
|
-
def setup_test_metrics_exporter
|
32
|
+
def setup_test_metrics_exporter(examples)
|
33
33
|
@log_test_metrics = LogTestMetrics.new(
|
34
|
-
examples:
|
34
|
+
examples: examples,
|
35
35
|
influxdb_url: config.influxdb_url,
|
36
36
|
influxdb_token: config.influxdb_token,
|
37
37
|
influxdb_bucket: config.influxdb_bucket,
|
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.27.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-05-
|
11
|
+
date: 2024-05-23 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
|