gitlab_quality-test_tooling 1.26.1 → 1.27.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- 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/runtime/logger.rb +5 -1
- 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 +12 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34edb6377d3304f4b061a5704e9ba865cd550209c7fefda3c66b6734f2b95ce5
|
4
|
+
data.tar.gz: e00f10eaf9690f803168a86da44417b5bdc02f074773819f6deb6fa466bef23e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ced20afebe7dbdcc5e47fcc3c864db514bd2d2b4920d6085683c201444243e5ec023cde39c7d333d28acd6a2539f35dfe6af21ee881d2442f48e5c4335b164c
|
7
|
+
data.tar.gz: 9d279b982fb6438e064db0336b532fbd0ba7e803e16b65e678576fca037120cc7a327bba21d6ab3400122e6aee18060e900eb14d1063aed77f61d57df73f8cab
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gitlab_quality-test_tooling (1.
|
5
|
-
activesupport (
|
4
|
+
gitlab_quality-test_tooling (1.27.1)
|
5
|
+
activesupport (>= 7.0, < 7.2)
|
6
6
|
amatch (~> 0.4.1)
|
7
7
|
gitlab (~> 4.19)
|
8
8
|
http (~> 5.0)
|
@@ -330,4 +330,4 @@ DEPENDENCIES
|
|
330
330
|
webmock (= 3.7.0)
|
331
331
|
|
332
332
|
BUNDLED WITH
|
333
|
-
2.5.
|
333
|
+
2.5.4
|
@@ -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'
|
@@ -38,7 +38,11 @@ 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
|
-
ActiveSupport
|
41
|
+
if ActiveSupport.const_defined?(:BroadcastLogger) # only available in ActiveSupport >= 7.1.0
|
42
|
+
ActiveSupport::BroadcastLogger.new(console_log, file_log, file_log)
|
43
|
+
else
|
44
|
+
console_log.extend(ActiveSupport::Logger.broadcast(file_log))
|
45
|
+
end
|
42
46
|
end
|
43
47
|
end
|
44
48
|
|
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.
|
4
|
+
version: 1.27.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-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: climate_control
|
@@ -196,16 +196,22 @@ dependencies:
|
|
196
196
|
name: activesupport
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
|
-
- - "
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '7.0'
|
202
|
+
- - "<"
|
200
203
|
- !ruby/object:Gem::Version
|
201
|
-
version: '7.
|
204
|
+
version: '7.2'
|
202
205
|
type: :runtime
|
203
206
|
prerelease: false
|
204
207
|
version_requirements: !ruby/object:Gem::Requirement
|
205
208
|
requirements:
|
206
|
-
- - "
|
209
|
+
- - ">="
|
210
|
+
- !ruby/object:Gem::Version
|
211
|
+
version: '7.0'
|
212
|
+
- - "<"
|
207
213
|
- !ruby/object:Gem::Version
|
208
|
-
version: '7.
|
214
|
+
version: '7.2'
|
209
215
|
- !ruby/object:Gem::Dependency
|
210
216
|
name: amatch
|
211
217
|
requirement: !ruby/object:Gem::Requirement
|