gitlab-qa 11.3.0 → 12.0.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/.gitignore +1 -1
- data/.gitlab-ci.yml +3 -1
- data/.rubocop.yml +13 -2
- data/.rubocop_todo.yml +57 -85
- data/Gemfile.lock +44 -36
- data/gitlab-qa.gemspec +4 -2
- data/lib/gitlab/qa/component/base.rb +9 -9
- data/lib/gitlab/qa/component/gitaly.rb +2 -2
- data/lib/gitlab/qa/component/gitaly_cluster.rb +14 -8
- data/lib/gitlab/qa/component/gitlab.rb +15 -14
- data/lib/gitlab/qa/component/mail_hog.rb +1 -0
- data/lib/gitlab/qa/component/praefect.rb +2 -2
- data/lib/gitlab/qa/component/selenoid.rb +6 -4
- data/lib/gitlab/qa/component/specs.rb +5 -2
- data/lib/gitlab/qa/component/staging.rb +4 -4
- data/lib/gitlab/qa/component/telegraf.rb +2 -1
- data/lib/gitlab/qa/docker/engine.rb +6 -3
- data/lib/gitlab/qa/docker/volumes.rb +1 -1
- data/lib/gitlab/qa/release.rb +4 -4
- data/lib/gitlab/qa/runner.rb +10 -3
- data/lib/gitlab/qa/runtime/env.rb +16 -19
- data/lib/gitlab/qa/runtime/logger.rb +1 -1
- data/lib/gitlab/qa/runtime/omnibus_configuration.rb +1 -0
- data/lib/gitlab/qa/runtime/omnibus_configurations/object_storage_gcs.rb +2 -1
- data/lib/gitlab/qa/runtime/scenario.rb +1 -5
- data/lib/gitlab/qa/scenario/actable.rb +4 -4
- data/lib/gitlab/qa/scenario/test/instance/airgapped.rb +2 -2
- data/lib/gitlab/qa/scenario/test/instance/deployment_base.rb +2 -1
- data/lib/gitlab/qa/scenario/test/integration/group_saml.rb +1 -1
- data/lib/gitlab/qa/scenario/test/integration/ldap.rb +5 -6
- data/lib/gitlab/qa/scenario/test/integration/oauth.rb +6 -3
- data/lib/gitlab/qa/scenario/test/omnibus/update_from_previous.rb +1 -1
- data/lib/gitlab/qa/scenario/test/omnibus/upgrade.rb +1 -3
- data/lib/gitlab/qa/scenario/test/sanity/version.rb +1 -1
- data/lib/gitlab/qa/support/config_scripts.rb +1 -1
- data/lib/gitlab/qa/support/gitlab_version_info.rb +3 -5
- data/lib/gitlab/qa/support/shell_command.rb +1 -0
- data/lib/gitlab/qa/test_logger.rb +2 -2
- data/lib/gitlab/qa/version.rb +1 -1
- data/support/data/admin_access_token_seed.rb +1 -0
- data/support/data/license_usage_seed.rb +3 -1
- metadata +13 -8
- data/lib/gitlab/qa/runtime/omnibus_configurations/packages.rb +0 -17
@@ -13,9 +13,9 @@ module Gitlab
|
|
13
13
|
|
14
14
|
def self.release
|
15
15
|
QA::Release.new(image)
|
16
|
-
rescue Support::InvalidResponseError =>
|
17
|
-
warn
|
18
|
-
warn "#{
|
16
|
+
rescue Support::InvalidResponseError => e
|
17
|
+
warn e.message
|
18
|
+
warn "#{e.response.code} #{e.response.message}: #{e.response.body}"
|
19
19
|
exit 1
|
20
20
|
end
|
21
21
|
|
@@ -81,7 +81,7 @@ module Gitlab
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def api_get!
|
84
|
-
@response_body ||=
|
84
|
+
@response_body ||=
|
85
85
|
begin
|
86
86
|
response = Support::GetRequest.new(uri, Runtime::Env.qa_access_token).execute!
|
87
87
|
JSON.parse(response.body)
|
@@ -43,7 +43,8 @@ module Gitlab
|
|
43
43
|
#
|
44
44
|
# @return [void]
|
45
45
|
def prepare
|
46
|
-
@telegraf_config = File.open("#{Dir.mktmpdir(nil, ENV
|
46
|
+
@telegraf_config = File.open("#{Dir.mktmpdir(nil, ENV.fetch('CI_BUILDS_DIR', nil))}/telegraf.conf",
|
47
|
+
'w') do |file|
|
47
48
|
file.write(config)
|
48
49
|
file.path
|
49
50
|
end
|
@@ -18,7 +18,8 @@ module Gitlab
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def login(username:, password:, registry:)
|
21
|
-
Docker::Command.execute(%(login --username "#{username}" --password "#{password}" #{registry}),
|
21
|
+
Docker::Command.execute(%(login --username "#{username}" --password "#{password}" #{registry}),
|
22
|
+
mask_secrets: password)
|
22
23
|
end
|
23
24
|
|
24
25
|
def pull(image:, tag: nil, quiet: true)
|
@@ -63,7 +64,8 @@ module Gitlab
|
|
63
64
|
Class.new do
|
64
65
|
# @param file The name of the file
|
65
66
|
# @param contents The content of the file to write
|
66
|
-
# @param expand_vars Set false if you need to write an environment variable '$' to a file.
|
67
|
+
# @param expand_vars Set false if you need to write an environment variable '$' to a file.
|
68
|
+
# The variable should be escaped \\\$
|
67
69
|
def self.write(file, contents, expand_vars = true)
|
68
70
|
if expand_vars
|
69
71
|
%(echo "#{contents}" > #{file};)
|
@@ -82,7 +84,8 @@ module Gitlab
|
|
82
84
|
def exec(name, command, mask_secrets: nil)
|
83
85
|
cmd = ['exec']
|
84
86
|
cmd << '--privileged' if privileged_command?(command)
|
85
|
-
Docker::Command.execute(%(#{cmd.join(' ')} #{name} bash -c "#{command.gsub('"', '\\"')}"),
|
87
|
+
Docker::Command.execute(%(#{cmd.join(' ')} #{name} bash -c "#{command.gsub('"', '\\"')}"),
|
88
|
+
mask_secrets: mask_secrets)
|
86
89
|
end
|
87
90
|
|
88
91
|
def read_file(image, tag, path, &block)
|
@@ -20,7 +20,7 @@ module Gitlab
|
|
20
20
|
# but Docker on macOS exposes /private and disallow exposing /var/
|
21
21
|
# so we need to get the real tmpdir path
|
22
22
|
Dir.mktmpdir('gitlab-qa-', File.realpath(Dir.tmpdir)).tap do |dir|
|
23
|
-
yield
|
23
|
+
yield @volumes.transform_keys { |k| "#{dir}/#{k}" }
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
data/lib/gitlab/qa/release.rb
CHANGED
@@ -11,7 +11,7 @@ module Gitlab
|
|
11
11
|
(-qa)?
|
12
12
|
(:(?<tag>.+))?
|
13
13
|
\z
|
14
|
-
/xi
|
14
|
+
/xi
|
15
15
|
CUSTOM_GITLAB_IMAGE_REGEX = %r{
|
16
16
|
\A
|
17
17
|
(?<image_without_tag>
|
@@ -23,7 +23,7 @@ module Gitlab
|
|
23
23
|
(-qa)?
|
24
24
|
(:(?<tag>.+))?
|
25
25
|
\z
|
26
|
-
}xi
|
26
|
+
}xi
|
27
27
|
|
28
28
|
delegate :ci_project_path, to: Gitlab::QA::Runtime::Env
|
29
29
|
|
@@ -39,7 +39,7 @@ module Gitlab
|
|
39
39
|
\A
|
40
40
|
(?<version>\d+\.\d+.\d+(?:-rc\d+)?)-(?<edition>ce|ee|jh)
|
41
41
|
\z
|
42
|
-
/xi
|
42
|
+
/xi
|
43
43
|
|
44
44
|
# Dev tag example:
|
45
45
|
# 12.1.201906121026-325a6632895.b340d0bd35d
|
@@ -53,7 +53,7 @@ module Gitlab
|
|
53
53
|
\A
|
54
54
|
(?<version>\d+\.\d+(.\d+)?)\.(?<timestamp>\d+)-(?<gitlab_ref>[A-Za-z0-9]+)\.(?<omnibus_ref>[A-Za-z0-9]+)
|
55
55
|
\z
|
56
|
-
/xi
|
56
|
+
/xi
|
57
57
|
|
58
58
|
DEFAULT_TAG = 'latest'
|
59
59
|
DEFAULT_CANONICAL_TAG = 'nightly'
|
data/lib/gitlab/qa/runner.rb
CHANGED
@@ -29,7 +29,8 @@ module Gitlab
|
|
29
29
|
Runtime::Scenario.define(:teardown, false)
|
30
30
|
end
|
31
31
|
|
32
|
-
opts.on('--no-tests',
|
32
|
+
opts.on('--no-tests',
|
33
|
+
'Orchestrates the docker containers but does not run the tests. Implies --no-teardown') do
|
33
34
|
Runtime::Scenario.define(:run_tests, false)
|
34
35
|
Runtime::Scenario.define(:teardown, false)
|
35
36
|
end
|
@@ -42,7 +43,12 @@ module Gitlab
|
|
42
43
|
Runtime::Scenario.define(:skip_server_hooks, true)
|
43
44
|
end
|
44
45
|
|
45
|
-
opts.on(
|
46
|
+
opts.on(
|
47
|
+
'--qa-image QA_IMAGE',
|
48
|
+
String,
|
49
|
+
"Specifies a QA image to be used instead of inferring it from the GitLab image." \
|
50
|
+
"See Gitlab::QA::Release#qa_image"
|
51
|
+
) do |value|
|
46
52
|
Runtime::Scenario.define(:qa_image, value)
|
47
53
|
end
|
48
54
|
|
@@ -58,7 +64,8 @@ module Gitlab
|
|
58
64
|
end
|
59
65
|
end
|
60
66
|
|
61
|
-
opts.on('--seed-db search_pattern1[,search_pattern2,...]',
|
67
|
+
opts.on('--seed-db search_pattern1[,search_pattern2,...]',
|
68
|
+
'Seed application database with sample test data') do |file_pattern|
|
62
69
|
file_pattern.split(',').each do |pattern|
|
63
70
|
@seed_scripts << pattern
|
64
71
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'active_support'
|
3
4
|
require 'active_support/core_ext/object/blank'
|
4
5
|
require 'securerandom'
|
5
6
|
|
@@ -157,9 +158,7 @@ module Gitlab
|
|
157
158
|
attr_writer(method_name)
|
158
159
|
|
159
160
|
define_method(method_name) do
|
160
|
-
env_var_value_if_defined(env_name) || (if instance_variable_defined?("@#{method_name}")
|
161
|
-
instance_variable_get("@#{method_name}")
|
162
|
-
end)
|
161
|
+
env_var_value_if_defined(env_name) || (instance_variable_get("@#{method_name}") if instance_variable_defined?("@#{method_name}"))
|
163
162
|
end
|
164
163
|
end
|
165
164
|
|
@@ -170,7 +169,7 @@ module Gitlab
|
|
170
169
|
value = env_var_name_if_defined(name) || send(attribute) # rubocop:disable GitlabSecurity/PublicSend
|
171
170
|
vars[name] = value if value
|
172
171
|
end
|
173
|
-
qa_variables = ENV.each_with_object({}) do |(name,
|
172
|
+
qa_variables = ENV.each_with_object({}) do |(name, _value), vars|
|
174
173
|
next unless name.start_with?('QA_')
|
175
174
|
|
176
175
|
var_name = env_var_name_if_defined(name)
|
@@ -181,7 +180,7 @@ module Gitlab
|
|
181
180
|
end
|
182
181
|
|
183
182
|
def debug?
|
184
|
-
enabled?(ENV
|
183
|
+
enabled?(ENV.fetch('QA_DEBUG', nil), default: true)
|
185
184
|
end
|
186
185
|
|
187
186
|
def log_level
|
@@ -209,7 +208,7 @@ module Gitlab
|
|
209
208
|
end
|
210
209
|
|
211
210
|
def colorized_logs?
|
212
|
-
enabled?(ENV
|
211
|
+
enabled?(ENV.fetch('COLORIZED_LOGS', nil), default: false)
|
213
212
|
end
|
214
213
|
|
215
214
|
def dev_access_token_variable
|
@@ -266,32 +265,30 @@ module Gitlab
|
|
266
265
|
|
267
266
|
def require_aws_s3_environment!
|
268
267
|
%w[AWS_S3_REGION AWS_S3_KEY_ID AWS_S3_ACCESS_KEY AWS_S3_BUCKET_NAME].each do |env_key|
|
269
|
-
unless ENV.key?(env_key)
|
270
|
-
raise ArgumentError, "Environment variable #{env_key} must be set to run AWS S3 object storage specs"
|
271
|
-
end
|
268
|
+
raise ArgumentError, "Environment variable #{env_key} must be set to run AWS S3 object storage specs" unless ENV.key?(env_key)
|
272
269
|
end
|
273
270
|
end
|
274
271
|
|
275
272
|
def require_gcs_environment!
|
276
273
|
%w[GOOGLE_PROJECT GOOGLE_CLIENT_EMAIL GOOGLE_JSON_KEY GCS_BUCKET_NAME].each do |env_key|
|
277
|
-
unless ENV.key?(env_key)
|
278
|
-
raise ArgumentError, "Environment variable #{env_key} must be set to run GCS object storage specs"
|
279
|
-
end
|
274
|
+
raise ArgumentError, "Environment variable #{env_key} must be set to run GCS object storage specs" unless ENV.key?(env_key)
|
280
275
|
end
|
281
276
|
end
|
282
277
|
|
283
278
|
def require_gcs_with_cdn_environment!
|
284
|
-
%w[GOOGLE_CDN_JSON_KEY GCS_CDN_BUCKET_NAME GOOGLE_CDN_LB GOOGLE_CDN_SIGNURL_KEY
|
285
|
-
|
286
|
-
|
287
|
-
end
|
279
|
+
%w[GOOGLE_CDN_JSON_KEY GCS_CDN_BUCKET_NAME GOOGLE_CDN_LB GOOGLE_CDN_SIGNURL_KEY
|
280
|
+
GOOGLE_CDN_SIGNURL_KEY_NAME].each do |env_key|
|
281
|
+
raise ArgumentError, "Environment variable #{env_key} must be set to run GCS with CDN enabled scenario" unless ENV.key?(env_key)
|
288
282
|
end
|
289
283
|
end
|
290
284
|
|
291
285
|
def require_oauth_environment!
|
292
286
|
%w[QA_GITHUB_OAUTH_APP_ID QA_GITHUB_OAUTH_APP_SECRET QA_GITHUB_USERNAME
|
293
|
-
|
294
|
-
|
287
|
+
QA_GITHUB_PASSWORD QA_1P_EMAIL QA_1P_PASSWORD QA_1P_SECRET QA_1P_GITHUB_UUID].each do |env_key|
|
288
|
+
unless ENV.key?(env_key)
|
289
|
+
raise ArgumentError,
|
290
|
+
"Environment variable #{env_key} must be set to run OAuth specs"
|
291
|
+
end
|
295
292
|
end
|
296
293
|
end
|
297
294
|
|
@@ -441,7 +438,7 @@ module Gitlab
|
|
441
438
|
end
|
442
439
|
|
443
440
|
def env_var_value_if_defined(variable)
|
444
|
-
return ENV
|
441
|
+
return ENV.fetch(variable, nil) if env_var_value_valid?(variable)
|
445
442
|
end
|
446
443
|
|
447
444
|
def env_var_name_if_defined(variable)
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'tempfile'
|
3
4
|
|
4
5
|
module Gitlab
|
@@ -26,7 +27,7 @@ module Gitlab
|
|
26
27
|
end
|
27
28
|
|
28
29
|
def setup_json_key
|
29
|
-
Tempfile.open('gcs-json-key', ENV
|
30
|
+
Tempfile.open('gcs-json-key', ENV.fetch('CI_PROJECT_DIR', nil)) do |file|
|
30
31
|
file.write(ENV.fetch('GOOGLE_JSON_KEY'))
|
31
32
|
|
32
33
|
file
|
@@ -18,18 +18,14 @@ module Gitlab
|
|
18
18
|
|
19
19
|
define_singleton_method(attribute) do
|
20
20
|
attributes[attribute.to_sym].tap do |value|
|
21
|
-
if value.to_s.empty?
|
22
|
-
raise ArgumentError, "Empty `#{attribute}` attribute!"
|
23
|
-
end
|
21
|
+
raise ArgumentError, "Empty `#{attribute}` attribute!" if value.to_s.empty?
|
24
22
|
end
|
25
23
|
end
|
26
24
|
end
|
27
25
|
|
28
|
-
# rubocop:disable Style/MethodMissing
|
29
26
|
def method_missing(name, *)
|
30
27
|
raise ArgumentError, "Scenario attribute `#{name}` not defined!"
|
31
28
|
end
|
32
|
-
# rubocop:enable Style/MethodMissing
|
33
29
|
end
|
34
30
|
end
|
35
31
|
end
|
@@ -4,8 +4,8 @@ module Gitlab
|
|
4
4
|
module QA
|
5
5
|
module Scenario
|
6
6
|
module Actable
|
7
|
-
def act(
|
8
|
-
instance_exec(
|
7
|
+
def act(...)
|
8
|
+
instance_exec(...)
|
9
9
|
end
|
10
10
|
|
11
11
|
def self.included(base)
|
@@ -17,8 +17,8 @@ module Gitlab
|
|
17
17
|
yield new if block_given?
|
18
18
|
end
|
19
19
|
|
20
|
-
def act(
|
21
|
-
new.act(
|
20
|
+
def act(...)
|
21
|
+
new.act(...)
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -80,10 +80,10 @@ module Gitlab
|
|
80
80
|
iptables -A OUTPUT -p tcp -m tcp --sport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
|
81
81
|
iptables -A INPUT -p tcp -m tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
|
82
82
|
|
83
|
-
# some exceptions to allow runners access network https://gitlab.com/gitlab-org/gitlab-qa/-/issues/700
|
83
|
+
# some exceptions to allow runners access network https://gitlab.com/gitlab-org/gitlab-qa/-/issues/700#{' '}
|
84
84
|
iptables -A OUTPUT -p tcp -d #{gitlab_registry_ip} -j ACCEPT
|
85
85
|
iptables -A OUTPUT -p tcp -d #{dev_gitlab_registry_ip} -j ACCEPT
|
86
|
-
# allow access to praefect node
|
86
|
+
# allow access to praefect node#{' '}
|
87
87
|
iptables -A OUTPUT -p tcp -d #{praefect_ip} -j ACCEPT
|
88
88
|
|
89
89
|
# Should now fail to ping gitlab_ip, port 22/80 should be open
|
@@ -37,7 +37,8 @@ module Gitlab
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def deployment_component
|
40
|
-
raise NotImplementedError,
|
40
|
+
raise NotImplementedError,
|
41
|
+
'Please define the Component for the deployment environment associated with this scenario.'
|
41
42
|
end
|
42
43
|
end
|
43
44
|
end
|
@@ -18,7 +18,7 @@ module Gitlab
|
|
18
18
|
raise ArgumentError, 'Group SAML is EE only feature!' unless release.ee?
|
19
19
|
end
|
20
20
|
|
21
|
-
def configure(gitlab,
|
21
|
+
def configure(gitlab, _saml)
|
22
22
|
gitlab.omnibus_configuration << <<~OMNIBUS
|
23
23
|
gitlab_rails['omniauth_enabled'] = true;
|
24
24
|
gitlab_rails['omniauth_providers'] = [{ name: 'group_saml' }];
|
@@ -66,16 +66,14 @@ module Gitlab
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
-
def orchestrate_ldap
|
69
|
+
def orchestrate_ldap(&block)
|
70
70
|
Component::LDAP.perform do |ldap|
|
71
71
|
ldap.name = 'ldap-server'
|
72
72
|
ldap.network = 'test'
|
73
73
|
ldap.set_gitlab_credentials
|
74
74
|
ldap.tls = tls
|
75
75
|
|
76
|
-
ldap.instance
|
77
|
-
yield
|
78
|
-
end
|
76
|
+
ldap.instance(&block)
|
79
77
|
end
|
80
78
|
end
|
81
79
|
|
@@ -90,8 +88,9 @@ module Gitlab
|
|
90
88
|
if orchestrate_ldap_server
|
91
89
|
orchestrate_ldap { run_specs(gitlab, {}, *rspec_args) }
|
92
90
|
else
|
93
|
-
volumes = {
|
94
|
-
|
91
|
+
volumes = { admin: File.join(Docker::Volumes::QA_CONTAINER_WORKDIR, 'qa/fixtures/ldap/admin'),
|
92
|
+
non_admin: File.join(Docker::Volumes::QA_CONTAINER_WORKDIR,
|
93
|
+
'qa/fixtures/ldap/non_admin') }
|
95
94
|
run_specs(gitlab, volumes, *rspec_args)
|
96
95
|
end
|
97
96
|
end
|
@@ -11,7 +11,7 @@ module Gitlab
|
|
11
11
|
attr_reader :gitlab_name
|
12
12
|
|
13
13
|
def initialize
|
14
|
-
@gitlab_name = 'gitlab
|
14
|
+
@gitlab_name = 'gitlab'
|
15
15
|
end
|
16
16
|
|
17
17
|
def perform(release, *rspec_args)
|
@@ -23,8 +23,9 @@ module Gitlab
|
|
23
23
|
gitlab.release = release
|
24
24
|
gitlab.network = 'test'
|
25
25
|
gitlab.name = gitlab_name
|
26
|
+
gitlab.tls = true
|
26
27
|
|
27
|
-
gitlab.omnibus_configuration << gitlab_omnibus_configuration
|
28
|
+
gitlab.omnibus_configuration << gitlab_omnibus_configuration(gitlab.address)
|
28
29
|
|
29
30
|
gitlab.instance do
|
30
31
|
Runtime::Logger.info('Running OAuth specs!')
|
@@ -43,7 +44,7 @@ module Gitlab
|
|
43
44
|
|
44
45
|
private
|
45
46
|
|
46
|
-
def gitlab_omnibus_configuration
|
47
|
+
def gitlab_omnibus_configuration(gitlab_address)
|
47
48
|
<<~OMNIBUS
|
48
49
|
gitlab_rails['omniauth_enabled'] = true;
|
49
50
|
gitlab_rails['omniauth_allow_single_sign_on'] = ['github'];
|
@@ -58,6 +59,8 @@ module Gitlab
|
|
58
59
|
args: { scope: 'user:email' }
|
59
60
|
}
|
60
61
|
];
|
62
|
+
letsencrypt['enable'] = false;
|
63
|
+
external_url '#{gitlab_address}';
|
61
64
|
OMNIBUS
|
62
65
|
end
|
63
66
|
end
|
@@ -115,7 +115,7 @@ module Gitlab
|
|
115
115
|
# @param [Gitlab::QA::Release] release
|
116
116
|
# @return [Boolean]
|
117
117
|
def run_specs?(release)
|
118
|
-
[upgrade_path.first, current_release].any?
|
118
|
+
[upgrade_path.first, current_release].any?(release)
|
119
119
|
end
|
120
120
|
end
|
121
121
|
end
|
@@ -12,9 +12,7 @@ module Gitlab
|
|
12
12
|
def perform(image = 'CE', *rspec_args)
|
13
13
|
ce_release = QA::Release.new(image)
|
14
14
|
|
15
|
-
if ce_release.ee?
|
16
|
-
raise ArgumentError, 'Only CE can be upgraded to EE!'
|
17
|
-
end
|
15
|
+
raise ArgumentError, 'Only CE can be upgraded to EE!' if ce_release.ee?
|
18
16
|
|
19
17
|
Docker::Volumes.new.with_temporary_volumes do |volumes|
|
20
18
|
Scenario::Test::Instance::Image
|
@@ -71,7 +71,7 @@ module Gitlab
|
|
71
71
|
end
|
72
72
|
|
73
73
|
def commit_within_hours?(commit_time_string, hours)
|
74
|
-
Time.at(Time.parse(commit_time_string).utc).to_datetime > Time.at((Time.now - hours * 60 * 60).utc).to_datetime
|
74
|
+
Time.at(Time.parse(commit_time_string).utc).to_datetime > Time.at((Time.now - (hours * 60 * 60)).utc).to_datetime
|
75
75
|
end
|
76
76
|
|
77
77
|
def api_commit_detail(host, project, sha)
|
@@ -10,7 +10,7 @@ module Gitlab
|
|
10
10
|
global_server_prereceive_hook = <<~SCRIPT
|
11
11
|
#!/usr/bin/env bash
|
12
12
|
|
13
|
-
if [[
|
13
|
+
if [[ \\$GL_PROJECT_PATH =~ 'reject-prereceive' ]]; then
|
14
14
|
echo 'GL-HOOK-ERR: Custom error message rejecting prereceive hook for projects with GL_PROJECT_PATH matching pattern reject-prereceive'
|
15
15
|
exit 1
|
16
16
|
fi
|
@@ -4,8 +4,8 @@ module Gitlab
|
|
4
4
|
module QA
|
5
5
|
module Support
|
6
6
|
class GitlabVersionInfo
|
7
|
-
VERSION_PATTERN = /^(?<version>\d+\.\d+\.\d+)
|
8
|
-
COMPONENT_PATTERN = /^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)
|
7
|
+
VERSION_PATTERN = /^(?<version>\d+\.\d+\.\d+)/
|
8
|
+
COMPONENT_PATTERN = /^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)/
|
9
9
|
|
10
10
|
# Get previous gitlab version
|
11
11
|
#
|
@@ -155,7 +155,6 @@ module Gitlab
|
|
155
155
|
# All available docker tags
|
156
156
|
#
|
157
157
|
# @return [Array<String>]
|
158
|
-
# rubocop:disable Metrics/AbcSize
|
159
158
|
def tags
|
160
159
|
return @tags if defined?(@tags)
|
161
160
|
|
@@ -174,9 +173,8 @@ module Gitlab
|
|
174
173
|
.parse(response.body, symbolize_names: true)
|
175
174
|
.fetch(:results)
|
176
175
|
.map { |tag| tag[:name] }
|
177
|
-
.
|
176
|
+
.grep(VERSION_PATTERN)
|
178
177
|
end
|
179
|
-
# rubocop:enable Metrics/AbcSize
|
180
178
|
end
|
181
179
|
end
|
182
180
|
end
|
@@ -41,7 +41,7 @@ module Gitlab
|
|
41
41
|
# @return [ActiveSupport::Logger]
|
42
42
|
def console_logger(level:, source:)
|
43
43
|
ActiveSupport::Logger.new($stdout, level: level, datetime_format: TIME_FORMAT).tap do |logger|
|
44
|
-
logger.formatter = proc do |severity, datetime,
|
44
|
+
logger.formatter = proc do |severity, datetime, _progname, msg|
|
45
45
|
msg_prefix = message_prefix(datetime, source, severity)
|
46
46
|
|
47
47
|
Rainbow(msg_prefix).public_send(LEVEL_COLORS.fetch(severity, :silver)) + "#{msg}\n" # rubocop:disable GitlabSecurity/PublicSend
|
@@ -58,7 +58,7 @@ module Gitlab
|
|
58
58
|
log_file = "#{path}/#{source.downcase.tr(' ', '-')}.log"
|
59
59
|
|
60
60
|
ActiveSupport::Logger.new(log_file, level: :debug, datetime_format: TIME_FORMAT).tap do |logger|
|
61
|
-
logger.formatter = proc do |severity, datetime,
|
61
|
+
logger.formatter = proc do |severity, datetime, _progname, msg|
|
62
62
|
msg_prefix = message_prefix(datetime, source, severity)
|
63
63
|
|
64
64
|
"#{msg_prefix}#{msg}\n".gsub(/\e\[(\d+)(?:;\d+)*m/, "")
|
data/lib/gitlab/qa/version.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
# rubocop:disable Metrics/AbcSize
|
3
4
|
|
4
5
|
class LicenseUsageSeed
|
@@ -66,7 +67,8 @@ class LicenseUsageSeed
|
|
66
67
|
def self.create_license_usage_record
|
67
68
|
# Force update daily billable users and historical license data
|
68
69
|
identifier = Analytics::UsageTrends::Measurement.identifiers[:billable_users]
|
69
|
-
::Analytics::UsageTrends::CounterJobWorker.new.perform(identifier, User.minimum(:id), User.maximum(:id),
|
70
|
+
::Analytics::UsageTrends::CounterJobWorker.new.perform(identifier, User.minimum(:id), User.maximum(:id),
|
71
|
+
Time.zone.now)
|
70
72
|
|
71
73
|
HistoricalData.track!
|
72
74
|
end
|
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:
|
4
|
+
version: 12.0.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: 2023-06-
|
11
|
+
date: 2023-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: climate_control
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: '10'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: '10'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: lefthook
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -182,16 +182,22 @@ dependencies:
|
|
182
182
|
name: activesupport
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
|
-
- - "
|
185
|
+
- - ">="
|
186
186
|
- !ruby/object:Gem::Version
|
187
187
|
version: '6.1'
|
188
|
+
- - "<"
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: '7.1'
|
188
191
|
type: :runtime
|
189
192
|
prerelease: false
|
190
193
|
version_requirements: !ruby/object:Gem::Requirement
|
191
194
|
requirements:
|
192
|
-
- - "
|
195
|
+
- - ">="
|
193
196
|
- !ruby/object:Gem::Version
|
194
197
|
version: '6.1'
|
198
|
+
- - "<"
|
199
|
+
- !ruby/object:Gem::Version
|
200
|
+
version: '7.1'
|
195
201
|
- !ruby/object:Gem::Dependency
|
196
202
|
name: gitlab
|
197
203
|
requirement: !ruby/object:Gem::Requirement
|
@@ -401,7 +407,6 @@ files:
|
|
401
407
|
- lib/gitlab/qa/runtime/omnibus_configurations/object_storage.rb
|
402
408
|
- lib/gitlab/qa/runtime/omnibus_configurations/object_storage_aws.rb
|
403
409
|
- lib/gitlab/qa/runtime/omnibus_configurations/object_storage_gcs.rb
|
404
|
-
- lib/gitlab/qa/runtime/omnibus_configurations/packages.rb
|
405
410
|
- lib/gitlab/qa/runtime/omnibus_configurations/registry_object_storage.rb
|
406
411
|
- lib/gitlab/qa/runtime/scenario.rb
|
407
412
|
- lib/gitlab/qa/scenario/actable.rb
|
@@ -500,7 +505,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
500
505
|
requirements:
|
501
506
|
- - ">="
|
502
507
|
- !ruby/object:Gem::Version
|
503
|
-
version:
|
508
|
+
version: 3.0.0
|
504
509
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
505
510
|
requirements:
|
506
511
|
- - ">="
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Gitlab
|
4
|
-
module QA
|
5
|
-
module Runtime
|
6
|
-
module OmnibusConfigurations
|
7
|
-
class Packages < Default
|
8
|
-
def configuration
|
9
|
-
<<~OMNIBUS
|
10
|
-
gitlab_rails['packages_enabled'] = true
|
11
|
-
OMNIBUS
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|