gitlab-qa 8.4.2 → 8.6.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/.rubocop_todo.yml +0 -12
- data/Gemfile.lock +1 -1
- data/exe/gitlab-qa +1 -1
- data/lib/gitlab/qa/component/base.rb +2 -2
- data/lib/gitlab/qa/component/gitlab.rb +1 -1
- data/lib/gitlab/qa/component/staging.rb +17 -35
- data/lib/gitlab/qa/component/suggested_reviewer.rb +47 -0
- data/lib/gitlab/qa/docker/command.rb +3 -14
- data/lib/gitlab/qa/docker/engine.rb +1 -1
- data/lib/gitlab/qa/release.rb +6 -2
- data/lib/gitlab/qa/report/find_set_dri.rb +43 -0
- data/lib/gitlab/qa/report/gitlab_issue_client.rb +7 -0
- data/lib/gitlab/qa/report/relate_failure_issue.rb +16 -0
- data/lib/gitlab/qa/report/results_reporter_shared.rb +1 -1
- data/lib/gitlab/qa/report/test_result.rb +8 -0
- data/lib/gitlab/qa/runtime/env.rb +5 -14
- data/lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb +62 -0
- data/lib/gitlab/qa/scenario/test/omnibus/update_from_previous.rb +1 -1
- data/lib/gitlab/qa/service/cluster_provider/base.rb +33 -0
- data/lib/gitlab/qa/service/cluster_provider/k3d.rb +141 -0
- data/lib/gitlab/qa/service/kubernetes_cluster.rb +62 -0
- data/lib/gitlab/qa/support/shell_command.rb +98 -0
- data/lib/gitlab/qa/support/shellout.rb +16 -0
- data/lib/gitlab/qa/version.rb +1 -1
- data/lib/gitlab/qa.rb +0 -1
- data/support/manifests/suggested_reviewer/authenticator.yaml +41 -0
- data/support/manifests/suggested_reviewer/postgres.yaml +84 -0
- data/support/manifests/suggested_reviewer/pubsub.yaml +41 -0
- data/support/manifests/suggested_reviewer/recommender-bot.yaml +242 -0
- data/support/manifests/suggested_reviewer/recommender.yaml +52 -0
- metadata +15 -7
- data/lib/gitlab/qa/component/internet_tunnel.rb +0 -76
- data/lib/gitlab/qa/docker/shellout.rb +0 -77
- data/lib/gitlab/qa/scenario/test/integration/kubernetes.rb +0 -56
- data/lib/gitlab/qa/scenario/test/integration/ssh_tunnel.rb +0 -56
- data/lib/gitlab/qa/support/dev_ee_qa_image.rb +0 -54
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cedbc28c7349c22c56af141445b79d1c7c29444f66d191f465a91e8d0fc244ae
|
4
|
+
data.tar.gz: 9b857df0ad9502c59aa081fb7b1ebb2865bc7c4339c49c6f37a356c08eb1740a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4231efbe843158613694938667c8402d5dcbddeb918fb19cf00743839c80c5bc05917c264474d48e3558dd33978e9973baecad229a041873473faa1ce376122c
|
7
|
+
data.tar.gz: 7a9c4a7efd9b4759c6c487e8872ca76cfb35cc6b91cebc90e2c77b61d742b5ed2f68acd044f6b86cbfce30d822423ddd4e09cae2b5c26dd4ea2a26a72364c5e9
|
data/.rubocop_todo.yml
CHANGED
@@ -57,12 +57,6 @@ Naming/RescuedExceptionsVariableName:
|
|
57
57
|
Exclude:
|
58
58
|
- 'lib/gitlab/qa/component/staging.rb'
|
59
59
|
|
60
|
-
# Offense count: 3
|
61
|
-
# Cop supports --auto-correct.
|
62
|
-
RSpec/EmptyLineAfterLetBlock:
|
63
|
-
Exclude:
|
64
|
-
- 'spec/gitlab/qa/support/dev_ee_qa_image_spec.rb'
|
65
|
-
|
66
60
|
# Offense count: 4
|
67
61
|
# Cop supports --auto-correct.
|
68
62
|
# Configuration parameters: CustomTransform, IgnoredWords.
|
@@ -70,12 +64,6 @@ RSpec/ExampleWording:
|
|
70
64
|
Exclude:
|
71
65
|
- 'spec/gitlab/qa/component/gitlab_spec.rb'
|
72
66
|
|
73
|
-
# Offense count: 1
|
74
|
-
# Configuration parameters: CustomTransform, IgnoreMethods, SpecSuffixOnly.
|
75
|
-
RSpec/FilePath:
|
76
|
-
Exclude:
|
77
|
-
- 'spec/gitlab/qa/support/dev_ee_qa_image_spec.rb'
|
78
|
-
|
79
67
|
# Offense count: 2
|
80
68
|
RSpec/LeakyConstantDeclaration:
|
81
69
|
Exclude:
|
data/Gemfile.lock
CHANGED
data/exe/gitlab-qa
CHANGED
@@ -157,11 +157,11 @@ module Gitlab
|
|
157
157
|
reconfigure
|
158
158
|
wait_until_ready
|
159
159
|
process_exec_commands
|
160
|
-
rescue
|
160
|
+
rescue Support::ShellCommand::StatusError => e
|
161
161
|
# for scenarios where a service fails during startup, attempt to retry to avoid flaky failures
|
162
162
|
if (retries += 1) < 3
|
163
163
|
Runtime::Logger.warn(
|
164
|
-
"Retry instance_no_teardown due to
|
164
|
+
"Retry instance_no_teardown due to Support::ShellCommand::StatusError -- attempt #{retries}"
|
165
165
|
)
|
166
166
|
teardown!
|
167
167
|
retry
|
@@ -338,7 +338,7 @@ module Gitlab
|
|
338
338
|
output = docker.inspect(name) { |command| command << "--format='{{json .State.Health.Status}}'" }
|
339
339
|
|
340
340
|
output == '"healthy"'
|
341
|
-
rescue
|
341
|
+
rescue Support::ShellCommand::StatusError
|
342
342
|
false
|
343
343
|
end
|
344
344
|
end
|
@@ -20,31 +20,21 @@ module Gitlab
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def self.image
|
23
|
+
# QA images are tagged with the following logic
|
24
|
+
# 1. For auto-deploy versions, they are tagged with their corresponding commit SHA
|
25
|
+
# That is, if auto-deploy version is `15.4.202209150620+70251a89db4.a625f183e2e`,
|
26
|
+
# the QA image tag will be `70251a89db4`
|
27
|
+
# 2. For stable/RC versions, they are tagged with the version with `v` prefix.
|
28
|
+
# That is, if the version is `15.3.3-ee`, the QA image tag will be `v15.3.3-ee`
|
29
|
+
# These images are available from the GitLab project's container registry.
|
30
|
+
|
31
|
+
# If token to access dev.gitlab.org registry is provided, we will
|
32
|
+
# fetch from there. Else, we will try to fetch from GitLab.com
|
33
|
+
# registry.
|
23
34
|
if Runtime::Env.dev_access_token_variable
|
24
|
-
|
25
|
-
# where `5159f2949cb` is the EE commit SHA. QA images are tagged using
|
26
|
-
# the version from the VERSION file and this commit SHA, e.g.
|
27
|
-
# `12.0-5159f2949cb` (note that the `major.minor` doesn't necessarily match).
|
28
|
-
# To work around that, we're fetching the `revision` from the version API
|
29
|
-
# and then find the corresponding QA image in the
|
30
|
-
# `dev.gitlab.org:5005/gitlab/omnibus-gitlab/gitlab-ee-qa` container
|
31
|
-
# registry, based on this revision.
|
32
|
-
# See:
|
33
|
-
# - https://gitlab.com/gitlab-org/quality/staging/issues/56
|
34
|
-
# - https://gitlab.com/gitlab-org/release/framework/issues/421
|
35
|
-
# - https://gitlab.com/gitlab-org/gitlab-qa/issues/398
|
36
|
-
#
|
37
|
-
# For official builds (currently deployed on preprod) we use the version
|
38
|
-
# string e.g. '12.5.4-ee' for tag matching
|
39
|
-
Support::DevEEQAImage.new.retrieve_image_from_container_registry!(tag_end)
|
35
|
+
"dev.gitlab.org:5005/gitlab/gitlab-ee/gitlab-ee-qa:#{tag}"
|
40
36
|
else
|
41
|
-
|
42
|
-
# but the version api returns a semver version like 12.0.1
|
43
|
-
# so images are tagged using minor and major semver components plus
|
44
|
-
# the EE commit ref, which is the 'revision' returned by the API
|
45
|
-
# and so the version used for the docker image tag is like 12.0-5159f2949cb
|
46
|
-
# See: https://gitlab.com/gitlab-org/quality/staging/issues/56
|
47
|
-
"ee:#{Version.new(address).major_minor_revision}"
|
37
|
+
"registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:#{tag}"
|
48
38
|
end
|
49
39
|
end
|
50
40
|
|
@@ -52,8 +42,8 @@ module Gitlab
|
|
52
42
|
self::ADDRESS
|
53
43
|
end
|
54
44
|
|
55
|
-
def self.
|
56
|
-
@
|
45
|
+
def self.tag
|
46
|
+
@tag ||= Version.new(address).tag
|
57
47
|
end
|
58
48
|
|
59
49
|
class Version
|
@@ -65,16 +55,8 @@ module Gitlab
|
|
65
55
|
Runtime::Env.require_qa_access_token!
|
66
56
|
end
|
67
57
|
|
68
|
-
def
|
69
|
-
official? ? version : revision
|
70
|
-
end
|
71
|
-
|
72
|
-
def major_minor_revision
|
73
|
-
api_response = api_get!
|
74
|
-
version_regexp = /^v?(?<major>\d+)\.(?<minor>\d+)\.\d+/
|
75
|
-
match = version_regexp.match(api_response.fetch('version'))
|
76
|
-
|
77
|
-
"#{match[:major]}.#{match[:minor]}-#{api_response.fetch('revision')}"
|
58
|
+
def tag
|
59
|
+
official? ? "v#{version}" : revision
|
78
60
|
end
|
79
61
|
|
80
62
|
private
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Gitlab
|
4
|
+
module QA
|
5
|
+
module Component
|
6
|
+
class SuggestedReviewer
|
7
|
+
include Scenario::Actable
|
8
|
+
|
9
|
+
# Source: https://gitlab.com/gitlab-org/modelops/applied-ml/review-recommender/cluster-management
|
10
|
+
MANIFESTS_PATH = File.expand_path('../../../../support/manifests/suggested_reviewer', __dir__)
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
@cluster = Service::KubernetesCluster.new(provider_class: Service::ClusterProvider::K3d)
|
14
|
+
end
|
15
|
+
|
16
|
+
def name
|
17
|
+
@name ||= "suggested_reviewer"
|
18
|
+
end
|
19
|
+
|
20
|
+
def prepare
|
21
|
+
@cluster.create_registry_mirror
|
22
|
+
end
|
23
|
+
|
24
|
+
def create_cluster
|
25
|
+
@cluster.create!
|
26
|
+
end
|
27
|
+
|
28
|
+
def deploy_services
|
29
|
+
Dir.glob(File.join(MANIFESTS_PATH, '**/*')).each do |file|
|
30
|
+
Runtime::Logger.info("Applying manifest #{file}")
|
31
|
+
@cluster.apply_manifest(File.read(file))
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def teardown
|
36
|
+
@cluster.remove!
|
37
|
+
end
|
38
|
+
|
39
|
+
def wait_until_ready; end
|
40
|
+
|
41
|
+
def teardown?
|
42
|
+
!Runtime::Scenario.attributes.include?(:teardown) || Runtime::Scenario.teardown
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -4,7 +4,7 @@ module Gitlab
|
|
4
4
|
module QA
|
5
5
|
module Docker
|
6
6
|
class Command
|
7
|
-
attr_reader :args
|
7
|
+
attr_reader :args
|
8
8
|
|
9
9
|
# Shell command
|
10
10
|
#
|
@@ -41,24 +41,13 @@ module Gitlab
|
|
41
41
|
"docker #{@args.join(' ')}"
|
42
42
|
end
|
43
43
|
|
44
|
-
# Returns a masked string form of a Command
|
45
|
-
#
|
46
|
-
# @example
|
47
|
-
# Command.new('a docker command', mask_secrets: 'command').mask_secrets #=> 'a docker *****'
|
48
|
-
# Command.new('a docker command', mask_secrets: %w[docker command]).mask_secrets #=> 'a ***** *****'
|
49
|
-
#
|
50
|
-
# @return [String] The masked command string
|
51
|
-
def mask_secrets
|
52
|
-
@mask_secrets.each_with_object(+to_s) { |secret, s| s.gsub!(secret, '*****') }
|
53
|
-
end
|
54
|
-
|
55
44
|
def ==(other)
|
56
45
|
to_s == other.to_s
|
57
46
|
end
|
58
47
|
|
59
48
|
def execute!(&block)
|
60
|
-
|
61
|
-
rescue
|
49
|
+
Support::ShellCommand.new(to_s, mask_secrets: @mask_secrets, stream_output: @stream_output).execute!(&block)
|
50
|
+
rescue Support::ShellCommand::StatusError => e
|
62
51
|
e.set_backtrace([])
|
63
52
|
|
64
53
|
raise e
|
data/lib/gitlab/qa/release.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "active_support/core_ext/module/delegation"
|
4
|
+
|
3
5
|
module Gitlab
|
4
6
|
module QA
|
5
7
|
class Release
|
@@ -23,6 +25,8 @@ module Gitlab
|
|
23
25
|
\z
|
24
26
|
}xi.freeze
|
25
27
|
|
28
|
+
delegate :ci_project_path, to: Gitlab::QA::Runtime::Env
|
29
|
+
|
26
30
|
# Official dev tag example:
|
27
31
|
# 12.5.4(-rc42)-ee
|
28
32
|
# |-------------|--|
|
@@ -109,7 +113,7 @@ module Gitlab
|
|
109
113
|
def qa_image
|
110
114
|
@qa_image ||= if omnibus_mirror?
|
111
115
|
omnibus_project = image.match(CUSTOM_GITLAB_IMAGE_REGEX)[:project]
|
112
|
-
gitlab_project = "/gitlab-org/gitlab/"
|
116
|
+
gitlab_project = ci_project_path ? "/#{ci_project_path}/" : "/gitlab-org/gitlab/"
|
113
117
|
|
114
118
|
"#{image.gsub(omnibus_project, gitlab_project)}-qa"
|
115
119
|
else
|
@@ -139,7 +143,7 @@ module Gitlab
|
|
139
143
|
# Tag scheme for gitlab-{ce,ee}-qa images is like 11.1.0-rc12-ee
|
140
144
|
def qa_tag
|
141
145
|
if dev_gitlab_org? && (match_data = tag.match(DEV_TAG_REGEX))
|
142
|
-
|
146
|
+
match_data[:gitlab_ref]
|
143
147
|
else
|
144
148
|
tag.sub(/[-.]([ce]e)(\.(\d+))?\z/, '-\1')
|
145
149
|
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
|
5
|
+
module Gitlab
|
6
|
+
module QA
|
7
|
+
module Report
|
8
|
+
module FindSetDri
|
9
|
+
def set_dri_via_group(product_group, test)
|
10
|
+
parse_json_with_sets
|
11
|
+
fetch_stage_sets(test)
|
12
|
+
|
13
|
+
return @sets.sample['username'] if @stage_sets.empty?
|
14
|
+
|
15
|
+
fetch_group_sets(product_group)
|
16
|
+
|
17
|
+
if @group_sets.empty?
|
18
|
+
@stage_sets.sample['username']
|
19
|
+
else
|
20
|
+
@group_sets.sample['username']
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def parse_json_with_sets
|
27
|
+
response = Support::HttpRequest.make_http_request(
|
28
|
+
url: 'https://gitlab-org.gitlab.io/gitlab-roulette/roulette.json'
|
29
|
+
)
|
30
|
+
@sets = JSON.parse(response.body).select { |user| user['role'].include?('software-engineer-in-test') }
|
31
|
+
end
|
32
|
+
|
33
|
+
def fetch_stage_sets(test)
|
34
|
+
@stage_sets = @sets.select { |user| user['role'].include?(test.stage.split("_").map(&:capitalize).join(" ")) }
|
35
|
+
end
|
36
|
+
|
37
|
+
def fetch_group_sets(product_group)
|
38
|
+
@group_sets = @stage_sets.select { |user| user['role'].include?(product_group.split("_").map { |word| word == 'and' ? word : word.capitalize }.join(" ")) }
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -101,6 +101,13 @@ module Gitlab
|
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
|
+
def find_user_id(username:)
|
105
|
+
handle_gitlab_client_exceptions do
|
106
|
+
user = Gitlab.users(username: username)&.first
|
107
|
+
user['id'] unless user.nil?
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
104
111
|
def upload_file(file_fullpath:)
|
105
112
|
ignore_gitlab_client_exceptions do
|
106
113
|
Gitlab.upload_file(project, file_fullpath)
|
@@ -3,12 +3,15 @@
|
|
3
3
|
require 'nokogiri'
|
4
4
|
require 'active_support/core_ext/enumerable'
|
5
5
|
require 'rubygems/text'
|
6
|
+
require 'active_support/core_ext/integer/time'
|
6
7
|
|
7
8
|
module Gitlab
|
8
9
|
module QA
|
9
10
|
module Report
|
10
11
|
# Uses the API to create or update GitLab issues with the results of tests from RSpec report files.
|
11
12
|
class RelateFailureIssue < ReportAsIssue
|
13
|
+
include FindSetDri
|
14
|
+
|
12
15
|
DEFAULT_MAX_DIFF_RATIO_FOR_DETECTION = 0.15
|
13
16
|
FAILURE_STACKTRACE_REGEX = %r{((.*Failure\/Error:(?<stacktrace>.+))|(?<stacktrace>.+))}m.freeze
|
14
17
|
ISSUE_STACKTRACE_REGEX = /### Stack trace\s*(```)#{FAILURE_STACKTRACE_REGEX}(```)/m.freeze
|
@@ -74,6 +77,8 @@ module Gitlab
|
|
74
77
|
|
75
78
|
post_or_update_failed_job_note(issue, test)
|
76
79
|
|
80
|
+
assign_dri(issue, test)
|
81
|
+
|
77
82
|
issue
|
78
83
|
end
|
79
84
|
|
@@ -218,6 +223,17 @@ module Gitlab
|
|
218
223
|
|
219
224
|
section
|
220
225
|
end
|
226
|
+
|
227
|
+
def assign_dri(issue, test)
|
228
|
+
if test.product_group?
|
229
|
+
dri = set_dri_via_group(test.product_group, test)
|
230
|
+
dri_id = gitlab.find_user_id(username: dri)
|
231
|
+
gitlab.edit_issue(iid: issue.iid, options: { assignee_id: dri_id, due_date: Date.today + 1.month })
|
232
|
+
puts " => Assigning #{dri} as DRI for the issue."
|
233
|
+
else
|
234
|
+
puts " => No product group metadata found for test '#{test.name}'"
|
235
|
+
end
|
236
|
+
end
|
221
237
|
end
|
222
238
|
end
|
223
239
|
end
|
@@ -103,6 +103,14 @@ module Gitlab
|
|
103
103
|
report['screenshot']['image'] if screenshot?
|
104
104
|
end
|
105
105
|
|
106
|
+
def product_group?
|
107
|
+
report['product_group'].present?
|
108
|
+
end
|
109
|
+
|
110
|
+
def product_group
|
111
|
+
report['product_group'] if product_group?
|
112
|
+
end
|
113
|
+
|
106
114
|
private
|
107
115
|
|
108
116
|
# rubocop:disable Metrics/AbcSize
|
@@ -94,6 +94,7 @@ module Gitlab
|
|
94
94
|
'CI_NODE_TOTAL' => :ci_node_total,
|
95
95
|
'CI_PROJECT_ID' => :ci_project_id,
|
96
96
|
'CI_PROJECT_NAME' => :ci_project_name,
|
97
|
+
'CI_PROJECT_PATH' => :ci_project_path,
|
97
98
|
'CI_SLACK_WEBHOOK_URL' => :ci_slack_webhook_url,
|
98
99
|
'CI_PIPELINE_ID' => :ci_pipeline_id,
|
99
100
|
'CI_PIPELINE_SOURCE' => :ci_pipeline_source,
|
@@ -272,12 +273,10 @@ module Gitlab
|
|
272
273
|
raise ArgumentError, "Please provide CI_SLACK_WEBHOOK_URL"
|
273
274
|
end
|
274
275
|
|
275
|
-
def
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
end
|
280
|
-
end
|
276
|
+
def require_qa_container_registry_access_token!
|
277
|
+
return unless env_var_value_if_defined('GITLAB_QA_CONTAINER_REGISTRY_ACCESS_TOKEN').to_s.strip.empty?
|
278
|
+
|
279
|
+
raise ArgumentError, "Please provide GITLAB_QA_CONTAINER_REGISTRY_ACCESS_TOKEN"
|
281
280
|
end
|
282
281
|
|
283
282
|
def require_aws_s3_environment!
|
@@ -313,14 +312,6 @@ module Gitlab
|
|
313
312
|
)
|
314
313
|
end
|
315
314
|
|
316
|
-
def require_ssh_tunnel!
|
317
|
-
%w[TUNNEL_SSH_PRIVATE_KEY TUNNEL_SERVER_HOSTNAME TUNNEL_SSH_USER].each do |env_key|
|
318
|
-
unless ENV.key?(env_key)
|
319
|
-
raise ArgumentError, "Environment variable #{env_key} must be set to run tunnel specs"
|
320
|
-
end
|
321
|
-
end
|
322
|
-
end
|
323
|
-
|
324
315
|
def override_default_password!
|
325
316
|
require_initial_password!
|
326
317
|
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Gitlab
|
4
|
+
module QA
|
5
|
+
module Scenario
|
6
|
+
module Test
|
7
|
+
module Integration
|
8
|
+
class SuggestedReviewer < Scenario::Template
|
9
|
+
attr_reader :spec_suite
|
10
|
+
|
11
|
+
def initialize
|
12
|
+
@spec_suite = 'Test::Instance::All'
|
13
|
+
@network = 'test'
|
14
|
+
@env = {}
|
15
|
+
@tag = 'suggested_reviewer'
|
16
|
+
@gitlab_name = 'gitlab-suggested-reviewer'
|
17
|
+
end
|
18
|
+
|
19
|
+
def perform(release, *rspec_args)
|
20
|
+
Component::Gitlab.perform do |gitlab|
|
21
|
+
gitlab.release = QA::Release.new(release)
|
22
|
+
gitlab.name = @gitlab_name
|
23
|
+
gitlab.network = @network
|
24
|
+
|
25
|
+
gitlab.instance do
|
26
|
+
# Wait for the suggested reviewer services to be ready before attempting to run specs
|
27
|
+
@cluster = suggested_reviewer_cluster
|
28
|
+
@cluster.wait_until_ready
|
29
|
+
|
30
|
+
Runtime::Logger.info('Running Suggested Reviewer specs!')
|
31
|
+
|
32
|
+
if @tag
|
33
|
+
rspec_args << "--" unless rspec_args.include?('--')
|
34
|
+
rspec_args << "--tag" << @tag
|
35
|
+
end
|
36
|
+
|
37
|
+
Component::Specs.perform do |specs|
|
38
|
+
specs.suite = spec_suite
|
39
|
+
specs.release = gitlab.release
|
40
|
+
specs.network = gitlab.network
|
41
|
+
specs.args = [gitlab.address, *rspec_args]
|
42
|
+
specs.env = @env
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
ensure
|
47
|
+
@cluster&.teardown if @cluster&.teardown?
|
48
|
+
end
|
49
|
+
|
50
|
+
def suggested_reviewer_cluster
|
51
|
+
Component::SuggestedReviewer.new.tap do |sr|
|
52
|
+
sr.prepare
|
53
|
+
sr.create_cluster
|
54
|
+
sr.deploy_services
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -94,7 +94,7 @@ module Gitlab
|
|
94
94
|
specs.network = gitlab.network
|
95
95
|
specs.args = [gitlab.address, *rspec_args]
|
96
96
|
end
|
97
|
-
rescue
|
97
|
+
rescue Support::ShellCommand::StatusError => e
|
98
98
|
raise e if release == current_release # only fail on current release
|
99
99
|
|
100
100
|
Runtime::Logger.warn("Test run for release '#{gitlab.release}' finished with errors!")
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Gitlab
|
4
|
+
module QA
|
5
|
+
module Service
|
6
|
+
module ClusterProvider
|
7
|
+
class Base
|
8
|
+
include Support::Shellout
|
9
|
+
|
10
|
+
GITLAB_REGISTRY = 'registry.gitlab.com'
|
11
|
+
|
12
|
+
attr_accessor :create_args
|
13
|
+
|
14
|
+
def cluster_name
|
15
|
+
@cluster_name ||= "qa-cluster-#{Time.now.utc.strftime('%Y%m%d')}-#{SecureRandom.hex(4)}"
|
16
|
+
end
|
17
|
+
|
18
|
+
def validate_dependencies
|
19
|
+
raise NotImplementedError
|
20
|
+
end
|
21
|
+
|
22
|
+
def setup
|
23
|
+
raise NotImplementedError
|
24
|
+
end
|
25
|
+
|
26
|
+
def teardown
|
27
|
+
raise NotImplementedError
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|