gitlab-qa 14.19.2 → 14.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +4 -4
- data/Gemfile.lock +3 -2
- data/LICENSE +1 -1
- data/gitlab-qa.gemspec +1 -0
- data/lib/gitlab/qa/component/ai_gateway.rb +27 -0
- data/lib/gitlab/qa/component/gitlab.rb +7 -0
- data/lib/gitlab/qa/runtime/env.rb +10 -0
- data/lib/gitlab/qa/scenario/test/integration/import.rb +123 -25
- data/lib/gitlab/qa/scenario/test/integration/import_with_smtp.rb +30 -0
- data/lib/gitlab/qa/scenario/test/omnibus/update_from_previous.rb +22 -10
- data/lib/gitlab/qa/scenario/test/omnibus/update_from_previous_ai.rb +46 -0
- data/lib/gitlab/qa/version.rb +1 -1
- data/lib/gitlab/qa.rb +2 -1
- data/support/setup/gitlab_duo_setup.rb +4 -0
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d84483452fba7a39c684e4b5b7f772a63712c6d400027b579dca7769ce231c7e
|
4
|
+
data.tar.gz: 64e52ceaa976d1dc0a3f513a26e71f4e529c5a9d9eea8c39474f683da963d718
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8633d6f704664548214395cf5e3b8560e6776f0052d5dcf1da91d3239e5489236877495b9bc077043f4efeb588e15272c595dfda0dc147386818d2a3c505d476
|
7
|
+
data.tar.gz: ca524f4c69c44fab4241cfd836bf2ed0f10047a3b030f942474ed360c8f7356a3ee678aa56dbb59a38697add270dcc8a881789a84fc3c675eb5b65f6395d0425
|
data/CONTRIBUTING.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
## Developer Certificate of Origin + License
|
2
2
|
|
3
|
-
By contributing to GitLab
|
4
|
-
conditions for Your present and future Contributions submitted to GitLab
|
5
|
-
Except for the license granted herein to GitLab
|
6
|
-
distributed by GitLab
|
3
|
+
By contributing to GitLab Inc., You accept and agree to the following terms and
|
4
|
+
conditions for Your present and future Contributions submitted to GitLab Inc.
|
5
|
+
Except for the license granted herein to GitLab Inc. and recipients of software
|
6
|
+
distributed by GitLab Inc., You reserve all right, title, and interest in and to
|
7
7
|
Your Contributions. All Contributions are subject to the following DCO + License
|
8
8
|
terms.
|
9
9
|
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gitlab-qa (14.
|
4
|
+
gitlab-qa (14.21.0)
|
5
5
|
activesupport (>= 6.1, < 7.2)
|
6
|
+
ffi (~> 1.17)
|
6
7
|
gitlab (~> 4.19)
|
7
8
|
http (~> 5.0)
|
8
9
|
nokogiri (~> 1.10)
|
@@ -94,7 +95,7 @@ GEM
|
|
94
95
|
faraday-patron (1.0.0)
|
95
96
|
faraday-rack (1.0.0)
|
96
97
|
faraday-retry (1.0.3)
|
97
|
-
ffi (1.
|
98
|
+
ffi (1.17.0)
|
98
99
|
ffi-compiler (1.0.1)
|
99
100
|
ffi (>= 1.0.0)
|
100
101
|
rake
|
data/LICENSE
CHANGED
data/gitlab-qa.gemspec
CHANGED
@@ -37,6 +37,7 @@ Gem::Specification.new do |spec|
|
|
37
37
|
spec.add_development_dependency 'webmock', '3.7.0'
|
38
38
|
|
39
39
|
spec.add_runtime_dependency 'activesupport', '>= 6.1', '< 7.2'
|
40
|
+
spec.add_runtime_dependency 'ffi', '~> 1.17'
|
40
41
|
spec.add_runtime_dependency 'gitlab', '~> 4.19'
|
41
42
|
spec.add_runtime_dependency 'http', '~> 5.0'
|
42
43
|
spec.add_runtime_dependency 'nokogiri', '~> 1.10'
|
@@ -7,6 +7,8 @@ module Gitlab
|
|
7
7
|
DOCKER_IMAGE = 'registry.gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist/model-gateway'
|
8
8
|
DOCKER_IMAGE_TAG = 'latest'
|
9
9
|
|
10
|
+
LOG_FILE_NAME = 'modelgateway_debug.log'
|
11
|
+
|
10
12
|
# Test signing key to enable direct connection code completions
|
11
13
|
# https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist/-/blob/97f54f4b7e43258a39bba7f29f38fe44bd316ce5/example.env#L79
|
12
14
|
TEST_SIGNING_KEY =
|
@@ -87,17 +89,42 @@ module Gitlab
|
|
87
89
|
@name ||= 'ai-gateway'
|
88
90
|
end
|
89
91
|
|
92
|
+
def host_log_path
|
93
|
+
File.join(Runtime::Env.host_artifacts_dir, name, 'logs', LOG_FILE_NAME)
|
94
|
+
end
|
95
|
+
|
96
|
+
def container_log_path
|
97
|
+
File.join('home', 'aigateway', 'app', LOG_FILE_NAME)
|
98
|
+
end
|
99
|
+
|
90
100
|
def configure_environment(gitlab_hostname:)
|
91
101
|
@environment = {
|
92
102
|
'AIGW_GITLAB_URL' => "http://#{gitlab_hostname}",
|
93
103
|
'AIGW_GITLAB_API_URL' => "http://#{gitlab_hostname}/api/v4",
|
94
104
|
'AIGW_CUSTOMER_PORTAL_URL' => Runtime::Env.customer_portal_url,
|
95
105
|
'AIGW_MOCK_MODEL_RESPONSES' => true,
|
106
|
+
'AIGW_LOGGING__LEVEL' => 'debug',
|
107
|
+
'AIGW_LOGGING__TO_FILE' => LOG_FILE_NAME,
|
96
108
|
'AIGW_SELF_SIGNED_JWT__SIGNING_KEY' => TEST_SIGNING_KEY,
|
97
109
|
'AIGW_SELF_SIGNED_JWT__VALIDATION_KEY' => TEST_VALIDATION_KEY,
|
98
110
|
'CLOUD_CONNECTOR_SERVICE_NAME' => 'gitlab-ai-gateway'
|
99
111
|
}
|
100
112
|
end
|
113
|
+
|
114
|
+
def teardown
|
115
|
+
# Copy debug log file to host artifacts directory
|
116
|
+
begin
|
117
|
+
Docker::Command.execute(
|
118
|
+
"cp #{name}:#{container_log_path} #{host_log_path}"
|
119
|
+
)
|
120
|
+
rescue Support::ShellCommand::StatusError => e
|
121
|
+
Runtime::Logger.warn(
|
122
|
+
"Unable to copy log file from #{name}: #{e.message}"
|
123
|
+
)
|
124
|
+
end
|
125
|
+
|
126
|
+
super
|
127
|
+
end
|
101
128
|
end
|
102
129
|
end
|
103
130
|
end
|
@@ -68,6 +68,12 @@ module Gitlab
|
|
68
68
|
@omnibus_gitlab_rails_env['CUSTOMER_PORTAL_URL'] = Runtime::Env.customer_portal_url
|
69
69
|
end
|
70
70
|
|
71
|
+
def set_cloud_connector_base_url
|
72
|
+
return if Runtime::Env.cloud_connector_base_url.blank?
|
73
|
+
|
74
|
+
@omnibus_gitlab_rails_env['CLOUD_CONNECTOR_BASE_URL'] = Runtime::Env.cloud_connector_base_url
|
75
|
+
end
|
76
|
+
|
71
77
|
# Sets GITLAB_QA_USER_AGENT as a Rail environment variable so that it can be used by GitLab to bypass features
|
72
78
|
# that can't be automated.
|
73
79
|
def set_qa_user_agent
|
@@ -138,6 +144,7 @@ module Gitlab
|
|
138
144
|
set_formless_login_token
|
139
145
|
set_license_mode
|
140
146
|
set_qa_user_agent
|
147
|
+
set_cloud_connector_base_url
|
141
148
|
env = @omnibus_gitlab_rails_env.merge(
|
142
149
|
{
|
143
150
|
'GITLAB_ALLOW_SEPARATE_CI_DATABASE' => Runtime::Env.allow_separate_ci_database.to_s,
|
@@ -327,6 +327,12 @@ module Gitlab
|
|
327
327
|
end
|
328
328
|
end
|
329
329
|
|
330
|
+
def require_cloud_connector_base_url!
|
331
|
+
return unless cloud_connector_base_url.blank?
|
332
|
+
|
333
|
+
raise ArgumentError, "Please provide CLOUD_CONNECTOR_BASE_URL"
|
334
|
+
end
|
335
|
+
|
330
336
|
def require_initial_password!
|
331
337
|
return unless env_var_value_if_defined('GITLAB_INITIAL_ROOT_PASSWORD').to_s.strip.empty?
|
332
338
|
|
@@ -434,6 +440,10 @@ module Gitlab
|
|
434
440
|
env_var_value_if_defined('CUSTOMER_PORTAL_URL') || 'https://customers.staging.gitlab.com'
|
435
441
|
end
|
436
442
|
|
443
|
+
def cloud_connector_base_url
|
444
|
+
env_var_value_if_defined('CLOUD_CONNECTOR_BASE_URL')
|
445
|
+
end
|
446
|
+
|
437
447
|
def ee_activation_code
|
438
448
|
env_var_value_if_defined('QA_EE_ACTIVATION_CODE')
|
439
449
|
end
|
@@ -15,19 +15,41 @@ module Gitlab
|
|
15
15
|
class Import < Scenario::Template
|
16
16
|
def initialize
|
17
17
|
@network = Runtime::Env.docker_network
|
18
|
-
|
19
|
-
@
|
20
|
-
@
|
21
|
-
|
22
|
-
|
23
|
-
|
18
|
+
|
19
|
+
@source_gitlab = new_gitlab_instance
|
20
|
+
@target_gitlab = new_gitlab_instance
|
21
|
+
@mock_server = new_mock_server
|
22
|
+
@mail_hog_server = new_mail_hog_server
|
23
|
+
@spec_suite = 'Test::Integration::Import'
|
24
|
+
end
|
25
|
+
|
26
|
+
attr_reader :source_gitlab, :target_gitlab, :mock_server, :network, :spec_suite, :mail_hog_server
|
27
|
+
|
28
|
+
def configure_omnibus(gitlab, mail_hog)
|
29
|
+
raise NotImplementedError
|
24
30
|
end
|
25
31
|
|
26
|
-
|
32
|
+
# Import tests that spins up two gitlab instances
|
33
|
+
#
|
34
|
+
# @example
|
35
|
+
# perform(gitlab-ee, gitlab-ee:17.4.0-ee.0)
|
36
|
+
# => will perform import from gitlab-ee:17.4.0-ee.0 to gitlab-ee
|
37
|
+
#
|
38
|
+
# @param [String] target_release target gitlab instance version release docker image(default)
|
39
|
+
# @param [String] source_release source gitlab instance version, if its not passed takes the target release as default
|
40
|
+
# @param [Array] *rspec_args rspec arguments
|
41
|
+
# @return [void]
|
42
|
+
def perform(target_release, source_release = nil, *rspec_args)
|
43
|
+
# When source_release isn't actually passed but RSpec args arg passed with `-- rspec_args...`,
|
44
|
+
# source_release is wrongly set to `--`, so we fix that here.
|
45
|
+
if source_release == "--"
|
46
|
+
rspec_args.prepend('--')
|
47
|
+
source_release = nil
|
48
|
+
end
|
27
49
|
|
28
|
-
|
50
|
+
source_release = target_release if source_release.nil?
|
29
51
|
start_mock_server
|
30
|
-
start_gitlab_instances(
|
52
|
+
start_gitlab_instances(source_release, target_release)
|
31
53
|
|
32
54
|
run_specs(rspec_args)
|
33
55
|
ensure
|
@@ -38,6 +60,45 @@ module Gitlab
|
|
38
60
|
|
39
61
|
private
|
40
62
|
|
63
|
+
# Initialize a mailhog instance
|
64
|
+
#
|
65
|
+
# @note this does not start the instance
|
66
|
+
# @return [Gitlab::QA::Component::MailHog] Mailhog instance
|
67
|
+
def new_mail_hog_server
|
68
|
+
Component::MailHog.new.tap do |mail_hog|
|
69
|
+
mail_hog.network = @network
|
70
|
+
mail_hog.set_mailhog_hostname
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
# Check if MailHog server is needed
|
75
|
+
#
|
76
|
+
# @param [Hash] gitlab_instance
|
77
|
+
# @return [Boolean]
|
78
|
+
def mail_hog_server_needed?(gitlab_instance)
|
79
|
+
respond_to?(:orchestrate_mail_hog_server) && gitlab_instance[:name] == "import-target"
|
80
|
+
end
|
81
|
+
|
82
|
+
# Start MailHog server
|
83
|
+
#
|
84
|
+
# @param [Hash] gitlab_instance
|
85
|
+
# @return [void]
|
86
|
+
def start_mail_hog_server(gitlab_instance)
|
87
|
+
configure_omnibus(gitlab_instance[:instance], mail_hog_server)
|
88
|
+
mail_hog_server.start_instance
|
89
|
+
end
|
90
|
+
|
91
|
+
# Initialize a mock server instance
|
92
|
+
#
|
93
|
+
# @note this does not start the instance
|
94
|
+
# @return [Gitlab::QA::Component::MockServer] mock server instance
|
95
|
+
def new_mock_server
|
96
|
+
Component::MockServer.new.tap do |server|
|
97
|
+
server.network = @network
|
98
|
+
server.tls = true
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
41
102
|
# Start mock server instance
|
42
103
|
#
|
43
104
|
# @return [void]
|
@@ -45,25 +106,60 @@ module Gitlab
|
|
45
106
|
mock_server.start_instance
|
46
107
|
end
|
47
108
|
|
48
|
-
#
|
109
|
+
# Initialize a gitlab instance
|
49
110
|
#
|
50
|
-
# @
|
111
|
+
# @note this does not start the instance
|
112
|
+
# @return [Gitlab::QA::Component::Gitlab] gitlab instance
|
113
|
+
def new_gitlab_instance
|
114
|
+
Component::Gitlab.new.tap { |gitlab| gitlab.network = @network }
|
115
|
+
end
|
116
|
+
|
117
|
+
# Setup GitLab instance
|
118
|
+
#
|
119
|
+
# @param [Hash] gitlab_instance
|
51
120
|
# @return [void]
|
52
|
-
def
|
53
|
-
|
54
|
-
|
55
|
-
|
121
|
+
def setup_gitlab_instance(gitlab_instance)
|
122
|
+
gitlab_instance[:instance].tap do |gitlab|
|
123
|
+
configure_gitlab_instance(gitlab, gitlab_instance)
|
124
|
+
start_mail_hog_server(gitlab_instance) if mail_hog_server_needed?(gitlab_instance)
|
125
|
+
gitlab.start_instance
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
# Configure GitLab instance
|
130
|
+
#
|
131
|
+
# @param [Gitlab::QA::Component::Gitlab] gitlab
|
132
|
+
# @param [Hash] gitlab_instance
|
133
|
+
# @return [void]
|
134
|
+
def configure_gitlab_instance(gitlab, gitlab_instance)
|
135
|
+
gitlab.name = gitlab_instance[:name]
|
136
|
+
gitlab.release = gitlab_instance[:release]
|
137
|
+
gitlab.additional_hosts = gitlab_instance[:additional_hosts]
|
138
|
+
gitlab.seed_admin_token = true
|
139
|
+
end
|
140
|
+
|
141
|
+
# Build GitLab instances
|
142
|
+
#
|
143
|
+
# @param [Gitlab::QA::Release] source_release
|
144
|
+
# @param [Gitlab::QA::Release] target_release
|
145
|
+
# @return [Array<Hash>]
|
146
|
+
def build_gitlab_instances(source_release, target_release)
|
147
|
+
[
|
148
|
+
{ instance: source_gitlab, name: "import-source", additional_hosts: [], release: source_release },
|
149
|
+
{ instance: target_gitlab, name: "import-target", additional_hosts: mocked_hosts, release: target_release }
|
56
150
|
]
|
151
|
+
end
|
152
|
+
|
153
|
+
# Start gitlab instance
|
154
|
+
#
|
155
|
+
# @param [Gitlab::QA::Release] source_release
|
156
|
+
# @param [Gitlab::QA::Release] target_release
|
157
|
+
# @return [void]
|
158
|
+
def start_gitlab_instances(source_release, target_release)
|
159
|
+
instances = build_gitlab_instances(source_release, target_release)
|
57
160
|
|
58
161
|
::Parallel.each(instances, in_threads: 2) do |gitlab_instance|
|
59
|
-
gitlab_instance
|
60
|
-
gitlab.name = gitlab_instance[:name]
|
61
|
-
gitlab.release = release
|
62
|
-
gitlab.additional_hosts = gitlab_instance[:additional_hosts]
|
63
|
-
gitlab.seed_admin_token = true
|
64
|
-
|
65
|
-
gitlab.start_instance
|
66
|
-
end
|
162
|
+
setup_gitlab_instance(gitlab_instance)
|
67
163
|
end
|
68
164
|
end
|
69
165
|
|
@@ -71,9 +167,11 @@ module Gitlab
|
|
71
167
|
#
|
72
168
|
# @param [Array] rspec_args
|
73
169
|
# @return [void]
|
74
|
-
def run_specs(rspec_args)
|
170
|
+
def run_specs(rspec_args) # rubocop:disable Metrics/AbcSize
|
171
|
+
Runtime::Logger.info("Running #{spec_suite} specs!")
|
172
|
+
|
75
173
|
Component::Specs.perform do |specs|
|
76
|
-
specs.suite =
|
174
|
+
specs.suite = spec_suite
|
77
175
|
specs.release = target_gitlab.release
|
78
176
|
specs.network = network
|
79
177
|
specs.args = [target_gitlab.address, *rspec_args]
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Gitlab
|
4
|
+
module QA
|
5
|
+
module Scenario
|
6
|
+
module Test
|
7
|
+
module Integration
|
8
|
+
# Scenario type for testing importers with smtp enabled in target gitlab instance
|
9
|
+
class ImportWithSMTP < Import
|
10
|
+
attr_reader :orchestrate_mail_hog_server
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
@spec_suite = 'Test::Integration::ImportWithSMTP'
|
14
|
+
@orchestrate_mail_hog_server = true
|
15
|
+
super
|
16
|
+
end
|
17
|
+
|
18
|
+
def configure_omnibus(gitlab, mail_hog)
|
19
|
+
gitlab.omnibus_configuration << <<~OMNIBUS
|
20
|
+
gitlab_rails['smtp_enable'] = true;
|
21
|
+
gitlab_rails['smtp_address'] = '#{mail_hog.hostname}';
|
22
|
+
gitlab_rails['smtp_port'] = 1025;
|
23
|
+
OMNIBUS
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -8,6 +8,8 @@ module Gitlab
|
|
8
8
|
class UpdateFromPrevious < Scenario::Template
|
9
9
|
using Rainbow
|
10
10
|
|
11
|
+
attr_reader :rspec_args
|
12
|
+
|
11
13
|
# Test update from N - 1 (major|minor|patch) version to current release
|
12
14
|
# Run health check (or smoke if below 17.1.0) test suite on previous release to populate some data in database before update
|
13
15
|
#
|
@@ -36,6 +38,7 @@ module Gitlab
|
|
36
38
|
semver_component,
|
37
39
|
from_edition || @current_release.edition
|
38
40
|
).fetch
|
41
|
+
@rspec_args = rspec_args
|
39
42
|
|
40
43
|
upgrade_info = "#{[*upgrade_path, current_release].join(' => ')} (#{current_version})".bright
|
41
44
|
Runtime::Logger.info("Performing gitlab update: #{upgrade_info}")
|
@@ -43,6 +46,18 @@ module Gitlab
|
|
43
46
|
update(rspec_args)
|
44
47
|
end
|
45
48
|
|
49
|
+
def seeding_suite_args
|
50
|
+
first_release_version = extract_version(upgrade_path.first.release)
|
51
|
+
if Gem::Version.new(first_release_version) < Gem::Version.new("17.1.0")
|
52
|
+
["--", "--tag", "smoke"]
|
53
|
+
else
|
54
|
+
["--", "--tag", "health_check"]
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# this is any action or event that may happen before the seeding suite is run
|
59
|
+
def pre_seeding_environment_actions(gitlab); end
|
60
|
+
|
46
61
|
private
|
47
62
|
|
48
63
|
attr_reader :current_release, :upgrade_path
|
@@ -62,16 +77,9 @@ module Gitlab
|
|
62
77
|
# rubocop:disable Metrics/AbcSize
|
63
78
|
def update(rspec_args)
|
64
79
|
Docker::Volumes.new.with_temporary_volumes do |volumes|
|
65
|
-
first_release_version = extract_version(upgrade_path.first.release)
|
66
|
-
seeding_suite_args = if Gem::Version.new(first_release_version) < Gem::Version.new("17.1.0")
|
67
|
-
["--", "--tag", "smoke"]
|
68
|
-
else
|
69
|
-
["--", "--tag", "health_check"]
|
70
|
-
end
|
71
|
-
|
72
80
|
# deploy first release in upgrade path and run specs to populate db
|
73
81
|
Runtime::Logger.info("Running the first release in upgrade path: #{upgrade_path.first}")
|
74
|
-
run_gitlab(upgrade_path.first, volumes, seeding_suite_args)
|
82
|
+
run_gitlab(upgrade_path.first, volumes, seeding_suite_args, seeding_run: true)
|
75
83
|
|
76
84
|
# deploy releases in upgrade path
|
77
85
|
upgrade_path[1..].each do |release|
|
@@ -91,7 +99,7 @@ module Gitlab
|
|
91
99
|
# @param [Gitlab::QA::Release] release
|
92
100
|
# @param [Hash] volumes
|
93
101
|
# @return [void]
|
94
|
-
def run_gitlab(release, volumes, rspec_args = [], skip_setup: false) # rubocop:disable Metrics/AbcSize
|
102
|
+
def run_gitlab(release, volumes, rspec_args = [], skip_setup: false, seeding_run: false) # rubocop:disable Metrics/AbcSize
|
95
103
|
Runtime::Logger.info("Deploying release: #{release.to_s.bright}")
|
96
104
|
|
97
105
|
Component::Gitlab.perform do |gitlab|
|
@@ -99,6 +107,7 @@ module Gitlab
|
|
99
107
|
gitlab.release = release
|
100
108
|
gitlab.volumes = volumes
|
101
109
|
gitlab.network = Runtime::Env.docker_network
|
110
|
+
gitlab.set_ee_activation_code if @use_cloud_license
|
102
111
|
|
103
112
|
if skip_setup
|
104
113
|
gitlab.skip_server_hooks = true
|
@@ -108,7 +117,10 @@ module Gitlab
|
|
108
117
|
|
109
118
|
next gitlab.launch_and_teardown_instance unless run_specs?(release)
|
110
119
|
|
111
|
-
gitlab.instance
|
120
|
+
gitlab.instance do
|
121
|
+
pre_seeding_environment_actions(gitlab) if seeding_run
|
122
|
+
run_specs(gitlab, release, rspec_args)
|
123
|
+
end
|
112
124
|
end
|
113
125
|
end
|
114
126
|
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Gitlab
|
4
|
+
module QA
|
5
|
+
module Scenario
|
6
|
+
module Test
|
7
|
+
module Omnibus
|
8
|
+
class UpdateFromPreviousAi < UpdateFromPrevious
|
9
|
+
def initialize
|
10
|
+
Runtime::Env.require_cloud_connector_base_url!
|
11
|
+
@use_cloud_license = true
|
12
|
+
@perform_license_sync_event = false
|
13
|
+
super
|
14
|
+
end
|
15
|
+
|
16
|
+
def seeding_suite_args
|
17
|
+
super + (rspec_args[1..] || [])
|
18
|
+
end
|
19
|
+
|
20
|
+
def pre_seeding_environment_actions(gitlab)
|
21
|
+
super
|
22
|
+
set_up_gitlab_duo(gitlab)
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def set_up_gitlab_duo(gitlab)
|
28
|
+
setup_src_path = File.expand_path('../../../../../../support/setup', __dir__)
|
29
|
+
setup_dest_path = '/tmp/setup-scripts'
|
30
|
+
|
31
|
+
Runtime::Logger.info('Setting up Gitlab Duo on GitLab instance')
|
32
|
+
|
33
|
+
gitlab.docker.copy(gitlab.name, setup_src_path, setup_dest_path)
|
34
|
+
|
35
|
+
gitlab.docker.exec(
|
36
|
+
gitlab.name,
|
37
|
+
"ASSIGN_SEATS=true HAS_ADD_ON=true gitlab-rails runner #{setup_dest_path}/gitlab_duo_setup.rb",
|
38
|
+
mask_secrets: gitlab.secrets
|
39
|
+
)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
data/lib/gitlab/qa/version.rb
CHANGED
data/lib/gitlab/qa.rb
CHANGED
@@ -88,10 +88,14 @@ class GitlabDuoSetup
|
|
88
88
|
end
|
89
89
|
|
90
90
|
def duo_pro_add_on
|
91
|
+
return nil unless GitlabSubscriptions::AddOn.respond_to?(:code_suggestions)
|
92
|
+
|
91
93
|
find_add_on_purchase(add_on: GitlabSubscriptions::AddOn.code_suggestions.last)
|
92
94
|
end
|
93
95
|
|
94
96
|
def duo_enterprise_add_on
|
97
|
+
return nil unless GitlabSubscriptions::AddOn.respond_to?(:duo_enterprise)
|
98
|
+
|
95
99
|
find_add_on_purchase(add_on: GitlabSubscriptions::AddOn.duo_enterprise.last)
|
96
100
|
end
|
97
101
|
|
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: 14.
|
4
|
+
version: 14.21.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-11-
|
11
|
+
date: 2024-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: climate_control
|
@@ -212,6 +212,20 @@ dependencies:
|
|
212
212
|
- - "<"
|
213
213
|
- !ruby/object:Gem::Version
|
214
214
|
version: '7.2'
|
215
|
+
- !ruby/object:Gem::Dependency
|
216
|
+
name: ffi
|
217
|
+
requirement: !ruby/object:Gem::Requirement
|
218
|
+
requirements:
|
219
|
+
- - "~>"
|
220
|
+
- !ruby/object:Gem::Version
|
221
|
+
version: '1.17'
|
222
|
+
type: :runtime
|
223
|
+
prerelease: false
|
224
|
+
version_requirements: !ruby/object:Gem::Requirement
|
225
|
+
requirements:
|
226
|
+
- - "~>"
|
227
|
+
- !ruby/object:Gem::Version
|
228
|
+
version: '1.17'
|
215
229
|
- !ruby/object:Gem::Dependency
|
216
230
|
name: gitlab
|
217
231
|
requirement: !ruby/object:Gem::Requirement
|
@@ -456,6 +470,7 @@ files:
|
|
456
470
|
- lib/gitlab/qa/scenario/test/integration/gitlab_pages.rb
|
457
471
|
- lib/gitlab/qa/scenario/test/integration/group_saml.rb
|
458
472
|
- lib/gitlab/qa/scenario/test/integration/import.rb
|
473
|
+
- lib/gitlab/qa/scenario/test/integration/import_with_smtp.rb
|
459
474
|
- lib/gitlab/qa/scenario/test/integration/instance_saml.rb
|
460
475
|
- lib/gitlab/qa/scenario/test/integration/integrations.rb
|
461
476
|
- lib/gitlab/qa/scenario/test/integration/jira.rb
|
@@ -477,6 +492,7 @@ files:
|
|
477
492
|
- lib/gitlab/qa/scenario/test/integration/suggested_reviewer.rb
|
478
493
|
- lib/gitlab/qa/scenario/test/omnibus/image.rb
|
479
494
|
- lib/gitlab/qa/scenario/test/omnibus/update_from_previous.rb
|
495
|
+
- lib/gitlab/qa/scenario/test/omnibus/update_from_previous_ai.rb
|
480
496
|
- lib/gitlab/qa/scenario/test/omnibus/upgrade.rb
|
481
497
|
- lib/gitlab/qa/service/cluster_provider/base.rb
|
482
498
|
- lib/gitlab/qa/service/cluster_provider/k3d.rb
|