gitlab-qa 6.9.0 → 6.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/gitlab-qa.gemspec +2 -2
- data/lib/gitlab/qa/component/base.rb +7 -0
- data/lib/gitlab/qa/docker/engine.rb +8 -0
- data/lib/gitlab/qa/report/generate_test_session.rb +4 -4
- data/lib/gitlab/qa/report/gitlab_issue_client.rb +1 -1
- data/lib/gitlab/qa/report/results_in_issues.rb +10 -8
- data/lib/gitlab/qa/report/test_result.rb +9 -0
- data/lib/gitlab/qa/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7b24a0d671a29568447a0db95b57a06c43ed750d220dc13a0ad8216b7ba6297
|
4
|
+
data.tar.gz: 9e03938be0b67f4f9a522703156bfc1b191ac0b8b97661c5eb74b82bfd91c84f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21ea402dd74ab453e9ac303303f50925a32a82e58b7e4ff0aa57721d4e8301717febc4da56b1b5b3c7141ad7f0e613b56fc7d47b7a25256b83f07ec53980db33
|
7
|
+
data.tar.gz: e31d991f0f78bfc510dbaafb3a844126d95c2e46655b2d655c256dcdfda673ca8038085c33deb65caa00728effb63e75020e3f6c217ddc697e87ceaded1270ba
|
data/gitlab-qa.gemspec
CHANGED
@@ -27,8 +27,8 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_development_dependency 'rubocop', '~> 0.82.0'
|
28
28
|
spec.add_development_dependency 'rubocop-rspec', '~> 1.36'
|
29
29
|
spec.add_development_dependency 'webmock', '3.7.0'
|
30
|
-
spec.add_runtime_dependency 'activesupport', '~>
|
31
|
-
spec.add_runtime_dependency 'gitlab', '~>
|
30
|
+
spec.add_runtime_dependency 'activesupport', '~> 6.0.2'
|
31
|
+
spec.add_runtime_dependency 'gitlab', '~> 4.16.1'
|
32
32
|
spec.add_runtime_dependency 'http', '4.3.0'
|
33
33
|
spec.add_runtime_dependency 'nokogiri', '~> 1.10'
|
34
34
|
spec.add_runtime_dependency 'table_print', '1.5.6'
|
@@ -53,6 +53,7 @@ module Gitlab
|
|
53
53
|
|
54
54
|
def prepare
|
55
55
|
prepare_docker_image
|
56
|
+
prepare_docker_container
|
56
57
|
prepare_network
|
57
58
|
end
|
58
59
|
|
@@ -70,6 +71,12 @@ module Gitlab
|
|
70
71
|
docker.network_create(network)
|
71
72
|
end
|
72
73
|
|
74
|
+
def prepare_docker_container
|
75
|
+
return unless docker.container_exists?(name)
|
76
|
+
|
77
|
+
docker.remove(name)
|
78
|
+
end
|
79
|
+
|
73
80
|
def start # rubocop:disable Metrics/AbcSize
|
74
81
|
docker.run(image, tag) do |command|
|
75
82
|
command << "-d"
|
@@ -63,6 +63,14 @@ module Gitlab
|
|
63
63
|
Docker::Command.execute("rm -f #{name}")
|
64
64
|
end
|
65
65
|
|
66
|
+
def container_exists?(name)
|
67
|
+
Docker::Command.execute("container inspect #{name}")
|
68
|
+
rescue Docker::Shellout::StatusError
|
69
|
+
false
|
70
|
+
else
|
71
|
+
true
|
72
|
+
end
|
73
|
+
|
66
74
|
def network_exists?(name)
|
67
75
|
Docker::Command.execute("network inspect #{name}")
|
68
76
|
rescue Docker::Shellout::StatusError
|
@@ -161,11 +161,11 @@ module Gitlab
|
|
161
161
|
end
|
162
162
|
|
163
163
|
def generate_test_job(tests_with_same_testcase)
|
164
|
-
tests_with_same_testcase.map
|
165
|
-
ci_job_id = ci_job_url[/\d+\z/]
|
164
|
+
tests_with_same_testcase.map do |test|
|
165
|
+
ci_job_id = test.ci_job_url[/\d+\z/]
|
166
166
|
|
167
|
-
"[#{ci_job_id}](#{ci_job_url})"
|
168
|
-
end.join(', ')
|
167
|
+
"[#{ci_job_id}](#{test.ci_job_url})#{' ~"quarantine"' if test.quarantine?}"
|
168
|
+
end.uniq.join(', ')
|
169
169
|
end
|
170
170
|
|
171
171
|
def generate_test_status(tests_with_same_testcase)
|
@@ -59,7 +59,7 @@ module Gitlab
|
|
59
59
|
|
60
60
|
def find_issue_discussions(iid:)
|
61
61
|
handle_gitlab_client_exceptions do
|
62
|
-
Gitlab.issue_discussions(project, iid, order_by: 'created_at', sort: 'asc')
|
62
|
+
Gitlab.issue_discussions(project, iid, order_by: 'created_at', sort: 'asc').auto_paginate
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
@@ -41,9 +41,13 @@ module Gitlab
|
|
41
41
|
test.testcase ||= issue.web_url
|
42
42
|
|
43
43
|
update_labels(issue, test)
|
44
|
-
note_status(issue, test)
|
44
|
+
note_posted = note_status(issue, test)
|
45
45
|
|
46
|
-
|
46
|
+
if note_posted
|
47
|
+
puts "Issue updated."
|
48
|
+
else
|
49
|
+
puts "Test passed, no update needed."
|
50
|
+
end
|
47
51
|
end
|
48
52
|
|
49
53
|
def find_issue(test)
|
@@ -79,7 +83,7 @@ module Gitlab
|
|
79
83
|
end
|
80
84
|
|
81
85
|
def note_status(issue, test)
|
82
|
-
return if test.failures.empty?
|
86
|
+
return false if test.failures.empty?
|
83
87
|
|
84
88
|
note = note_content(test)
|
85
89
|
|
@@ -88,6 +92,8 @@ module Gitlab
|
|
88
92
|
end
|
89
93
|
|
90
94
|
gitlab.create_issue_note(iid: issue.iid, note: note)
|
95
|
+
|
96
|
+
true
|
91
97
|
end
|
92
98
|
|
93
99
|
def note_content(test)
|
@@ -125,11 +131,7 @@ module Gitlab
|
|
125
131
|
end
|
126
132
|
|
127
133
|
def error_and_stack_trace(text)
|
128
|
-
|
129
|
-
|
130
|
-
warn "Could not find `Error:` in text: #{text}" if result.empty?
|
131
|
-
|
132
|
-
result
|
134
|
+
text.strip[/Error:(.*)/m, 1].to_s
|
133
135
|
end
|
134
136
|
end
|
135
137
|
end
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'active_support/core_ext/object/blank'
|
4
|
+
|
3
5
|
module Gitlab
|
4
6
|
module QA
|
5
7
|
module Report
|
@@ -78,6 +80,13 @@ module Gitlab
|
|
78
80
|
report['failure_issue'] = new_failure_issue
|
79
81
|
end
|
80
82
|
|
83
|
+
def quarantine?
|
84
|
+
# The value for 'quarantine' could be nil, a hash, a string,
|
85
|
+
# or true (if the test just has the :quarantine tag)
|
86
|
+
# But any non-nil or false value should means the test is in quarantine
|
87
|
+
report['quarantine'].present?
|
88
|
+
end
|
89
|
+
|
81
90
|
private
|
82
91
|
|
83
92
|
# rubocop:disable Metrics/AbcSize
|
data/lib/gitlab/qa/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-qa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grzegorz Bizon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: climate_control
|
@@ -142,14 +142,14 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 4.
|
145
|
+
version: 4.16.1
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 4.
|
152
|
+
version: 4.16.1
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: http
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|