gitlab-qa 7.9.3 → 7.13.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87fb79561aa8d1d600bbcc8d8bf39de04bd951450b48bc445bf9b479c31f2fc0
4
- data.tar.gz: fd36e810543f04eb94cc8e490ec9851dc56a429a1fb5d5b496795293f9922520
3
+ metadata.gz: f5669f64ddb8066f756cfa50165883c6615a787810e566d19108e71bfc088527
4
+ data.tar.gz: cb0af955d1b67846a9b738b26b90cdd5babc8b8b2ad2b4ed3c70b03513ef0acf
5
5
  SHA512:
6
- metadata.gz: f0935847d3898e27a24fc2552040682aa1782f1da2ab83086983e7d51979468920e26e84a5bac48495d2b683c2d5f2ad869e583807b9dc3295637f2f1a1884cf
7
- data.tar.gz: 873e3ebb9efa18b8b85a197436a10fb5411514228396158fb5dfa250bc7284afee75b01af5c97fd8d57eca2a2e0009b26fef56eae401fe33504c421927d41f6a
6
+ metadata.gz: 74a3906216c1efcffaa0761cefd932d5a06dd68878ca4940eaffd12e80882250cd58b0667ab02546ebeb167afd1b680e2f0a179498a4136dfd05dc2dae1227b8
7
+ data.tar.gz: 85b86bd17e11d3a1cb8a9264c67ebf5be8a59a1c32a094432a53703fd38dadeeb7d6948881a8984a976a16411796f8a1498b8e8b4360152c88b066dde40484df
data/.gitlab-ci.yml CHANGED
@@ -756,13 +756,50 @@ ee:packages-quarantine:
756
756
  GITLAB_QA_OPTIONS_COMBINED: "$GITLAB_QA_OPTIONS --omnibus-config packages"
757
757
  QA_RSPEC_TAGS: "--tag quarantine --tag packages"
758
758
 
759
+ ce:object_storage_registry_tls:
760
+ extends:
761
+ - .test
762
+ - .high-capacity
763
+ - .ce-qa
764
+ - .rspec-report-opts
765
+ variables:
766
+ QA_SCENARIO: "Test::Integration::RegistryTLS --omnibus-config registry_object_storage"
767
+
768
+ ce:object_storage_registry_tls-quarantine:
769
+ extends:
770
+ - .test
771
+ - .high-capacity
772
+ - .ce-qa
773
+ - .quarantine
774
+ - .rspec-report-opts
775
+ variables:
776
+ QA_SCENARIO: "Test::Integration::RegistryTLS --omnibus-config registry_object_storage"
777
+
778
+ ee:object_storage_registry_tls:
779
+ extends:
780
+ - .test
781
+ - .high-capacity
782
+ - .ee-qa
783
+ - .rspec-report-opts
784
+ variables:
785
+ QA_SCENARIO: "Test::Integration::RegistryTLS --omnibus-config registry_object_storage"
786
+
787
+ ee:object_storage_registry_tls-quarantine:
788
+ extends:
789
+ - .test
790
+ - .high-capacity
791
+ - .ee-qa
792
+ - .quarantine
793
+ - .rspec-report-opts
794
+ variables:
795
+ QA_SCENARIO: "Test::Integration::RegistryTLS --omnibus-config registry_object_storage"
796
+
759
797
  ce:registry:
760
798
  extends:
761
799
  - .test
762
800
  - .high-capacity
763
801
  - .ce-qa
764
802
  - .rspec-report-opts
765
- allow_failure: true
766
803
  variables:
767
804
  QA_SCENARIO: "Test::Integration::Registry"
768
805
 
@@ -782,7 +819,6 @@ ee:registry:
782
819
  - .high-capacity
783
820
  - .ee-qa
784
821
  - .rspec-report-opts
785
- allow_failure: true
786
822
  variables:
787
823
  QA_SCENARIO: "Test::Integration::Registry"
788
824
 
@@ -1,5 +1,7 @@
1
1
  # What tests can be run?
2
+
2
3
  [[_TOC_]]
4
+
3
5
  ## The two types of QA tests
4
6
 
5
7
  First of all, the first thing to choose is whether you want to run orchestrated
@@ -245,8 +247,8 @@ instance-level tests against it.
245
247
  To run tests against the GitLab containers, a GitLab QA (`gitlab/gitlab-qa`)
246
248
  container is spun up and tests are run from it by running the `Test::Instance`
247
249
  scenario (located under
248
- [`gitlab-org/gitlab-ce@qa/qa/scenario/test/instance.rb`][test-instance] in the
249
- GitLab CE project).
250
+ [`gitlab-org/gitlab/qa/qa/scenario/test/instance.rb`][test-instance] in the
251
+ GitLab project).
250
252
 
251
253
  Example:
252
254
 
@@ -370,8 +372,8 @@ that LDAP-related features work as expected.
370
372
  To run tests against the GitLab containers, a GitLab QA (`gitlab/gitlab-qa`)
371
373
  container is spun up and tests are run from it by running the
372
374
  `Test::Integration::LDAPNoTLS` scenario (located under
373
- [`gitlab-org/gitlab-ce@qa/qa/scenario/test/integration/ldap_no_tls.rb`][test-integration-ldap-no-tls]
374
- in the GitLab CE project).
375
+ [`gitlab-org/gitlab/qa/qa/scenario/test/integration/ldap_no_tls.rb`][test-integration-ldap-no-tls]
376
+ in the GitLab project).
375
377
 
376
378
  In EE, both the GitLab standard and LDAP credentials are needed:
377
379
 
@@ -393,7 +395,7 @@ $ export EE_LICENSE=$(cat /path/to/Geo.gitlab_license)
393
395
  $ gitlab-qa Test::Integration::LDAPNoTLS EE
394
396
  ```
395
397
 
396
- [test-integration-ldap-no-tls]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/qa/qa/scenario/test/integration/ldap_no_tls.rb
398
+ [test-integration-ldap-no-tls]: https://gitlab.com/gitlab-org/gitlab/blob/master/qa/qa/scenario/test/integration/ldap_no_tls.rb
397
399
 
398
400
  ### `Test::Integration::LDAPTLS CE|EE|<full image address>`
399
401
 
@@ -411,8 +413,8 @@ that LDAP-related features work as expected.
411
413
  To run tests against the GitLab containers, a GitLab QA (`gitlab/gitlab-qa`)
412
414
  container is spun up and tests are run from it by running the
413
415
  `Test::Integration::LDAPTLS` scenario (located under
414
- [`gitlab-org/gitlab-ce@qa/qa/scenario/test/integration/ldap_tls.rb`][test-integration-ldap-tls]
415
- in the GitLab CE project).
416
+ [`gitlab-org/gitlab/qa/qa/scenario/test/integration/ldap_tls.rb`][test-integration-ldap-tls]
417
+ in the GitLab project).
416
418
 
417
419
  In EE, both the GitLab standard and LDAP credentials are needed:
418
420
 
@@ -434,8 +436,8 @@ $ export EE_LICENSE=$(cat /path/to/Geo.gitlab_license)
434
436
  $ gitlab-qa Test::Integration::LDAPTLS EE
435
437
  ```
436
438
 
437
- [test-integration-ldap-tls]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/qa/qa/scenario/test/integration/ldap_tls.rb
438
- [test-integration-ldap-tls-certs]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/tls_certificates/gitlab
439
+ [test-integration-ldap-tls]: https://gitlab.com/gitlab-org/gitlab/blob/master/qa/qa/scenario/test/integration/ldap_tls.rb
440
+ [test-integration-ldap-tls-certs]: https://gitlab.com/gitlab-org/gitlab/blob/master/tls_certificates/gitlab
439
441
 
440
442
  ### `Test::Integration::LDAPNoServer EE|<full image address>`
441
443
 
@@ -504,9 +506,9 @@ using SAML.
504
506
 
505
507
  To run tests against the GitLab containers, a GitLab QA (`gitlab/gitlab-qa`)
506
508
  container is spun up and tests are run from it by running the
507
- `Test::Integration::InstanceSAML` scenario (located under [`gitlab-org/gitlab-ce@qa/qa/scenario/test/integration/instance_saml.rb`][test-integration-instance-saml] in the GitLab CE project).
509
+ `Test::Integration::InstanceSAML` scenario (located under [`gitlab-org/gitlab-ce@qa/qa/scenario/test/integration/instance_saml.rb`][test-integration-instance-saml] in the GitLab project).
508
510
 
509
- [test-integration-instance-saml]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/qa/qa/scenario/test/integration/instance_saml.rb
511
+ [test-integration-instance-saml]: https://gitlab.com/gitlab-org/gitlab/blob/master/qa/qa/scenario/test/integration/instance_saml.rb
510
512
 
511
513
  **Required environment variables:**
512
514
 
@@ -531,8 +533,8 @@ Mattermost server (see `Test::Instance::Image` above).
531
533
  To run tests against the GitLab container, a GitLab QA (`gitlab/gitlab-qa`)
532
534
  container is spun up and tests are run from it by running the
533
535
  `Test::Integration::Mattermost` scenario (located under
534
- [`gitlab-org/gitlab-ce@qa/qa/scenario/test/integration/mattermost.rb`][test-integration-mattermost]
535
- in the GitLab CE project).
536
+ [`gitlab-org/gitlab/qa/qa/scenario/test/integration/mattermost.rb`][test-integration-mattermost]
537
+ in the GitLab project).
536
538
 
537
539
  **Required environment variables:**
538
540
 
@@ -549,7 +551,7 @@ $ export EE_LICENSE=$(cat /path/to/Geo.gitlab_license)
549
551
  $ gitlab-qa Test::Integration::Mattermost EE
550
552
  ```
551
553
 
552
- [test-integration-mattermost]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/qa/qa/scenario/test/integration/mattermost.rb
554
+ [test-integration-mattermost]: https://gitlab.com/gitlab-org/gitlab/blob/master/qa/qa/scenario/test/integration/mattermost.rb
553
555
 
554
556
  ### `Test::Integration::Packages CE|EE|<full image address>`
555
557
 
@@ -668,8 +670,8 @@ against it.
668
670
  To run tests against the GitLab instance, a GitLab QA (`gitlab/gitlab-qa`)
669
671
  container is spun up and tests are run from it by running the
670
672
  `Test::Instance` scenario (located under
671
- [`gitlab-org/gitlab-ce@qa/qa/scenario/test/instance.rb`][test-instance] in the
672
- in the GitLab CE project).
673
+ [`gitlab-org/gitlab/qa/qa/scenario/test/instance.rb`][test-instance] in the
674
+ in the GitLab project).
673
675
 
674
676
  Example:
675
677
 
@@ -695,8 +697,8 @@ works as expected by running tests against it.
695
697
  To run tests against the GitLab instance, a GitLab QA (`gitlab/gitlab-qa`)
696
698
  container is spun up and tests are run from it by running the
697
699
  `Test::Instance` scenario (located under
698
- [`gitlab-org/gitlab-ce@qa/qa/scenario/test/instance.rb`][test-instance] in the
699
- in the GitLab CE project).
700
+ [`gitlab-org/gitlab/qa/qa/scenario/test/instance.rb`][test-instance] in the
701
+ in the GitLab project).
700
702
 
701
703
  **Required environment variables:**
702
704
 
@@ -723,6 +725,42 @@ $ export GITLAB_PASSWORD="$GITLAB_QA_PASSWORD"
723
725
  $ gitlab-qa Test::Instance::Staging
724
726
  ```
725
727
 
728
+ ### `Test::Instance::StagingRef`
729
+
730
+ This scenario tests that the [`Staging Ref`](https://staging-ref.testbed.gitlab.net)
731
+ works as expected by running tests against it.
732
+
733
+ To run tests against the GitLab instance, a GitLab QA (`gitlab/gitlab-qa`)
734
+ container is spun up and tests are run from it by running the
735
+ `Test::Instance` scenario (located under
736
+ [`gitlab-org/gitlab/qa/qa/scenario/test/instance.rb`][test-instance] in the
737
+ in the GitLab project).
738
+
739
+ **Required environment variables:**
740
+
741
+ - `GITLAB_QA_ACCESS_TOKEN`: A valid personal access token with the `api` scope.
742
+ This is used to retrieve the version that staging is currently running.
743
+ Staging Ref QA users credentials can be found in the shared GitLab QA 1Password vault.
744
+
745
+ **Optional environment variables:**
746
+
747
+ - `GITLAB_QA_DEV_ACCESS_TOKEN`: A valid personal access token for the
748
+ `gitlab-qa-bot` on `dev.gitlab.org` with the `registry` scope.
749
+ This is used to pull the QA Docker image from the Omnibus GitLab `dev` Container Registry.
750
+ If the variable isn't present, the QA image from Docker Hub will be used.
751
+ This can be found in the shared GitLab QA 1Password vault.
752
+
753
+ Example:
754
+
755
+ ```
756
+ $ export GITLAB_QA_ACCESS_TOKEN=your_api_access_token
757
+ $ export GITLAB_QA_DEV_ACCESS_TOKEN=your_dev_registry_access_token
758
+ $ export GITLAB_USERNAME="gitlab-qa"
759
+ $ export GITLAB_PASSWORD="$GITLAB_QA_PASSWORD"
760
+
761
+ $ gitlab-qa Test::Instance::StagingRef
762
+ ```
763
+
726
764
  ### `Test::Instance::StagingGeo`
727
765
 
728
766
  This scenario tests that the Geo staging deployment (with [`staging.gitlab.com`](https://staging.gitlab.com) as the primary site and [`geo.staging.gitlab.com`](https://geo.staging.gitlab.com) as the secondary site) works as expected by running tests tagged `:geo` against it. This is done by spinning up a GitLab QA (`gitlab/gitlab-qa`) container and running the `QA::EE::Scenario::Test::Geo` scenario. Note that the Geo setup steps in the `QA::EE::Scenario::Test::Geo` scenario are skipped when testing a live Geo deployment.
@@ -789,8 +827,8 @@ Smoke tests are quick tests that ensure that some basic functionality of GitLab
789
827
  To run tests against the GitLab instance, a GitLab QA (`gitlab/gitlab-qa`)
790
828
  container is spun up and tests are run from it by running the
791
829
  `Test::Instance::Smoke` scenario (located under
792
- [`gitlab-org/gitlab-ce@qa/qa/scenario/test/smoke.rb`][smoke-instance] in the
793
- in the GitLab CE project).
830
+ [`gitlab-org/gitlab/qa/qa/scenario/test/smoke.rb`][smoke-instance] in the
831
+ in the GitLab project).
794
832
 
795
833
  Example:
796
834
 
@@ -863,5 +901,5 @@ $ gitlab-qa Test::Instance::Geo EE https://primary.gitlab.com https://secondary.
863
901
 
864
902
  [Back to README.md](../README.md)
865
903
 
866
- [test-instance]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/qa/qa/scenario/test/instance/all.rb
867
- [smoke-instance]: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/qa/qa/scenario/test/instance/smoke.rb
904
+ [test-instance]: https://gitlab.com/gitlab-org/gitlab/blob/master/qa/qa/scenario/test/instance/all.rb
905
+ [smoke-instance]: https://gitlab.com/gitlab-org/gitlab/blob/master/qa/qa/scenario/test/instance/smoke.rb
@@ -1,7 +1,3 @@
1
- require 'net/http'
2
- require 'json'
3
- require 'uri'
4
-
5
1
  module Gitlab
6
2
  module QA
7
3
  module Component
@@ -1,7 +1,3 @@
1
- require 'net/http'
2
- require 'json'
3
- require 'uri'
4
-
5
1
  module Gitlab
6
2
  module QA
7
3
  module Component
@@ -1,7 +1,3 @@
1
- require 'net/http'
2
- require 'json'
3
- require 'uri'
4
-
5
1
  module Gitlab
6
2
  module QA
7
3
  module Component
@@ -0,0 +1,9 @@
1
+ module Gitlab
2
+ module QA
3
+ module Component
4
+ class StagingRef < Staging
5
+ ADDRESS = 'https://staging-ref.testbed.gitlab.net'.freeze
6
+ end
7
+ end
8
+ end
9
+ end
@@ -113,7 +113,7 @@ module Gitlab
113
113
  "found:#{pipeline}.gitlab.com"
114
114
  when 'preprod'
115
115
  'found:pre.gitlab.com'
116
- when 'staging-orchestrated', 'nightly', QA::Runtime::Env.default_branch
116
+ when 'staging-orchestrated', 'nightly', QA::Runtime::Env.default_branch, 'staging-ref'
117
117
  "found:#{pipeline}"
118
118
  else
119
119
  raise "No `found:*` label for the `#{pipeline}` pipeline!"
@@ -49,6 +49,9 @@ module Gitlab
49
49
  'GITLAB_SANDBOX_NAME' => :gitlab_sandbox_name,
50
50
  'GITLAB_QA_ACCESS_TOKEN' => :qa_access_token,
51
51
  'GITLAB_QA_ADMIN_ACCESS_TOKEN' => :qa_admin_access_token,
52
+ 'GITLAB_QA_DEV_ACCESS_TOKEN' => :qa_dev_access_token,
53
+ 'GITLAB_QA_CONTAINER_REGISTRY_ACCESS_TOKEN' => :qa_container_registry_access_token,
54
+ 'GITLAB_QA_ISSUE_URL' => :qa_issue_url,
52
55
  'GITHUB_ACCESS_TOKEN' => :github_access_token,
53
56
  'GITLAB_URL' => :gitlab_url,
54
57
  'SIMPLE_SAML_HOSTNAME' => :simple_saml_hostname,
@@ -60,6 +63,7 @@ module Gitlab
60
63
  'CLOUDSDK_CORE_PROJECT' => :cloudsdk_core_project,
61
64
  'GCLOUD_REGION' => :gcloud_region,
62
65
  'SIGNUP_DISABLED' => :signup_disabled,
66
+ 'GITLAB_CI_API_TOKEN' => :gitlab_ci_api_token,
63
67
  'GITLAB_QA_USERNAME_1' => :gitlab_qa_username_1,
64
68
  'GITLAB_QA_PASSWORD_1' => :gitlab_qa_password_1,
65
69
  'GITLAB_QA_USERNAME_2' => :gitlab_qa_username_2,
@@ -71,17 +75,24 @@ module Gitlab
71
75
  'KNAPSACK_TEST_FILE_PATTERN' => :knapsack_test_file_pattern,
72
76
  'KNAPSACK_TEST_DIR' => :knapsack_test_dir,
73
77
  'CI' => :ci,
78
+ 'CI_COMMIT_REF_NAME' => :ci_commit_ref_name,
74
79
  'CI_JOB_NAME' => :ci_job_name,
75
80
  'CI_JOB_URL' => :ci_job_url,
81
+ 'CI_JOB_TOKEN' => :ci_job_token,
76
82
  'CI_RUNNER_ID' => :ci_runner_id,
77
83
  'CI_SERVER_HOST' => :ci_server_host,
78
84
  'CI_SERVER_PERSONAL_ACCESS_TOKEN' => :ci_server_personal_access_token,
79
85
  'CI_NODE_INDEX' => :ci_node_index,
80
86
  'CI_NODE_TOTAL' => :ci_node_total,
87
+ 'CI_PROJECT_ID' => :ci_project_id,
81
88
  'CI_PROJECT_NAME' => :ci_project_name,
82
89
  'CI_SLACK_WEBHOOK_URL' => :ci_slack_webhook_url,
90
+ 'CI_PIPELINE_ID' => :ci_pipeline_id,
91
+ 'CI_PIPELINE_SOURCE' => :ci_pipeline_source,
92
+ 'CI_PIPELINE_URL' => :ci_pipeline_url,
83
93
  'CI_PIPELINE_CREATED_AT' => :ci_pipeline_created_at,
84
94
  'CI_MERGE_REQUEST_IID' => :ci_merge_request_iid,
95
+ 'CI_API_V4_URL' => :ci_api_v4_url,
85
96
  'GITLAB_CI' => :gitlab_ci,
86
97
  'ELASTIC_URL' => :elastic_url,
87
98
  'GITLAB_QA_LOOP_RUNNER_MINUTES' => :gitlab_qa_loop_runner_minutes,
@@ -108,20 +119,32 @@ module Gitlab
108
119
  'GOOGLE_PROJECT' => :google_project,
109
120
  'GOOGLE_CLIENT_EMAIL' => :google_client_email,
110
121
  'GOOGLE_JSON_KEY' => :google_json_key,
111
- 'GCS_BUCKET_NAME' => :gcs_bucket_name
122
+ 'GCS_BUCKET_NAME' => :gcs_bucket_name,
123
+ 'SMOKE_ONLY' => :smoke_only,
124
+ 'NO_ADMIN' => :no_admin
112
125
  }.freeze
113
126
 
114
127
  ENV_VARIABLES.each do |env_name, method_name|
115
128
  attr_writer(method_name)
116
129
 
117
130
  define_method(method_name) do
118
- ENV[env_name] ||
119
- if instance_variable_defined?("@#{method_name}")
120
- instance_variable_get("@#{method_name}")
121
- end
131
+ ENV[env_name] || (instance_variable_get("@#{method_name}") if instance_variable_defined?("@#{method_name}"))
122
132
  end
123
133
  end
124
134
 
135
+ def variables
136
+ vars = {}
137
+
138
+ ENV_VARIABLES.each do |name, attribute|
139
+ # Variables that are overridden in the environment take precedence
140
+ # over the defaults specified by the QA runtime.
141
+ value = env_value_if_defined(name) || send(attribute) # rubocop:disable GitlabSecurity/PublicSend
142
+ vars[name] = value if value
143
+ end
144
+
145
+ vars
146
+ end
147
+
125
148
  def default_branch
126
149
  ENV['QA_DEFAULT_BRANCH'] || 'main'
127
150
  end
@@ -142,42 +165,6 @@ module Gitlab
142
165
  ENV['GITLAB_API_BASE'] || 'https://gitlab.com/api/v4'
143
166
  end
144
167
 
145
- def gitlab_ci_api_token
146
- ENV['GITLAB_CI_API_TOKEN']
147
- end
148
-
149
- def ci_api_v4_url
150
- ENV['CI_API_V4_URL']
151
- end
152
-
153
- def ci_job_name
154
- ENV['CI_JOB_NAME']
155
- end
156
-
157
- def ci_job_token
158
- ENV['CI_JOB_TOKEN']
159
- end
160
-
161
- def ci_pipeline_source
162
- ENV['CI_PIPELINE_SOURCE']
163
- end
164
-
165
- def ci_pipeline_url
166
- ENV['CI_PIPELINE_URL']
167
- end
168
-
169
- def ci_pipeline_id
170
- ENV['CI_PIPELINE_ID']
171
- end
172
-
173
- def ci_project_id
174
- ENV['CI_PROJECT_ID']
175
- end
176
-
177
- def ci_commit_ref_name
178
- ENV['CI_COMMIT_REF_NAME']
179
- end
180
-
181
168
  def pipeline_from_project_name
182
169
  if ci_project_name.to_s.start_with?('gitlab-qa')
183
170
  if ENV['TOP_UPSTREAM_SOURCE_JOB'].to_s.start_with?('https://ops.gitlab.net')
@@ -198,22 +185,10 @@ module Gitlab
198
185
  env_value_if_defined('GITLAB_QA_DEV_ACCESS_TOKEN')
199
186
  end
200
187
 
201
- def qa_dev_access_token
202
- ENV['GITLAB_QA_DEV_ACCESS_TOKEN']
203
- end
204
-
205
188
  def initial_root_password
206
189
  ENV['GITLAB_INITIAL_ROOT_PASSWORD'] || '5iveL!fe'
207
190
  end
208
191
 
209
- def qa_container_registry_access_token
210
- ENV['GITLAB_QA_CONTAINER_REGISTRY_ACCESS_TOKEN']
211
- end
212
-
213
- def qa_issue_url
214
- ENV['GITLAB_QA_ISSUE_URL']
215
- end
216
-
217
192
  def deploy_environment
218
193
  ENV['DEPLOY_ENVIRONMENT'] || pipeline_from_project_name
219
194
  end
@@ -226,35 +201,6 @@ module Gitlab
226
201
  ENV['ELASTIC_VERSION'] || '6.4.2'.freeze
227
202
  end
228
203
 
229
- def aws_s3_region
230
- ENV['AWS_S3_REGION']
231
- end
232
-
233
- def aws_s3_key_id
234
- ENV['AWS_S3_KEY_ID']
235
- end
236
-
237
- def aws_s3_access_key
238
- ENV['AWS_S3_ACCESS_KEY']
239
- end
240
-
241
- def aws_s3_bucket_name
242
- ENV['AWS_S3_BUCKET_NAME']
243
- end
244
-
245
- def variables
246
- vars = {}
247
-
248
- ENV_VARIABLES.each do |name, attribute|
249
- # Variables that are overridden in the environment take precedence
250
- # over the defaults specified by the QA runtime.
251
- value = env_value_if_defined(name) || send(attribute) # rubocop:disable GitlabSecurity/PublicSend
252
- vars[name] = value if value
253
- end
254
-
255
- vars
256
- end
257
-
258
204
  def require_license!
259
205
  return if ENV.include?('EE_LICENSE')
260
206
 
@@ -293,31 +239,42 @@ module Gitlab
293
239
 
294
240
  def require_kubernetes_environment!
295
241
  %w[GCLOUD_ACCOUNT_EMAIL GCLOUD_ACCOUNT_KEY CLOUDSDK_CORE_PROJECT].each do |env_key|
296
- raise ArgumentError, "Environment variable #{env_key} must be set to run kubernetes specs" unless ENV.key?(env_key)
242
+ unless ENV.key?(env_key)
243
+ raise ArgumentError, "Environment variable #{env_key} must be set to run kubernetes specs"
244
+ end
297
245
  end
298
246
  end
299
247
 
300
248
  def require_aws_s3_environment!
301
249
  %w[AWS_S3_REGION AWS_S3_KEY_ID AWS_S3_ACCESS_KEY AWS_S3_BUCKET_NAME].each do |env_key|
302
- raise ArgumentError, "Environment variable #{env_key} must be set to run AWS S3 object storage specs" unless ENV.key?(env_key)
250
+ unless ENV.key?(env_key)
251
+ raise ArgumentError, "Environment variable #{env_key} must be set to run AWS S3 object storage specs"
252
+ end
303
253
  end
304
254
  end
305
255
 
306
256
  def require_gcs_environment!
307
257
  %w[GOOGLE_PROJECT GOOGLE_CLIENT_EMAIL GOOGLE_JSON_KEY GCS_BUCKET_NAME].each do |env_key|
308
- raise ArgumentError, "Environment variable #{env_key} must be set to run GCS object storage specs" unless ENV.key?(env_key)
258
+ unless ENV.key?(env_key)
259
+ raise ArgumentError, "Environment variable #{env_key} must be set to run GCS object storage specs"
260
+ end
309
261
  end
310
262
  end
311
263
 
312
264
  def require_initial_password!
313
265
  return unless ENV['GITLAB_INITIAL_ROOT_PASSWORD'].to_s.strip.empty?
314
266
 
315
- raise ArgumentError, "Environment variable GITLAB_INITIAL_ROOT_PASSWORD must be provided to set an initial root password."
267
+ raise(
268
+ ArgumentError,
269
+ "Environment variable GITLAB_INITIAL_ROOT_PASSWORD must be provided to set an initial root password."
270
+ )
316
271
  end
317
272
 
318
273
  def require_ssh_tunnel!
319
274
  %w[TUNNEL_SSH_PRIVATE_KEY TUNNEL_SERVER_HOSTNAME TUNNEL_SSH_USER].each do |env_key|
320
- raise ArgumentError, "Environment variable #{env_key} must be set to run tunnel specs" unless ENV.key?(env_key)
275
+ unless ENV.key?(env_key)
276
+ raise ArgumentError, "Environment variable #{env_key} must be set to run tunnel specs"
277
+ end
321
278
  end
322
279
  end
323
280
 
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Gitlab
4
+ module QA
5
+ module Runtime
6
+ module OmnibusConfigurations
7
+ class RegistryObjectStorage < Default
8
+ def configuration
9
+ Runtime::Env.require_aws_s3_environment!
10
+
11
+ <<~OMNIBUS
12
+ registry['storage'] = { 's3' => { 'accesskey' => '#{Runtime::Env.aws_s3_key_id}', 'secretkey' => '#{Runtime::Env.aws_s3_access_key}', 'bucket' => '#{Runtime::Env.aws_s3_bucket_name}', 'region' => '#{Runtime::Env.aws_s3_region}' } }
13
+ OMNIBUS
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,18 @@
1
+ module Gitlab
2
+ module QA
3
+ module Scenario
4
+ module Test
5
+ module Instance
6
+ ##
7
+ # Run test suite against Staging Ref environment
8
+ #
9
+ class StagingRef < DeploymentBase
10
+ def deployment_component
11
+ Component::StagingRef
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -99,6 +99,7 @@ module Gitlab
99
99
  praefect['listen_addr'] = '0.0.0.0:2305';
100
100
  praefect['prometheus_listen_addr'] = '0.0.0.0:9652';
101
101
  praefect['auth_token'] = 'PRAEFECT_EXTERNAL_TOKEN';
102
+ praefect['reconciliation_scheduling_interval'] = '10s';
102
103
  praefect['database_host'] = '#{@database}.#{@network}';
103
104
  praefect['database_user'] = 'postgres';
104
105
  praefect['database_port'] = 5432;
@@ -11,19 +11,10 @@ module Gitlab
11
11
  gitlab.release = release
12
12
  gitlab.network = 'test'
13
13
  gitlab.name = 'gitlab'
14
- gitlab.tls = true
15
14
 
16
15
  gitlab.omnibus_configuration << <<~OMNIBUS
17
- external_url 'https://#{gitlab.name}.#{gitlab.network}';
18
- registry_external_url 'https://#{gitlab.name}.#{gitlab.network}:5050';
19
-
20
- letsencrypt['enable'] = false;
21
-
22
- nginx['redirect_http_to_https'] = true;
23
- nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.test.crt";
24
- nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.test.key";
25
- registry_nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.test.crt";
26
- registry_nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.test.key";
16
+ external_url 'http://#{gitlab.name}.#{gitlab.network}';
17
+ registry_external_url 'http://#{gitlab.name}.#{gitlab.network}:5050';
27
18
  OMNIBUS
28
19
 
29
20
  gitlab.instance do
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Gitlab
4
+ module QA
5
+ module Scenario
6
+ module Test
7
+ module Integration
8
+ class RegistryTLS < Scenario::Template
9
+ def perform(release, *rspec_args)
10
+ Component::Gitlab.perform do |gitlab|
11
+ gitlab.release = release
12
+ gitlab.network = 'test'
13
+ gitlab.name = 'gitlab'
14
+ gitlab.tls = true
15
+
16
+ gitlab.omnibus_configuration << <<~OMNIBUS
17
+ external_url 'https://#{gitlab.name}.#{gitlab.network}';
18
+ registry_external_url 'https://#{gitlab.name}.#{gitlab.network}:5050';
19
+
20
+ letsencrypt['enable'] = false;
21
+
22
+ nginx['redirect_http_to_https'] = true;
23
+ nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.test.crt";
24
+ nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.test.key";
25
+ registry_nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.test.crt";
26
+ registry_nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.test.key";
27
+ OMNIBUS
28
+
29
+ gitlab.instance do
30
+ Component::Specs.perform do |specs|
31
+ specs.suite = 'Test::Integration::RegistryTLS'
32
+ specs.release = gitlab.release
33
+ specs.network = gitlab.network
34
+ specs.args = [gitlab.address, *rspec_args]
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -13,10 +13,11 @@ module Gitlab
13
13
  end
14
14
 
15
15
  def execute!
16
- response =
16
+ response = with_retry_on_too_many_requests do
17
17
  Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
18
18
  http.request(build_request)
19
19
  end
20
+ end
20
21
 
21
22
  case response
22
23
  when Net::HTTPSuccess
@@ -34,6 +35,24 @@ module Gitlab
34
35
  req['Cookie'] = ENV['QA_COOKIES'] if ENV['QA_COOKIES']
35
36
  end
36
37
  end
38
+
39
+ def with_retry_on_too_many_requests
40
+ response = nil
41
+ retry_count = 0
42
+
43
+ while retry_count < 3
44
+ response = yield
45
+
46
+ break unless response.is_a?(Net::HTTPTooManyRequests)
47
+
48
+ retry_count += 1
49
+ wait_seconds = response["retry-after"].to_i
50
+ puts "Received 429 - Too many requests. Waiting for #{wait_seconds} seconds."
51
+ sleep wait_seconds
52
+ end
53
+
54
+ response
55
+ end
37
56
  end
38
57
  end
39
58
  end
@@ -1,5 +1,5 @@
1
1
  module Gitlab
2
2
  module QA
3
- VERSION = '7.9.3'.freeze
3
+ VERSION = '7.13.0'.freeze
4
4
  end
5
5
  end
data/lib/gitlab/qa.rb CHANGED
@@ -17,6 +17,7 @@ module Gitlab
17
17
  autoload :ObjectStorageAws, 'gitlab/qa/runtime/omnibus_configurations/object_storage_aws'
18
18
  autoload :ObjectStorageGcs, 'gitlab/qa/runtime/omnibus_configurations/object_storage_gcs'
19
19
  autoload :LicenseMode, 'gitlab/qa/runtime/omnibus_configurations/license_mode'
20
+ autoload :RegistryObjectStorage, 'gitlab/qa/runtime/omnibus_configurations/registry_object_storage'
20
21
  end
21
22
  end
22
23
 
@@ -33,6 +34,7 @@ module Gitlab
33
34
  autoload :RelativeUrl, 'gitlab/qa/scenario/test/instance/relative_url'
34
35
  autoload :RepositoryStorage, 'gitlab/qa/scenario/test/instance/repository_storage'
35
36
  autoload :Staging, 'gitlab/qa/scenario/test/instance/staging'
37
+ autoload :StagingRef, 'gitlab/qa/scenario/test/instance/staging_ref'
36
38
  autoload :Production, 'gitlab/qa/scenario/test/instance/production'
37
39
  autoload :Smoke, 'gitlab/qa/scenario/test/instance/smoke'
38
40
  autoload :Preprod, 'gitlab/qa/scenario/test/instance/preprod'
@@ -69,6 +71,7 @@ module Gitlab
69
71
  autoload :MTLS, 'gitlab/qa/scenario/test/integration/mtls'
70
72
  autoload :ClientSSL, 'gitlab/qa/scenario/test/integration/client_ssl'
71
73
  autoload :Registry, 'gitlab/qa/scenario/test/integration/registry'
74
+ autoload :RegistryTLS, 'gitlab/qa/scenario/test/integration/registry_tls'
72
75
  end
73
76
 
74
77
  module Sanity
@@ -85,6 +88,7 @@ module Gitlab
85
88
  autoload :SAML, 'gitlab/qa/component/saml'
86
89
  autoload :Specs, 'gitlab/qa/component/specs'
87
90
  autoload :Staging, 'gitlab/qa/component/staging'
91
+ autoload :StagingRef, 'gitlab/qa/component/staging_ref'
88
92
  autoload :Production, 'gitlab/qa/component/production'
89
93
  autoload :Minio, 'gitlab/qa/component/minio'
90
94
  autoload :Preprod, 'gitlab/qa/component/preprod'
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.9.3
4
+ version: 7.13.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: 2021-09-27 00:00:00.000000000 Z
11
+ date: 2021-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control
@@ -240,6 +240,7 @@ files:
240
240
  - lib/gitlab/qa/component/saml.rb
241
241
  - lib/gitlab/qa/component/specs.rb
242
242
  - lib/gitlab/qa/component/staging.rb
243
+ - lib/gitlab/qa/component/staging_ref.rb
243
244
  - lib/gitlab/qa/docker/command.rb
244
245
  - lib/gitlab/qa/docker/engine.rb
245
246
  - lib/gitlab/qa/docker/shellout.rb
@@ -268,6 +269,7 @@ files:
268
269
  - lib/gitlab/qa/runtime/omnibus_configurations/object_storage_aws.rb
269
270
  - lib/gitlab/qa/runtime/omnibus_configurations/object_storage_gcs.rb
270
271
  - lib/gitlab/qa/runtime/omnibus_configurations/packages.rb
272
+ - lib/gitlab/qa/runtime/omnibus_configurations/registry_object_storage.rb
271
273
  - lib/gitlab/qa/runtime/scenario.rb
272
274
  - lib/gitlab/qa/runtime/token_finder.rb
273
275
  - lib/gitlab/qa/scenario/actable.rb
@@ -286,6 +288,7 @@ files:
286
288
  - lib/gitlab/qa/scenario/test/instance/smoke.rb
287
289
  - lib/gitlab/qa/scenario/test/instance/staging.rb
288
290
  - lib/gitlab/qa/scenario/test/instance/staging_geo.rb
291
+ - lib/gitlab/qa/scenario/test/instance/staging_ref.rb
289
292
  - lib/gitlab/qa/scenario/test/integration/actioncable.rb
290
293
  - lib/gitlab/qa/scenario/test/integration/client_ssl.rb
291
294
  - lib/gitlab/qa/scenario/test/integration/elasticsearch.rb
@@ -303,6 +306,7 @@ files:
303
306
  - lib/gitlab/qa/scenario/test/integration/mtls.rb
304
307
  - lib/gitlab/qa/scenario/test/integration/praefect.rb
305
308
  - lib/gitlab/qa/scenario/test/integration/registry.rb
309
+ - lib/gitlab/qa/scenario/test/integration/registry_tls.rb
306
310
  - lib/gitlab/qa/scenario/test/integration/saml.rb
307
311
  - lib/gitlab/qa/scenario/test/integration/smtp.rb
308
312
  - lib/gitlab/qa/scenario/test/integration/ssh_tunnel.rb