gitlab-qa 7.17.1 → 7.18.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/.gitlab-ci.yml +39 -18
- data/gitlab-qa.gemspec +1 -0
- data/lib/gitlab/qa/component/base.rb +1 -1
- data/lib/gitlab/qa/component/minio.rb +1 -1
- data/lib/gitlab/qa/component/specs.rb +3 -3
- data/lib/gitlab/qa/docker/shellout.rb +5 -2
- data/lib/gitlab/qa/runtime/env.rb +45 -24
- data/lib/gitlab/qa/runtime/logger.rb +36 -0
- data/lib/gitlab/qa/scenario/test/integration/actioncable.rb +1 -1
- data/lib/gitlab/qa/scenario/test/integration/client_ssl.rb +1 -1
- data/lib/gitlab/qa/scenario/test/integration/cloud_activation.rb +36 -0
- data/lib/gitlab/qa/scenario/test/integration/elasticsearch.rb +1 -1
- data/lib/gitlab/qa/scenario/test/integration/geo.rb +1 -1
- data/lib/gitlab/qa/scenario/test/integration/gitaly_cluster.rb +1 -1
- data/lib/gitlab/qa/scenario/test/integration/jira.rb +1 -1
- data/lib/gitlab/qa/scenario/test/integration/ldap.rb +1 -1
- data/lib/gitlab/qa/scenario/test/integration/mtls.rb +1 -1
- data/lib/gitlab/qa/scenario/test/integration/saml.rb +1 -1
- data/lib/gitlab/qa/scenario/test/integration/smtp.rb +1 -1
- data/lib/gitlab/qa/support/get_request.rb +1 -1
- data/lib/gitlab/qa/version.rb +1 -1
- data/lib/gitlab/qa.rb +2 -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: 879e5a3fcce24d31675bfc149497fbf8bcff3a30c7ad0e130fe8c0c5dff066bf
|
|
4
|
+
data.tar.gz: 00c054d0c7e8b7835dddbbbb7f984add3e7bb6c5373e1818100a1ad1cc0d4dfa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ce337cb8932389b8911f53c81d31d9ef53f999beb3bb33a39834fc33166a1bc682fe211b41f8128090a4553dc11049d36ea2e94789f8a850ad28a36ebabceec2
|
|
7
|
+
data.tar.gz: 2257bba9c635c0cff8998df076a2560dd2c8c07a51536e24414a9bdccebe1a1342bed8fba8a2ecaae7baa5e3743ec554f246ff5b06407c656396d2eff04f934a
|
data/.gitlab-ci.yml
CHANGED
|
@@ -77,7 +77,7 @@ rspec:
|
|
|
77
77
|
when: always
|
|
78
78
|
expire_in: 10d
|
|
79
79
|
paths:
|
|
80
|
-
-
|
|
80
|
+
- gitlab-qa-run-*
|
|
81
81
|
reports:
|
|
82
82
|
junit: gitlab-qa-run-*/**/rspec-*.xml
|
|
83
83
|
script:
|
|
@@ -125,12 +125,6 @@ rspec:
|
|
|
125
125
|
- 7gb
|
|
126
126
|
- triggered-packages
|
|
127
127
|
|
|
128
|
-
.knapsack-variables:
|
|
129
|
-
variables:
|
|
130
|
-
KNAPSACK_REPORT_PATH: "knapsack/master_report.json"
|
|
131
|
-
KNAPSACK_TEST_FILE_PATTERN: "qa/specs/features/**/*_spec.rb"
|
|
132
|
-
KNAPSACK_GENERATE_REPORT: "true"
|
|
133
|
-
|
|
134
128
|
.rspec-report-opts:
|
|
135
129
|
variables:
|
|
136
130
|
FILE_SAFE_JOB_NAME: $(echo $CI_JOB_NAME | sed 's/[ /]/_/g')
|
|
@@ -174,7 +168,6 @@ ce:custom-parallel:
|
|
|
174
168
|
- .rspec-report-opts
|
|
175
169
|
- .no-issue-report-script
|
|
176
170
|
- .ce-variables
|
|
177
|
-
|
|
178
171
|
allow_failure: true
|
|
179
172
|
parallel: 10
|
|
180
173
|
|
|
@@ -195,7 +188,6 @@ ce:instance-parallel:
|
|
|
195
188
|
- .test
|
|
196
189
|
- .high-capacity
|
|
197
190
|
- .ce-variables
|
|
198
|
-
- .knapsack-variables
|
|
199
191
|
- .rspec-report-opts
|
|
200
192
|
parallel: 5
|
|
201
193
|
|
|
@@ -224,7 +216,6 @@ ee:instance-parallel:
|
|
|
224
216
|
- .test
|
|
225
217
|
- .high-capacity
|
|
226
218
|
- .ee-variables
|
|
227
|
-
- .knapsack-variables
|
|
228
219
|
- .rspec-report-opts
|
|
229
220
|
parallel: 5
|
|
230
221
|
|
|
@@ -253,7 +244,6 @@ ce:relative_url-parallel:
|
|
|
253
244
|
- .test
|
|
254
245
|
- .high-capacity
|
|
255
246
|
- .ce-variables
|
|
256
|
-
- .knapsack-variables
|
|
257
247
|
- .rspec-report-opts
|
|
258
248
|
parallel: 5
|
|
259
249
|
variables:
|
|
@@ -287,7 +277,6 @@ ee:relative_url-parallel:
|
|
|
287
277
|
- .test
|
|
288
278
|
- .high-capacity
|
|
289
279
|
- .ee-variables
|
|
290
|
-
- .knapsack-variables
|
|
291
280
|
- .rspec-report-opts
|
|
292
281
|
parallel: 5
|
|
293
282
|
variables:
|
|
@@ -381,7 +370,6 @@ ce:update-parallel:
|
|
|
381
370
|
- .high-capacity
|
|
382
371
|
- .ce-variables
|
|
383
372
|
- .rspec-report-opts
|
|
384
|
-
- .knapsack-variables
|
|
385
373
|
- .update-scenario-script
|
|
386
374
|
parallel: 5
|
|
387
375
|
|
|
@@ -413,7 +401,6 @@ ee:update-parallel:
|
|
|
413
401
|
- .high-capacity
|
|
414
402
|
- .ee-variables
|
|
415
403
|
- .rspec-report-opts
|
|
416
|
-
- .knapsack-variables
|
|
417
404
|
- .update-scenario-script
|
|
418
405
|
parallel: 10
|
|
419
406
|
|
|
@@ -446,7 +433,6 @@ ce:upgrade-parallel:
|
|
|
446
433
|
- .test
|
|
447
434
|
- .high-capacity
|
|
448
435
|
- .rspec-report-opts
|
|
449
|
-
- .knapsack-variables
|
|
450
436
|
parallel: 5
|
|
451
437
|
|
|
452
438
|
ce:upgrade:
|
|
@@ -549,7 +535,7 @@ ee:service_ping_disabled:
|
|
|
549
535
|
variables:
|
|
550
536
|
QA_SCENARIO: "Test::Integration::ServicePingDisabled"
|
|
551
537
|
|
|
552
|
-
# Disabling geo jobs temporarily due to https://gitlab.com/gitlab-org/
|
|
538
|
+
# Disabling geo jobs temporarily due to https://gitlab.com/gitlab-org/quality/team-tasks/-/issues/774
|
|
553
539
|
# ee:geo:
|
|
554
540
|
# extends:
|
|
555
541
|
# - .test
|
|
@@ -1011,7 +997,6 @@ ce:praefect-parallel:
|
|
|
1011
997
|
- .test
|
|
1012
998
|
- .high-capacity
|
|
1013
999
|
- .ce-variables
|
|
1014
|
-
- .knapsack-variables
|
|
1015
1000
|
- .rspec-report-opts
|
|
1016
1001
|
parallel: 5
|
|
1017
1002
|
variables:
|
|
@@ -1048,7 +1033,6 @@ ee:praefect-parallel:
|
|
|
1048
1033
|
- .test
|
|
1049
1034
|
- .high-capacity
|
|
1050
1035
|
- .ee-variables
|
|
1051
|
-
- .knapsack-variables
|
|
1052
1036
|
- .rspec-report-opts
|
|
1053
1037
|
parallel: 10
|
|
1054
1038
|
variables:
|
|
@@ -1225,6 +1209,35 @@ ee:large-setup:
|
|
|
1225
1209
|
variables:
|
|
1226
1210
|
QA_RSPEC_TAGS: "--tag can_use_large_setup"
|
|
1227
1211
|
|
|
1212
|
+
ee:cloud-activation:
|
|
1213
|
+
before_script:
|
|
1214
|
+
- unset EE_LICENSE
|
|
1215
|
+
- unset GITLAB_QA_FORMLESS_LOGIN_TOKEN
|
|
1216
|
+
- !reference [default, before_script]
|
|
1217
|
+
extends:
|
|
1218
|
+
- .rules:ee-never-when-triggered-by-feature-flag-definition-change
|
|
1219
|
+
- .test
|
|
1220
|
+
- .high-capacity
|
|
1221
|
+
- .ee-variables
|
|
1222
|
+
- .rspec-report-opts
|
|
1223
|
+
variables:
|
|
1224
|
+
QA_SCENARIO: "Test::Integration::CloudActivation"
|
|
1225
|
+
|
|
1226
|
+
ee:cloud-activation-quarantine:
|
|
1227
|
+
before_script:
|
|
1228
|
+
- unset EE_LICENSE
|
|
1229
|
+
- unset GITLAB_QA_FORMLESS_LOGIN_TOKEN
|
|
1230
|
+
- !reference [default, before_script]
|
|
1231
|
+
extends:
|
|
1232
|
+
- .rules:ee-never-when-triggered-by-feature-flag-definition-change
|
|
1233
|
+
- .test
|
|
1234
|
+
- .high-capacity
|
|
1235
|
+
- .ee-variables
|
|
1236
|
+
- .quarantine
|
|
1237
|
+
- .rspec-report-opts
|
|
1238
|
+
variables:
|
|
1239
|
+
QA_SCENARIO: "Test::Integration::CloudActivation"
|
|
1240
|
+
|
|
1228
1241
|
# This job requires the `GITLAB_QA_ACCESS_TOKEN` and `GITLAB_QA_DEV_ACCESS_TOKEN`
|
|
1229
1242
|
# variable to be passed when triggered.
|
|
1230
1243
|
staging:
|
|
@@ -1348,9 +1361,17 @@ generate-allure-report:
|
|
|
1348
1361
|
- if: '$TOP_UPSTREAM_SOURCE_PROJECT && $TOP_UPSTREAM_SOURCE_SHA'
|
|
1349
1362
|
when: always
|
|
1350
1363
|
|
|
1364
|
+
generate-knapsack-report:
|
|
1365
|
+
extends: .generate-knapsack-report-base
|
|
1366
|
+
image:
|
|
1367
|
+
name: ${QA_IMAGE}
|
|
1368
|
+
stage: report
|
|
1369
|
+
|
|
1351
1370
|
include:
|
|
1352
1371
|
- local: .gitlab/ci/*.gitlab-ci.yml
|
|
1353
1372
|
- project: 'gitlab-org/quality/pipeline-common'
|
|
1354
1373
|
file: '/ci/gem-release.yml'
|
|
1355
1374
|
- project: 'gitlab-org/quality/pipeline-common'
|
|
1356
1375
|
file: '/ci/allure-report.yml'
|
|
1376
|
+
- project: 'gitlab-org/quality/pipeline-common'
|
|
1377
|
+
file: '/ci/knapsack-report.yml'
|
data/gitlab-qa.gemspec
CHANGED
|
@@ -31,5 +31,6 @@ Gem::Specification.new do |spec|
|
|
|
31
31
|
spec.add_runtime_dependency 'gitlab', '~> 4.18.0'
|
|
32
32
|
spec.add_runtime_dependency 'http', '~> 5.0'
|
|
33
33
|
spec.add_runtime_dependency 'nokogiri', '~> 1.10'
|
|
34
|
+
spec.add_runtime_dependency 'rainbow', '~> 3.0.0'
|
|
34
35
|
spec.add_runtime_dependency 'table_print', '1.5.7'
|
|
35
36
|
end
|
|
@@ -17,7 +17,7 @@ module Gitlab
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def perform
|
|
20
|
-
return
|
|
20
|
+
return Runtime::Logger.info("Skipping tests.") if skip_tests?
|
|
21
21
|
|
|
22
22
|
raise ArgumentError unless [suite, release].all?
|
|
23
23
|
|
|
@@ -25,7 +25,7 @@ module Gitlab
|
|
|
25
25
|
|
|
26
26
|
@docker.pull(image: qa_image) unless Runtime::Env.skip_pull?
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Runtime::Logger.info("Running test suite `#{suite}` for #{release.project_name}")
|
|
29
29
|
|
|
30
30
|
name = "#{release.project_name}-qa-#{SecureRandom.hex(4)}"
|
|
31
31
|
|
|
@@ -71,7 +71,7 @@ module Gitlab
|
|
|
71
71
|
def args_with_flags(args, feature_flag_set)
|
|
72
72
|
return args if feature_flag_set.empty?
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
Runtime::Logger.info("Running with feature flag: #{feature_flag_set.join(' ')}")
|
|
75
75
|
|
|
76
76
|
args_with_f = args.dup
|
|
77
77
|
args_with_f.insert(1, *feature_flag_set)
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
require 'open3'
|
|
2
|
+
require 'rainbow/refinement'
|
|
2
3
|
|
|
3
4
|
module Gitlab
|
|
4
5
|
module QA
|
|
5
6
|
module Docker
|
|
6
7
|
class Shellout
|
|
8
|
+
using Rainbow
|
|
7
9
|
StatusError = Class.new(StandardError)
|
|
8
10
|
|
|
9
11
|
def initialize(command)
|
|
10
12
|
@command = command
|
|
11
13
|
@output = []
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
Rainbow.enabled = Runtime::Env.colorized_logs?
|
|
16
|
+
Runtime::Logger.info("Docker shell command: `#{@command.mask_secrets}`".cyan)
|
|
14
17
|
end
|
|
15
18
|
|
|
16
19
|
def execute! # rubocop:disable Metrics/AbcSize
|
|
@@ -28,7 +31,7 @@ module Gitlab
|
|
|
28
31
|
end
|
|
29
32
|
|
|
30
33
|
if wait.value.exited? && wait.value.exitstatus.nonzero? # rubocop:disable Style/IfUnlessModifier
|
|
31
|
-
raise StatusError, "Docker command `#{@command.mask_secrets}` failed!"
|
|
34
|
+
raise StatusError, "Docker command `#{@command.mask_secrets}` failed! ✘"
|
|
32
35
|
end
|
|
33
36
|
end
|
|
34
37
|
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
require 'active_support/core_ext/object/blank'
|
|
1
2
|
require 'securerandom'
|
|
3
|
+
require 'rainbow/refinement'
|
|
2
4
|
|
|
3
5
|
module Gitlab
|
|
4
6
|
module QA
|
|
5
7
|
module Runtime
|
|
6
8
|
module Env
|
|
7
9
|
extend self
|
|
10
|
+
using Rainbow
|
|
8
11
|
|
|
9
12
|
# Variables that are used in tests and are passed through to the docker container that executes the tests.
|
|
10
13
|
# These variables should be listed in /docs/what_tests_can_be_run.md#supported-gitlab-environment-variables
|
|
@@ -76,6 +79,7 @@ module Gitlab
|
|
|
76
79
|
'KNAPSACK_REPORT_PATH' => :knapsack_report_path,
|
|
77
80
|
'KNAPSACK_TEST_FILE_PATTERN' => :knapsack_test_file_pattern,
|
|
78
81
|
'KNAPSACK_TEST_DIR' => :knapsack_test_dir,
|
|
82
|
+
'QA_KNAPSACK_REPORT_GCS_CREDENTIALS' => :qa_knapsack_report_gcs_credentials,
|
|
79
83
|
'CI' => :ci,
|
|
80
84
|
'CI_COMMIT_REF_NAME' => :ci_commit_ref_name,
|
|
81
85
|
'CI_JOB_NAME' => :ci_job_name,
|
|
@@ -124,14 +128,15 @@ module Gitlab
|
|
|
124
128
|
'GCS_BUCKET_NAME' => :gcs_bucket_name,
|
|
125
129
|
'SMOKE_ONLY' => :smoke_only,
|
|
126
130
|
'NO_ADMIN' => :no_admin,
|
|
127
|
-
'CHROME_DISABLE_DEV_SHM' => :chrome_disable_dev_shm
|
|
131
|
+
'CHROME_DISABLE_DEV_SHM' => :chrome_disable_dev_shm,
|
|
132
|
+
'COLORIZED_LOGS' => :colorized_logs
|
|
128
133
|
}.freeze
|
|
129
134
|
|
|
130
135
|
ENV_VARIABLES.each do |env_name, method_name|
|
|
131
136
|
attr_writer(method_name)
|
|
132
137
|
|
|
133
138
|
define_method(method_name) do
|
|
134
|
-
|
|
139
|
+
env_var_value_if_defined(env_name) || (instance_variable_get("@#{method_name}") if instance_variable_defined?("@#{method_name}"))
|
|
135
140
|
end
|
|
136
141
|
end
|
|
137
142
|
|
|
@@ -141,36 +146,40 @@ module Gitlab
|
|
|
141
146
|
ENV_VARIABLES.each do |name, attribute|
|
|
142
147
|
# Variables that are overridden in the environment take precedence
|
|
143
148
|
# over the defaults specified by the QA runtime.
|
|
144
|
-
value =
|
|
149
|
+
value = env_var_name_if_defined(name) || send(attribute) # rubocop:disable GitlabSecurity/PublicSend
|
|
145
150
|
vars[name] = value if value
|
|
146
151
|
end
|
|
147
152
|
|
|
148
153
|
vars
|
|
149
154
|
end
|
|
150
155
|
|
|
156
|
+
def debug?
|
|
157
|
+
enabled?(ENV['QA_DEBUG'], default: true)
|
|
158
|
+
end
|
|
159
|
+
|
|
151
160
|
def default_branch
|
|
152
|
-
|
|
161
|
+
env_var_value_if_defined('QA_DEFAULT_BRANCH') || 'main'
|
|
153
162
|
end
|
|
154
163
|
|
|
155
164
|
def gitlab_availability_timeout
|
|
156
|
-
|
|
165
|
+
(env_var_value_if_defined('GITLAB_QA_AVAILABILITY_TIMEOUT') || 360).to_i
|
|
157
166
|
end
|
|
158
167
|
|
|
159
168
|
def gitlab_username
|
|
160
|
-
|
|
169
|
+
env_var_value_if_defined('GITLAB_USERNAME') || 'gitlab-qa'
|
|
161
170
|
end
|
|
162
171
|
|
|
163
172
|
def gitlab_dev_username
|
|
164
|
-
|
|
173
|
+
env_var_value_if_defined('GITLAB_DEV_USERNAME') || 'gitlab-qa-bot'
|
|
165
174
|
end
|
|
166
175
|
|
|
167
176
|
def gitlab_api_base
|
|
168
|
-
|
|
177
|
+
env_var_value_if_defined('GITLAB_API_BASE') || 'https://gitlab.com/api/v4'
|
|
169
178
|
end
|
|
170
179
|
|
|
171
180
|
def pipeline_from_project_name
|
|
172
181
|
if ci_project_name.to_s.start_with?('gitlab-qa')
|
|
173
|
-
if
|
|
182
|
+
if env_var_value_if_defined('TOP_UPSTREAM_SOURCE_JOB').to_s.start_with?('https://ops.gitlab.net')
|
|
174
183
|
'staging-orchestrated'
|
|
175
184
|
else
|
|
176
185
|
QA::Runtime::Env.default_branch
|
|
@@ -184,24 +193,28 @@ module Gitlab
|
|
|
184
193
|
@run_id ||= "gitlab-qa-run-#{Time.now.strftime('%Y-%m-%d-%H-%M-%S')}-#{SecureRandom.hex(4)}"
|
|
185
194
|
end
|
|
186
195
|
|
|
196
|
+
def colorized_logs?
|
|
197
|
+
enabled?(ENV['COLORIZED_LOGS'], default: false)
|
|
198
|
+
end
|
|
199
|
+
|
|
187
200
|
def dev_access_token_variable
|
|
188
|
-
|
|
201
|
+
env_var_name_if_defined('GITLAB_QA_DEV_ACCESS_TOKEN')
|
|
189
202
|
end
|
|
190
203
|
|
|
191
204
|
def initial_root_password
|
|
192
|
-
|
|
205
|
+
env_var_value_if_defined('GITLAB_INITIAL_ROOT_PASSWORD') || '5iveL!fe'
|
|
193
206
|
end
|
|
194
207
|
|
|
195
208
|
def deploy_environment
|
|
196
|
-
|
|
209
|
+
env_var_value_if_defined('DEPLOY_ENVIRONMENT') || pipeline_from_project_name
|
|
197
210
|
end
|
|
198
211
|
|
|
199
212
|
def host_artifacts_dir
|
|
200
|
-
@host_artifacts_dir ||= File.join(
|
|
213
|
+
@host_artifacts_dir ||= File.join(env_var_value_if_defined('QA_ARTIFACTS_DIR') || '/tmp/gitlab-qa', Runtime::Env.run_id)
|
|
201
214
|
end
|
|
202
215
|
|
|
203
216
|
def elastic_version
|
|
204
|
-
|
|
217
|
+
env_var_value_if_defined('ELASTIC_VERSION') || '6.4.2'.freeze
|
|
205
218
|
end
|
|
206
219
|
|
|
207
220
|
def require_license!
|
|
@@ -217,25 +230,25 @@ module Gitlab
|
|
|
217
230
|
end
|
|
218
231
|
|
|
219
232
|
def require_qa_access_token!
|
|
220
|
-
return unless
|
|
233
|
+
return unless env_var_value_if_defined('GITLAB_QA_ACCESS_TOKEN').to_s.strip.empty?
|
|
221
234
|
|
|
222
235
|
raise ArgumentError, "Please provide GITLAB_QA_ACCESS_TOKEN"
|
|
223
236
|
end
|
|
224
237
|
|
|
225
238
|
def require_qa_dev_access_token!
|
|
226
|
-
return unless
|
|
239
|
+
return unless env_var_value_if_defined('GITLAB_QA_DEV_ACCESS_TOKEN').to_s.strip.empty?
|
|
227
240
|
|
|
228
241
|
raise ArgumentError, "Please provide GITLAB_QA_DEV_ACCESS_TOKEN"
|
|
229
242
|
end
|
|
230
243
|
|
|
231
244
|
def require_slack_qa_channel!
|
|
232
|
-
return unless
|
|
245
|
+
return unless env_var_value_if_defined('SLACK_QA_CHANNEL').to_s.strip.empty?
|
|
233
246
|
|
|
234
247
|
raise ArgumentError, "Please provide SLACK_QA_CHANNEL"
|
|
235
248
|
end
|
|
236
249
|
|
|
237
250
|
def require_ci_slack_webhook_url!
|
|
238
|
-
return unless
|
|
251
|
+
return unless env_var_value_if_defined('CI_SLACK_WEBHOOK_URL').to_s.strip.empty?
|
|
239
252
|
|
|
240
253
|
raise ArgumentError, "Please provide CI_SLACK_WEBHOOK_URL"
|
|
241
254
|
end
|
|
@@ -265,7 +278,7 @@ module Gitlab
|
|
|
265
278
|
end
|
|
266
279
|
|
|
267
280
|
def require_initial_password!
|
|
268
|
-
return unless
|
|
281
|
+
return unless env_var_value_if_defined('GITLAB_INITIAL_ROOT_PASSWORD').to_s.strip.empty?
|
|
269
282
|
|
|
270
283
|
raise(
|
|
271
284
|
ArgumentError,
|
|
@@ -289,11 +302,11 @@ module Gitlab
|
|
|
289
302
|
end
|
|
290
303
|
|
|
291
304
|
def skip_pull?
|
|
292
|
-
enabled?(
|
|
305
|
+
enabled?(env_var_value_if_defined('QA_SKIP_PULL'), default: false)
|
|
293
306
|
end
|
|
294
307
|
|
|
295
308
|
def geo_failover?
|
|
296
|
-
enabled?(
|
|
309
|
+
enabled?(env_var_value_if_defined('GEO_FAILOVER'), default: false)
|
|
297
310
|
end
|
|
298
311
|
|
|
299
312
|
private
|
|
@@ -304,9 +317,17 @@ module Gitlab
|
|
|
304
317
|
(value =~ /^(false|no|0)$/i) != 0
|
|
305
318
|
end
|
|
306
319
|
|
|
307
|
-
def
|
|
308
|
-
|
|
309
|
-
|
|
320
|
+
def env_var_value_valid?(variable)
|
|
321
|
+
!ENV[variable].blank?
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
def env_var_value_if_defined(variable)
|
|
325
|
+
return ENV[variable] if env_var_value_valid?(variable)
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
def env_var_name_if_defined(variable)
|
|
329
|
+
# Pass through the variables if they are defined and not empty in the environment
|
|
330
|
+
return "$#{variable}" if env_var_value_valid?(variable)
|
|
310
331
|
end
|
|
311
332
|
end
|
|
312
333
|
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'logger'
|
|
4
|
+
require 'forwardable'
|
|
5
|
+
require'rainbow/refinement'
|
|
6
|
+
|
|
7
|
+
module Gitlab
|
|
8
|
+
module QA
|
|
9
|
+
module Runtime
|
|
10
|
+
module Logger
|
|
11
|
+
extend SingleForwardable
|
|
12
|
+
using Rainbow
|
|
13
|
+
|
|
14
|
+
def_delegators :logger, :debug, :info, :warn, :error, :fatal, :unknown
|
|
15
|
+
|
|
16
|
+
singleton_class.module_eval do
|
|
17
|
+
attr_writer :logger
|
|
18
|
+
|
|
19
|
+
def logger
|
|
20
|
+
Rainbow.enabled = Runtime::Env.colorized_logs?
|
|
21
|
+
|
|
22
|
+
@logger ||= ::Logger.new($stdout).tap do |logger|
|
|
23
|
+
logger.level = Runtime::Env.debug? ? ::Logger::DEBUG : ::Logger::INFO
|
|
24
|
+
|
|
25
|
+
logger.formatter = proc do |severity, datetime, progname, msg|
|
|
26
|
+
date_format = datetime.strftime("%Y-%m-%d %H:%M:%S")
|
|
27
|
+
|
|
28
|
+
"[date=#{date_format} from=GitLab QA] #{severity.ljust(5)}-- ".yellow + "#{msg}\n"
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -12,7 +12,7 @@ module Gitlab
|
|
|
12
12
|
gitlab.omnibus_configuration << "actioncable['enable'] = true"
|
|
13
13
|
|
|
14
14
|
gitlab.instance do
|
|
15
|
-
|
|
15
|
+
Runtime::Logger.info('Running actioncable specs!')
|
|
16
16
|
|
|
17
17
|
rspec_args << "--" unless rspec_args.include?('--')
|
|
18
18
|
rspec_args << %w[--tag actioncable]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Gitlab
|
|
4
|
+
module QA
|
|
5
|
+
module Scenario
|
|
6
|
+
module Test
|
|
7
|
+
module Integration
|
|
8
|
+
class CloudActivation < Scenario::Template
|
|
9
|
+
def perform(release, *rspec_args)
|
|
10
|
+
Component::Gitlab.perform do |gitlab|
|
|
11
|
+
gitlab.release = release
|
|
12
|
+
gitlab.network = 'test'
|
|
13
|
+
|
|
14
|
+
gitlab.omnibus_configuration << <<~OMNIBUS
|
|
15
|
+
gitlab_rails['env'] = { 'GITLAB_LICENSE_MODE' => 'test', 'CUSTOMER_PORTAL_URL' => 'https://customers.staging.gitlab.com' }
|
|
16
|
+
OMNIBUS
|
|
17
|
+
|
|
18
|
+
gitlab.instance do
|
|
19
|
+
rspec_args << "--" unless rspec_args.include?('--')
|
|
20
|
+
rspec_args << %w[--tag cloud_activation]
|
|
21
|
+
|
|
22
|
+
Component::Specs.perform do |specs|
|
|
23
|
+
specs.suite = 'Test::Instance::All'
|
|
24
|
+
specs.release = gitlab.release
|
|
25
|
+
specs.network = gitlab.network
|
|
26
|
+
specs.args = [gitlab.address, *rspec_args]
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -64,7 +64,7 @@ module Gitlab
|
|
|
64
64
|
prepare; start; reconfigure; process_exec_commands
|
|
65
65
|
|
|
66
66
|
# shellout to instance specs
|
|
67
|
-
|
|
67
|
+
Runtime::Logger.info('Running Geo primary / secondary specs!')
|
|
68
68
|
|
|
69
69
|
Component::Specs.perform do |specs|
|
|
70
70
|
specs.suite = 'QA::EE::Scenario::Test::Geo'
|
|
@@ -50,7 +50,7 @@ module Gitlab
|
|
|
50
50
|
|
|
51
51
|
gitlab.omnibus_configuration << gitlab_omnibus_configuration
|
|
52
52
|
gitlab.instance do
|
|
53
|
-
|
|
53
|
+
Runtime::Logger.info('Running Gitaly Cluster specs!')
|
|
54
54
|
|
|
55
55
|
if @tag
|
|
56
56
|
rspec_args << "--" unless rspec_args.include?('--')
|
|
@@ -47,7 +47,7 @@ module Gitlab
|
|
|
47
47
|
|
|
48
48
|
retry_count += 1
|
|
49
49
|
wait_seconds = response["retry-after"].to_i
|
|
50
|
-
|
|
50
|
+
Runtime::Logger.debug("Received 429 - Too many requests. Waiting for #{wait_seconds} seconds.")
|
|
51
51
|
sleep wait_seconds
|
|
52
52
|
end
|
|
53
53
|
|
data/lib/gitlab/qa/version.rb
CHANGED
data/lib/gitlab/qa.rb
CHANGED
|
@@ -9,6 +9,7 @@ module Gitlab
|
|
|
9
9
|
autoload :Scenario, 'gitlab/qa/runtime/scenario'
|
|
10
10
|
autoload :TokenFinder, 'gitlab/qa/runtime/token_finder'
|
|
11
11
|
autoload :OmnibusConfiguration, 'gitlab/qa/runtime/omnibus_configuration'
|
|
12
|
+
autoload :Logger, 'gitlab/qa/runtime/logger'
|
|
12
13
|
|
|
13
14
|
module OmnibusConfigurations
|
|
14
15
|
autoload :Default, 'gitlab/qa/runtime/omnibus_configurations/default'
|
|
@@ -73,6 +74,7 @@ module Gitlab
|
|
|
73
74
|
autoload :Registry, 'gitlab/qa/scenario/test/integration/registry'
|
|
74
75
|
autoload :RegistryTLS, 'gitlab/qa/scenario/test/integration/registry_tls'
|
|
75
76
|
autoload :ServicePingDisabled, 'gitlab/qa/scenario/test/integration/service_ping_disabled'
|
|
77
|
+
autoload :CloudActivation, 'gitlab/qa/scenario/test/integration/cloud_activation'
|
|
76
78
|
end
|
|
77
79
|
|
|
78
80
|
module Sanity
|
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: 7.
|
|
4
|
+
version: 7.18.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:
|
|
11
|
+
date: 2022-01-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: climate_control
|
|
@@ -164,6 +164,20 @@ dependencies:
|
|
|
164
164
|
- - "~>"
|
|
165
165
|
- !ruby/object:Gem::Version
|
|
166
166
|
version: '1.10'
|
|
167
|
+
- !ruby/object:Gem::Dependency
|
|
168
|
+
name: rainbow
|
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
|
170
|
+
requirements:
|
|
171
|
+
- - "~>"
|
|
172
|
+
- !ruby/object:Gem::Version
|
|
173
|
+
version: 3.0.0
|
|
174
|
+
type: :runtime
|
|
175
|
+
prerelease: false
|
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
177
|
+
requirements:
|
|
178
|
+
- - "~>"
|
|
179
|
+
- !ruby/object:Gem::Version
|
|
180
|
+
version: 3.0.0
|
|
167
181
|
- !ruby/object:Gem::Dependency
|
|
168
182
|
name: table_print
|
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -266,6 +280,7 @@ files:
|
|
|
266
280
|
- lib/gitlab/qa/reporter.rb
|
|
267
281
|
- lib/gitlab/qa/runner.rb
|
|
268
282
|
- lib/gitlab/qa/runtime/env.rb
|
|
283
|
+
- lib/gitlab/qa/runtime/logger.rb
|
|
269
284
|
- lib/gitlab/qa/runtime/omnibus_configuration.rb
|
|
270
285
|
- lib/gitlab/qa/runtime/omnibus_configurations/default.rb
|
|
271
286
|
- lib/gitlab/qa/runtime/omnibus_configurations/license_mode.rb
|
|
@@ -295,6 +310,7 @@ files:
|
|
|
295
310
|
- lib/gitlab/qa/scenario/test/instance/staging_ref.rb
|
|
296
311
|
- lib/gitlab/qa/scenario/test/integration/actioncable.rb
|
|
297
312
|
- lib/gitlab/qa/scenario/test/integration/client_ssl.rb
|
|
313
|
+
- lib/gitlab/qa/scenario/test/integration/cloud_activation.rb
|
|
298
314
|
- lib/gitlab/qa/scenario/test/integration/elasticsearch.rb
|
|
299
315
|
- lib/gitlab/qa/scenario/test/integration/geo.rb
|
|
300
316
|
- lib/gitlab/qa/scenario/test/integration/gitaly_cluster.rb
|