gitlab_quality-test_tooling 1.26.1 → 1.27.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- 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/influxdb_tools.rb +2 -0
- data/lib/gitlab_quality/test_tooling/version.rb +1 -1
- metadata +2 -2
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,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gitlab_quality-test_tooling (1.
|
4
|
+
gitlab_quality-test_tooling (1.27.0)
|
5
5
|
activesupport (~> 7.1)
|
6
6
|
amatch (~> 0.4.1)
|
7
7
|
gitlab (~> 4.19)
|
@@ -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'
|
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.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
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: climate_control
|