gitlab-qa 7.35.0 → 8.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68c6a21ac204323088f26d992fcff4a19a0a75af7f261a2d4b078a88aa0c5b92
4
- data.tar.gz: 7f652f956d82d0523d9415d010330852846a6dd764e70b5156922cabc93cffe5
3
+ metadata.gz: d9b328348db20338194b52a69ad58985c4f48bfec8b9a7989b44a1840c6d27d2
4
+ data.tar.gz: 11aaf09daf2aac04f0f06e626087230b959ee68eba236c516ae4ce28df808817
5
5
  SHA512:
6
- metadata.gz: f59a52bfc23267353912547e351fc05a557f376326231ed98fa02f7799687276aab15ae99e773236673be64cb7a941bf6f73f0456bcea8cce25a667923291bb3
7
- data.tar.gz: fa0037200819c8ed810551fcabf9566a1776e217773ca4e1410f1b9577dd80b6ebd98f578c6d29786b21883aec8dca73717d8b42bb9e77a5aa4ee73ed6a3409d
6
+ metadata.gz: bd385edcc561ad24faf5cba3b3e8ed28ff444b3b801224657c3bfd425a759c4eb39a0090e9425dedba48b0c20be6ed6a9624e41e06e304bb929c1a1b2905f30c
7
+ data.tar.gz: d5b8fd24b8f23e8f9bc291c626261f200f54795df0ea613bca59a59e63c34779842657954f6a52b53c92fe466e203ff2aefa0c0501cef8e120ed4c3cd33acd6a
@@ -1,7 +1,4 @@
1
1
  ee:cloud-activation:
2
- before_script:
3
- - unset EE_LICENSE
4
- - !reference [default, before_script]
5
2
  extends:
6
3
  - .rules:ee-never-when-triggered-by-feature-flag-definition-change
7
4
  - .test
@@ -14,9 +11,6 @@ ee:cloud-activation:
14
11
  GITLAB_QA_OPTIONS_COMBINED: "$GITLAB_QA_OPTIONS --seed-db license*.rb"
15
12
 
16
13
  ee:cloud-activation-quarantine:
17
- before_script:
18
- - unset EE_LICENSE
19
- - !reference [default, before_script]
20
14
  extends:
21
15
  - .rules:ee-never-when-triggered-by-feature-flag-definition-change
22
16
  - .test
@@ -0,0 +1,20 @@
1
+ ee:opensearch:
2
+ extends:
3
+ - .rules:ee-never-when-triggered-by-feature-flag-definition-change
4
+ - .test
5
+ - .high-capacity
6
+ - .ee-variables
7
+ - .rspec-report-opts
8
+ variables:
9
+ QA_SCENARIO: "Test::Integration::Opensearch"
10
+
11
+ ee:opensearch-quarantine:
12
+ extends:
13
+ - .rules:ee-never-when-triggered-by-feature-flag-definition-change
14
+ - .test
15
+ - .high-capacity
16
+ - .ee-variables
17
+ - .quarantine
18
+ - .rspec-report-opts
19
+ variables:
20
+ QA_SCENARIO: "Test::Integration::Opensearch"
data/.rubocop_todo.yml CHANGED
@@ -1,22 +1,21 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2021-09-17 06:55:33 UTC using RuboCop version 0.93.1.
3
+ # on 2022-06-21 18:16:41 UTC using RuboCop version 0.93.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 165
9
+ # Offense count: 199
10
10
  # Cop supports --auto-correct.
11
11
  CodeReuse/ActiveRecord:
12
12
  Enabled: false
13
13
 
14
- # Offense count: 2
14
+ # Offense count: 1
15
15
  # Cop supports --auto-correct.
16
16
  Cop/LineBreakAroundConditionalBlock:
17
17
  Exclude:
18
18
  - 'lib/gitlab/qa/release.rb'
19
- - 'lib/gitlab/qa/runtime/env.rb'
20
19
 
21
20
  # Offense count: 1
22
21
  # Configuration parameters: Include.
@@ -44,10 +43,10 @@ Lint/RedundantCopDisableDirective:
44
43
  - 'lib/gitlab/qa/component/staging.rb'
45
44
  - 'lib/gitlab/qa/runtime/scenario.rb'
46
45
 
47
- # Offense count: 10
46
+ # Offense count: 21
48
47
  # Configuration parameters: IgnoredMethods.
49
48
  Metrics/AbcSize:
50
- Max: 26
49
+ Max: 60
51
50
  IgnoredMethods:
52
51
  - perform
53
52
 
@@ -58,24 +57,11 @@ Naming/RescuedExceptionsVariableName:
58
57
  Exclude:
59
58
  - 'lib/gitlab/qa/component/staging.rb'
60
59
 
61
- # Offense count: 1
62
- # Cop supports --auto-correct.
63
- Performance/RegexpMatch:
64
- Exclude:
65
- - 'lib/gitlab/qa/component/gitlab.rb'
66
-
67
- # Offense count: 1
68
- # Cop supports --auto-correct.
69
- # Configuration parameters: AutoCorrect.
70
- Performance/StringInclude:
71
- Exclude:
72
- - 'lib/gitlab/qa/component/gitlab.rb'
73
-
74
60
  # Offense count: 3
75
61
  # Cop supports --auto-correct.
76
62
  RSpec/EmptyLineAfterLetBlock:
77
63
  Exclude:
78
- - 'spec/gitlab/qa/support/dev_eeqa_image_spec.rb'
64
+ - 'spec/gitlab/qa/support/dev_ee_qa_image_spec.rb'
79
65
 
80
66
  # Offense count: 4
81
67
  # Cop supports --auto-correct.
@@ -84,6 +70,12 @@ RSpec/ExampleWording:
84
70
  Exclude:
85
71
  - 'spec/gitlab/qa/component/gitlab_spec.rb'
86
72
 
73
+ # Offense count: 1
74
+ # Configuration parameters: CustomTransform, IgnoreMethods, SpecSuffixOnly.
75
+ RSpec/FilePath:
76
+ Exclude:
77
+ - 'spec/gitlab/qa/support/dev_ee_qa_image_spec.rb'
78
+
87
79
  # Offense count: 2
88
80
  RSpec/LeakyConstantDeclaration:
89
81
  Exclude:
@@ -107,7 +99,7 @@ Style/HashTransformation:
107
99
  Exclude:
108
100
  - 'lib/gitlab/qa/docker/volumes.rb'
109
101
 
110
- # Offense count: 3
102
+ # Offense count: 8
111
103
  # Cop supports --auto-correct.
112
104
  Style/IfUnlessModifier:
113
105
  Exclude:
@@ -147,9 +139,9 @@ Style/StringConcatenation:
147
139
  Exclude:
148
140
  - 'lib/gitlab/qa/reporter.rb'
149
141
 
150
- # Offense count: 126
142
+ # Offense count: 191
151
143
  # Cop supports --auto-correct.
152
144
  # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
153
145
  # URISchemes: http, https
154
146
  Layout/LineLength:
155
- Max: 192
147
+ Max: 189
data/Gemfile.lock CHANGED
@@ -1,18 +1,19 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab-qa (7.35.0)
4
+ gitlab-qa (8.1.0)
5
5
  activesupport (~> 6.1)
6
6
  gitlab (~> 4.18.0)
7
7
  http (~> 5.0)
8
8
  nokogiri (~> 1.10)
9
9
  rainbow (~> 3.0.0)
10
10
  table_print (= 1.5.7)
11
+ zeitwerk (~> 2.4)
11
12
 
12
13
  GEM
13
14
  remote: https://rubygems.org/
14
15
  specs:
15
- activesupport (6.1.6)
16
+ activesupport (6.1.6.1)
16
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
17
18
  i18n (>= 1.6, < 2)
18
19
  minitest (>= 5.1)
@@ -71,11 +72,11 @@ GEM
71
72
  faraday-em_http (1.0.0)
72
73
  faraday-em_synchrony (1.0.0)
73
74
  faraday-excon (1.1.0)
74
- faraday-http-cache (2.2.0)
75
+ faraday-http-cache (2.4.0)
75
76
  faraday (>= 0.8)
76
77
  faraday-httpclient (1.0.1)
77
- faraday-multipart (1.0.3)
78
- multipart-post (>= 1.2, < 3)
78
+ faraday-multipart (1.0.4)
79
+ multipart-post (~> 2)
79
80
  faraday-net_http (1.0.1)
80
81
  faraday-net_http_persistent (1.2.0)
81
82
  faraday-patron (1.0.0)
@@ -100,7 +101,7 @@ GEM
100
101
  rubocop-rails (~> 2.9)
101
102
  rubocop-rspec (~> 1.44)
102
103
  hashdiff (1.0.1)
103
- http (5.0.4)
104
+ http (5.1.0)
104
105
  addressable (~> 2.8)
105
106
  http-cookie (~> 1.0)
106
107
  http-form_data (~> 2.2)
@@ -111,7 +112,7 @@ GEM
111
112
  httparty (0.20.0)
112
113
  mime-types (~> 3.0)
113
114
  multi_xml (>= 0.5.2)
114
- i18n (1.10.0)
115
+ i18n (1.12.0)
115
116
  concurrent-ruby (~> 1.0)
116
117
  jaro_winkler (1.5.4)
117
118
  kramdown (2.4.0)
@@ -126,17 +127,17 @@ GEM
126
127
  mime-types-data (~> 3.2015)
127
128
  mime-types-data (3.2022.0105)
128
129
  mini_portile2 (2.8.0)
129
- minitest (5.15.0)
130
+ minitest (5.16.2)
130
131
  multi_xml (0.6.0)
131
- multipart-post (2.1.1)
132
+ multipart-post (2.2.3)
132
133
  nap (1.1.0)
133
134
  no_proxy_fix (0.1.2)
134
- nokogiri (1.13.6)
135
+ nokogiri (1.13.8)
135
136
  mini_portile2 (~> 2.8.0)
136
137
  racc (~> 1.4)
137
- octokit (4.22.0)
138
- faraday (>= 0.9)
139
- sawyer (~> 0.8.0, >= 0.5.3)
138
+ octokit (4.25.1)
139
+ faraday (>= 1, < 3)
140
+ sawyer (~> 0.9)
140
141
  open4 (1.3.4)
141
142
  parallel (1.22.1)
142
143
  parser (3.1.2.0)
@@ -146,11 +147,11 @@ GEM
146
147
  method_source (~> 1.0)
147
148
  public_suffix (4.0.7)
148
149
  racc (1.6.0)
149
- rack (2.2.3)
150
+ rack (2.2.4)
150
151
  rainbow (3.0.0)
151
152
  rake (13.0.6)
152
153
  rchardet (1.8.0)
153
- regexp_parser (2.4.0)
154
+ regexp_parser (2.5.0)
154
155
  reverse_markdown (2.1.1)
155
156
  nokogiri
156
157
  rexml (3.2.5)
@@ -176,7 +177,7 @@ GEM
176
177
  rubocop-ast (>= 0.6.0)
177
178
  ruby-progressbar (~> 1.7)
178
179
  unicode-display_width (>= 1.4.0, < 2.0)
179
- rubocop-ast (1.18.0)
180
+ rubocop-ast (1.19.1)
180
181
  parser (>= 3.1.1.0)
181
182
  rubocop-gitlab-security (0.1.1)
182
183
  rubocop (>= 0.51)
@@ -192,9 +193,9 @@ GEM
192
193
  rubocop-ast (>= 0.7.1)
193
194
  ruby-progressbar (1.11.0)
194
195
  ruby2_keywords (0.0.5)
195
- sawyer (0.8.2)
196
+ sawyer (0.9.2)
196
197
  addressable (>= 2.3.5)
197
- faraday (> 0.8, < 2.0)
198
+ faraday (>= 0.17.3, < 3)
198
199
  solargraph (0.45.0)
199
200
  backport (~> 1.2)
200
201
  benchmark
@@ -214,8 +215,8 @@ GEM
214
215
  terminal-table (3.0.2)
215
216
  unicode-display_width (>= 1.1.1, < 3)
216
217
  thor (1.2.1)
217
- tilt (2.0.10)
218
- tzinfo (2.0.4)
218
+ tilt (2.0.11)
219
+ tzinfo (2.0.5)
219
220
  concurrent-ruby (~> 1.0)
220
221
  unf (0.1.4)
221
222
  unf_ext
@@ -226,9 +227,9 @@ GEM
226
227
  crack (>= 0.3.2)
227
228
  hashdiff (>= 0.4.0, < 2.0.0)
228
229
  webrick (1.7.0)
229
- yard (0.9.27)
230
+ yard (0.9.28)
230
231
  webrick (~> 1.7.0)
231
- zeitwerk (2.5.4)
232
+ zeitwerk (2.6.0)
232
233
 
233
234
  PLATFORMS
234
235
  ruby
@@ -245,4 +246,4 @@ DEPENDENCIES
245
246
  webmock (= 3.7.0)
246
247
 
247
248
  BUNDLED WITH
248
- 2.2.33
249
+ 2.3.9
@@ -23,6 +23,7 @@ when we make a change - no matter the size of the change.
23
23
  - If there is one, update it if necessary.
24
24
  - If not, update [`lib/gitlab/qa/version.rb`] to an appropriate [semantic version](https://semver.org) in a new merge request using the [release template](https://gitlab.com/gitlab-org/gitlab-qa/blob/master/.gitlab/merge_request_templates/Release.md)
25
25
  and title the MR like `"Bump version to <version>"`.
26
+ - Run `bundle update` to update the `Gemfile.lock` with the new version number of `gitlab-qa`.
26
27
  - Merge the merge request.
27
28
  - The new version should automatically be tagged and pushed to Rubygems by the `gem-release` job in the merge commit pipeline.
28
29
  - Update the release notes for the newly created tag (https://gitlab.com/gitlab-org/gitlab-qa/-/tags):
@@ -120,6 +120,11 @@ This is required because chrome-webdriver makes use of `/dev/shm` shared memory.
120
120
  ~3GB but unless you allocate 5GB or more some magic numbers may not enable a bigger `/dev/shm` in the
121
121
  'host' VM that "native" docker runs on.
122
122
 
123
+ By default, Docker runs a container with a /dev/shm shared memory space 64MB.
124
+ This is typically too small for Chrome and will cause Chrome to crash when rendering large pages and fail the tests.
125
+ To fix, run the container with docker run `--shm-size=1gb` to increase the size of `/dev/shm`.
126
+ Since Chrome 65, this is no longer necessary. Instead, launch the browser with the `CHROME_DISABLE_DEV_SHM=true`.
127
+
123
128
  Please note that while it's possible to run multi-node tests like Geo Primary and Secondary, you can't
124
129
  access the machines from your host machine, as they are all exposed as `0.0.0.0:port`, and because
125
130
  of that they don't match the configured VHOSTs in your GitLab installation, so the redirect login
data/docs/trainings.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # GitLab QA trainings
2
2
 
3
+ The handbook has [information about the entire test automation framework](https://about.gitlab.com/handbook/engineering/quality/#test-automation-framework), including GitLab QA. There you can find links to additional documentation and videos.
4
+
3
5
  ## Build team training on GitLab QA
4
6
 
5
7
  A great introduction to the GitLab QA project, its internal structure, how it's
@@ -98,6 +98,7 @@ All environment variables used by GitLab QA should be defined in [`lib/gitlab/qa
98
98
  | `GEO_FAILOVER` | `false` | Set to `true` when a Geo secondary site has been promoted to a Geo primary site. | No|
99
99
  | `GITLAB_INITIAL_ROOT_PASSWORD` | `5iveL!fe` | Initial root password for Omnibus installations | No|
100
100
  | `COLORIZED_LOGS` | `false` | Colors GitLab QA and test logs to improve readability | No|
101
+ | `QA_DOCKER_ADD_HOSTS` |- | Comma separated list of hosts to add to /etc/hosts in docker container | No|
101
102
 
102
103
  ## [Supported Remote Grid environment variables](./running_against_remote_grid.md)
103
104
 
data/gitlab-qa.gemspec CHANGED
@@ -34,4 +34,5 @@ Gem::Specification.new do |spec|
34
34
  spec.add_runtime_dependency 'nokogiri', '~> 1.10'
35
35
  spec.add_runtime_dependency 'rainbow', '~> 3.0.0'
36
36
  spec.add_runtime_dependency 'table_print', '1.5.7'
37
+ spec.add_runtime_dependency 'zeitwerk', '~> 2.4'
37
38
  end
@@ -7,6 +7,7 @@ require 'uri'
7
7
  require 'forwardable'
8
8
  require 'openssl'
9
9
  require 'tempfile'
10
+ require 'json'
10
11
 
11
12
  module Gitlab
12
13
  module QA
@@ -119,6 +120,10 @@ module Gitlab
119
120
  super
120
121
  end
121
122
 
123
+ def exist?(image, tag)
124
+ docker.manifest_exists?("#{image}:#{tag}")
125
+ end
126
+
122
127
  def prepare_gitlab_omnibus_config
123
128
  set_formless_login_token
124
129
  set_license_mode
@@ -202,18 +207,18 @@ module Gitlab
202
207
  end
203
208
 
204
209
  def rails_version
205
- json = @docker.read_file(
206
- @release.image, @release.tag,
207
- '/opt/gitlab/version-manifest.json'
208
- )
209
-
210
- manifest = JSON.parse(json)
210
+ manifest = JSON.parse(read_package_manifest)
211
211
  {
212
212
  sha: manifest['software']['gitlab-rails']['locked_version'],
213
213
  source: manifest['software']['gitlab-rails']['locked_source']['git']
214
214
  }
215
215
  end
216
216
 
217
+ def package_version
218
+ manifest = JSON.parse(read_package_manifest)
219
+ manifest['software']['package-scripts']['locked_version']
220
+ end
221
+
217
222
  def copy_key_file(env_key)
218
223
  key_dir = ENV['CI_PROJECT_DIR'] || Dir.tmpdir
219
224
  key_file = Tempfile.new(env_key.downcase, key_dir)
@@ -229,6 +234,13 @@ module Gitlab
229
234
 
230
235
  private
231
236
 
237
+ def read_package_manifest
238
+ @docker.read_file(
239
+ @release.image, @release.tag,
240
+ '/opt/gitlab/version-manifest.json'
241
+ )
242
+ end
243
+
232
244
  # Copy certs to a temporary directory in current working directory.
233
245
  # This is needed for docker-in-docker ci environments where mount points outside of build dir are not accessible
234
246
  #
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Gitlab
4
+ module QA
5
+ module Component
6
+ class Opensearch < Base
7
+ DOCKER_IMAGE = 'opensearchproject/opensearch'
8
+
9
+ def name
10
+ @name ||= "elastic68"
11
+ end
12
+
13
+ def tag
14
+ Runtime::Env.opensearch_version
15
+ end
16
+
17
+ def start
18
+ @docker.run(image: image, tag: tag) do |command|
19
+ command << "-d"
20
+ command << "--name #{name}"
21
+ command << "--net #{network}"
22
+ command << "--publish 9200:9200"
23
+ command << "--publish 9300:9300"
24
+
25
+ command.env("discovery.type", "single-node")
26
+ command.env("ES_JAVA_OPTS", "-Xms512m -Xmx512m")
27
+ command.env("plugins.security.disabled", "true")
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -23,9 +23,7 @@ module Gitlab
23
23
 
24
24
  raise ArgumentError unless [suite, release].all?
25
25
 
26
- @docker.login(**release.login_params) if release.login_params
27
-
28
- @docker.pull(image: qa_image) unless Runtime::Env.skip_pull?
26
+ docker_pull_qa_image_if_needed
29
27
 
30
28
  Runtime::Logger.info("Running test suite `#{suite}` for #{release.project_name}")
31
29
 
@@ -52,6 +50,11 @@ module Gitlab
52
50
  command.env('QA_HOSTNAME', hostname)
53
51
  end
54
52
 
53
+ unless Runtime::Env.docker_add_hosts.empty?
54
+ hosts = Runtime::Env.docker_add_hosts.map { |host| "--add-host=#{host} " }.join
55
+ command << hosts # override /etc/hosts in docker container when test runs
56
+ end
57
+
55
58
  env.merge(Runtime::Env.variables).each do |key, value|
56
59
  command.env(key, value)
57
60
  end
@@ -70,6 +73,12 @@ module Gitlab
70
73
 
71
74
  private
72
75
 
76
+ def docker_pull_qa_image_if_needed
77
+ @docker.login(**release.login_params) if release.login_params
78
+
79
+ @docker.pull(image: qa_image) unless Runtime::Env.skip_pull?
80
+ end
81
+
73
82
  def args_with_flags(args, feature_flag_set)
74
83
  return args if feature_flag_set.empty?
75
84
 
@@ -110,6 +110,14 @@ module Gitlab
110
110
  Docker::Command.execute("rm -f #{name}")
111
111
  end
112
112
 
113
+ def manifest_exists?(name)
114
+ Docker::Command.execute("manifest inspect #{name}")
115
+ rescue Docker::Shellout::StatusError
116
+ false
117
+ else
118
+ true
119
+ end
120
+
113
121
  def container_exists?(name)
114
122
  Docker::Command.execute("container inspect #{name}")
115
123
  rescue Docker::Shellout::StatusError
@@ -229,7 +229,11 @@ module Gitlab
229
229
  end
230
230
 
231
231
  def elastic_version
232
- env_var_value_if_defined('ELASTIC_VERSION') || '7.17.0'
232
+ env_var_value_if_defined('ELASTIC_VERSION') || '8.2.0'
233
+ end
234
+
235
+ def opensearch_version
236
+ env_var_value_if_defined('OPENSEARCH_VERSION') || '2.0.1'
233
237
  end
234
238
 
235
239
  def require_license!
@@ -357,6 +361,10 @@ module Gitlab
357
361
  "#{ci_project_name}-#{test_subset}"
358
362
  end
359
363
 
364
+ def docker_add_hosts
365
+ (env_var_value_if_defined('QA_DOCKER_ADD_HOSTS') || '').split(',')
366
+ end
367
+
360
368
  private
361
369
 
362
370
  def enabled?(value, default: true)
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Gitlab
4
+ module QA
5
+ module Scenario
6
+ module Test
7
+ module Integration
8
+ class Opensearch < Scenario::Template
9
+ attr_reader :gitlab_name, :spec_suite
10
+
11
+ def initialize
12
+ @gitlab_name = 'gitlab-opensearch'
13
+ # Currently the test suite that tests Advanced Search features is called 'Elasticsearch' which we hope to abstract to 'Advancedsearch' in the future
14
+ @spec_suite = 'QA::EE::Scenario::Test::Integration::Elasticsearch'
15
+ end
16
+
17
+ def before_perform(release)
18
+ raise ArgumentError, 'OpenSearch is an EE only feature!' unless release.ee?
19
+ end
20
+
21
+ def perform(release, *rspec_args)
22
+ release = QA::Release.new(release)
23
+ before_perform(release)
24
+
25
+ Component::Gitlab.perform do |gitlab|
26
+ gitlab.release = release
27
+ setup_opensearch_on gitlab
28
+
29
+ Component::Opensearch.perform do |opensearch|
30
+ opensearch.network = 'test'
31
+ opensearch.instance do
32
+ gitlab.instance do
33
+ Runtime::Logger.info("Running #{spec_suite} specs!")
34
+
35
+ Component::Specs.perform do |specs|
36
+ specs.suite = spec_suite
37
+ specs.release = gitlab.release
38
+ specs.network = gitlab.network
39
+ specs.args = [gitlab.address, *rspec_args]
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+
47
+ def empty_index
48
+ @empty_index ||= ["gitlab-rake gitlab:elastic:create_empty_index"]
49
+ end
50
+
51
+ def setup_opensearch_on(instance)
52
+ instance.name = gitlab_name
53
+ instance.network = 'test'
54
+ instance.elastic_url = "http://elastic68:9200"
55
+ instance.exec_commands = empty_index
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -10,8 +10,44 @@ module Gitlab
10
10
  module Omnibus
11
11
  class Update < Scenario::Template
12
12
  def perform(from_release, to_release = nil, *rspec_args)
13
- previous_release = QA::Release.new(from_release).previous_stable
14
- current_release = QA::Release.new(to_release || from_release)
13
+ version = Component::Gitlab.perform do |gitlab|
14
+ gitlab.release = from_release
15
+ gitlab.act do
16
+ pull
17
+ package_version
18
+ end
19
+ end
20
+
21
+ if version
22
+ # Sub any plus symbols in version eg. "15.1.2+ce.0"
23
+ version.tr!('+', '-')
24
+ Runtime::Logger.info("Found previous version '#{version}'")
25
+
26
+ current_release = QA::Release.new(to_release || from_release)
27
+
28
+ type = current_release.ee? ? 'ee' : 'ce'
29
+
30
+ existing_previous = Component::Gitlab.perform do |gitlab|
31
+ gitlab.act do
32
+ next "gitlab/gitlab-#{type}:#{version}" if exist?("gitlab/gitlab-#{type}", version)
33
+
34
+ next "gitlab/gitlab-#{type}:#{version}-#{type}.0" if exist?("gitlab/gitlab-#{type}", "#{version}-#{type}.0")
35
+
36
+ nil
37
+ end
38
+ end
39
+ else
40
+ Runtime::Logger.info("Could not find previous image version")
41
+ existing_previous = nil
42
+ end
43
+
44
+ previous_release = if existing_previous
45
+ Runtime::Logger.info("Using previous image '#{existing_previous}'")
46
+ QA::Release.new(existing_previous)
47
+ else
48
+ Runtime::Logger.info("Using stable as previous image")
49
+ QA::Release.new(from_release).previous_stable
50
+ end
15
51
 
16
52
  Docker::Volumes.new.with_temporary_volumes do |volumes|
17
53
  Component::Gitlab.perform do |gitlab|
@@ -61,7 +61,7 @@ module Gitlab
61
61
  logger.formatter = proc do |severity, datetime, progname, msg|
62
62
  msg_prefix = message_prefix(datetime, source, severity)
63
63
 
64
- "#{msg_prefix}#{msg}\n"
64
+ "#{msg_prefix}#{msg}\n".gsub(/\e\[(\d+)(?:;\d+)*m/, "")
65
65
  end
66
66
  end
67
67
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  module QA
5
- VERSION = '7.35.0'
5
+ VERSION = '8.1.0'
6
6
  end
7
7
  end
data/lib/gitlab/qa.rb CHANGED
@@ -1,151 +1,57 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'rainbow/refinement'
4
+ require 'zeitwerk'
4
5
 
5
6
  module Gitlab
6
7
  module QA
7
- autoload :Release, 'gitlab/qa/release'
8
- autoload :Reporter, 'gitlab/qa/reporter'
9
- autoload :Runner, 'gitlab/qa/runner'
10
- autoload :TestLogger, 'gitlab/qa/test_logger'
11
-
12
- module Runtime
13
- autoload :Env, 'gitlab/qa/runtime/env'
14
- autoload :Scenario, 'gitlab/qa/runtime/scenario'
15
- autoload :TokenFinder, 'gitlab/qa/runtime/token_finder'
16
- autoload :OmnibusConfiguration, 'gitlab/qa/runtime/omnibus_configuration'
17
- autoload :Logger, 'gitlab/qa/runtime/logger'
18
-
19
- module OmnibusConfigurations
20
- autoload :Default, 'gitlab/qa/runtime/omnibus_configurations/default'
21
- autoload :Packages, 'gitlab/qa/runtime/omnibus_configurations/packages'
22
- autoload :ObjectStorage, 'gitlab/qa/runtime/omnibus_configurations/object_storage'
23
- autoload :ObjectStorageAws, 'gitlab/qa/runtime/omnibus_configurations/object_storage_aws'
24
- autoload :ObjectStorageGcs, 'gitlab/qa/runtime/omnibus_configurations/object_storage_gcs'
25
- autoload :LicenseMode, 'gitlab/qa/runtime/omnibus_configurations/license_mode'
26
- autoload :RegistryObjectStorage, 'gitlab/qa/runtime/omnibus_configurations/registry_object_storage'
27
- autoload :DecompositionSingleDb, 'gitlab/qa/runtime/omnibus_configurations/decomposition_single_db'
28
- autoload :DecompositionMultipleDb, 'gitlab/qa/runtime/omnibus_configurations/decomposition_multiple_db'
29
- end
30
- end
31
-
32
- module Scenario
33
- autoload :Actable, 'gitlab/qa/scenario/actable'
34
- autoload :Template, 'gitlab/qa/scenario/template'
35
- autoload :CLICommands, 'gitlab/qa/scenario/cli_commands'
36
-
37
- module Test
38
- module Instance
39
- autoload :Any, 'gitlab/qa/scenario/test/instance/any'
40
- autoload :DeploymentBase, 'gitlab/qa/scenario/test/instance/deployment_base'
41
- autoload :Image, 'gitlab/qa/scenario/test/instance/image'
42
- autoload :RelativeUrl, 'gitlab/qa/scenario/test/instance/relative_url'
43
- autoload :RepositoryStorage, 'gitlab/qa/scenario/test/instance/repository_storage'
44
- autoload :Staging, 'gitlab/qa/scenario/test/instance/staging'
45
- autoload :StagingRef, 'gitlab/qa/scenario/test/instance/staging_ref'
46
- autoload :Production, 'gitlab/qa/scenario/test/instance/production'
47
- autoload :Smoke, 'gitlab/qa/scenario/test/instance/smoke'
48
- autoload :Preprod, 'gitlab/qa/scenario/test/instance/preprod'
49
- autoload :Release, 'gitlab/qa/scenario/test/instance/release'
50
- autoload :Geo, 'gitlab/qa/scenario/test/instance/geo'
51
- autoload :StagingGeo, 'gitlab/qa/scenario/test/instance/staging_geo'
52
- autoload :StagingRefGeo, 'gitlab/qa/scenario/test/instance/staging_ref_geo'
53
- autoload :Airgapped, 'gitlab/qa/scenario/test/instance/airgapped'
54
- end
55
-
56
- module Omnibus
57
- autoload :Image, 'gitlab/qa/scenario/test/omnibus/image'
58
- autoload :Update, 'gitlab/qa/scenario/test/omnibus/update'
59
- autoload :Upgrade, 'gitlab/qa/scenario/test/omnibus/upgrade'
60
- end
61
-
62
- module Integration
63
- autoload :Geo, 'gitlab/qa/scenario/test/integration/geo'
64
- autoload :LDAP, 'gitlab/qa/scenario/test/integration/ldap'
65
- autoload :LDAPNoTLS, 'gitlab/qa/scenario/test/integration/ldap_no_tls'
66
- autoload :LDAPNoServer, 'gitlab/qa/scenario/test/integration/ldap_no_server'
67
- autoload :LDAPTLS, 'gitlab/qa/scenario/test/integration/ldap_tls'
68
- autoload :SAML, 'gitlab/qa/scenario/test/integration/saml'
69
- autoload :GroupSAML, 'gitlab/qa/scenario/test/integration/group_saml'
70
- autoload :InstanceSAML, 'gitlab/qa/scenario/test/integration/instance_saml'
71
- autoload :Mattermost, 'gitlab/qa/scenario/test/integration/mattermost'
72
- autoload :Kubernetes, 'gitlab/qa/scenario/test/integration/kubernetes'
73
- autoload :Praefect, 'gitlab/qa/scenario/test/integration/praefect'
74
- autoload :Elasticsearch, 'gitlab/qa/scenario/test/integration/elasticsearch'
75
- autoload :SMTP, 'gitlab/qa/scenario/test/integration/smtp'
76
- autoload :GitalyCluster, 'gitlab/qa/scenario/test/integration/gitaly_cluster'
77
- autoload :Jira, 'gitlab/qa/scenario/test/integration/jira'
78
- autoload :SSHTunnel, 'gitlab/qa/scenario/test/integration/ssh_tunnel'
79
- autoload :MTLS, 'gitlab/qa/scenario/test/integration/mtls'
80
- autoload :ClientSSL, 'gitlab/qa/scenario/test/integration/client_ssl'
81
- autoload :Registry, 'gitlab/qa/scenario/test/integration/registry'
82
- autoload :RegistryTLS, 'gitlab/qa/scenario/test/integration/registry_tls'
83
- autoload :ServicePingDisabled, 'gitlab/qa/scenario/test/integration/service_ping_disabled'
84
- autoload :Integrations, 'gitlab/qa/scenario/test/integration/integrations'
85
- autoload :RegistryWithCDN, 'gitlab/qa/scenario/test/integration/registry_with_cdn'
86
- end
87
-
88
- module Sanity
89
- autoload :Version, 'gitlab/qa/scenario/test/sanity/version'
90
- end
91
- end
92
- end
93
-
94
- module Component
95
- autoload :Base, 'gitlab/qa/component/base'
96
- autoload :Gitlab, 'gitlab/qa/component/gitlab'
97
- autoload :InternetTunnel, 'gitlab/qa/component/internet_tunnel'
98
- autoload :LDAP, 'gitlab/qa/component/ldap'
99
- autoload :SAML, 'gitlab/qa/component/saml'
100
- autoload :Specs, 'gitlab/qa/component/specs'
101
- autoload :Staging, 'gitlab/qa/component/staging'
102
- autoload :StagingRef, 'gitlab/qa/component/staging_ref'
103
- autoload :Production, 'gitlab/qa/component/production'
104
- autoload :Minio, 'gitlab/qa/component/minio'
105
- autoload :Preprod, 'gitlab/qa/component/preprod'
106
- autoload :Release, 'gitlab/qa/component/release'
107
- autoload :Elasticsearch, 'gitlab/qa/component/elasticsearch'
108
- autoload :MailHog, 'gitlab/qa/component/mail_hog'
109
- autoload :Jira, 'gitlab/qa/component/jira'
110
- autoload :PostgreSQL, 'gitlab/qa/component/postgresql'
111
- autoload :Telegraf, 'gitlab/qa/component/telegraf'
112
- end
113
-
114
- module Support
115
- autoload :GetRequest, 'gitlab/qa/support/get_request'
116
- autoload :HttpRequest, 'gitlab/qa/support/http_request'
117
- autoload :DevEEQAImage, 'gitlab/qa/support/dev_ee_qa_image'
118
- autoload :InvalidResponseError, 'gitlab/qa/support/invalid_response_error'
119
- end
120
-
121
- module Docker
122
- autoload :Command, 'gitlab/qa/docker/command'
123
- autoload :Engine, 'gitlab/qa/docker/engine'
124
- autoload :Shellout, 'gitlab/qa/docker/shellout'
125
- autoload :Volumes, 'gitlab/qa/docker/volumes'
126
- end
127
-
128
- module Report
129
- autoload :GitlabIssueClient, 'gitlab/qa/report/gitlab_issue_client'
130
- autoload :GitlabIssueDryClient, 'gitlab/qa/report/gitlab_issue_dry_client'
131
- autoload :BaseTestResults, 'gitlab/qa/report/base_test_results'
132
- autoload :RelateFailureIssue, 'gitlab/qa/report/relate_failure_issue'
133
- autoload :JsonTestResults, 'gitlab/qa/report/json_test_results'
134
- autoload :JUnitTestResults, 'gitlab/qa/report/junit_test_results'
135
- autoload :PrepareStageReports, 'gitlab/qa/report/prepare_stage_reports'
136
- autoload :ReportAsIssue, 'gitlab/qa/report/report_as_issue'
137
- autoload :ReportResults, 'gitlab/qa/report/report_results'
138
- autoload :ResultsInIssues, 'gitlab/qa/report/results_in_issues'
139
- autoload :ResultsInTestCases, 'gitlab/qa/report/results_in_testcases'
140
- autoload :ResultsReporterShared, 'gitlab/qa/report/results_reporter_shared'
141
- autoload :GenerateTestSession, 'gitlab/qa/report/generate_test_session'
142
- autoload :SummaryTable, 'gitlab/qa/report/summary_table'
143
- autoload :TestResult, 'gitlab/qa/report/test_result'
144
- autoload :UpdateScreenshotPath, 'gitlab/qa/report/update_screenshot_path'
145
- end
146
-
147
- module Slack
148
- autoload :PostToSlack, 'gitlab/qa/slack/post_to_slack'
149
- end
8
+ loader = Zeitwerk::Loader.new
9
+ loader.push_dir("#{__dir__}/qa", namespace: Gitlab::QA)
10
+
11
+ loader.inflector.inflect(
12
+ 'dev_ee_qa_image' => 'DevEEQAImage',
13
+ 'results_in_testcases' => 'ResultsInTestCases',
14
+ 'postgresql' => 'PostgreSQL',
15
+ 'registry_with_cdn' => 'RegistryWithCDN',
16
+ 'smtp' => 'SMTP',
17
+ 'mtls' => 'MTLS',
18
+ 'saml' => 'SAML',
19
+ 'ce' => 'CE',
20
+ 'ee' => 'EE',
21
+ 'api' => 'API',
22
+ 'ssh' => 'SSH',
23
+ 'ssh_key' => 'SSHKey',
24
+ 'ssh_keys' => 'SSHKeys',
25
+ 'ecdsa' => 'ECDSA',
26
+ 'ed25519' => 'ED25519',
27
+ 'rsa' => 'RSA',
28
+ 'ldap' => 'LDAP',
29
+ 'ldap_tls' => 'LDAPTLS',
30
+ 'ldap_no_tls' => 'LDAPNoTLS',
31
+ 'ldap_no_server' => 'LDAPNoServer',
32
+ 'rspec' => 'RSpec',
33
+ 'web_ide' => 'WebIDE',
34
+ 'ci_cd' => 'CiCd',
35
+ 'project_imported_from_url' => 'ProjectImportedFromURL',
36
+ 'repo_by_url' => 'RepoByURL',
37
+ 'oauth' => 'OAuth',
38
+ 'saml_sso_sign_in' => 'SamlSSOSignIn',
39
+ 'saml_sso_sign_up' => 'SamlSSOSignUp',
40
+ 'group_saml' => 'GroupSAML',
41
+ 'instance_saml' => 'InstanceSAML',
42
+ 'saml_sso' => 'SamlSSO',
43
+ 'ldap_sync' => 'LDAPSync',
44
+ 'ip_address' => 'IPAddress',
45
+ 'gpg' => 'GPG',
46
+ 'user_gpg' => 'UserGPG',
47
+ 'otp' => 'OTP',
48
+ 'jira_api' => 'JiraAPI',
49
+ 'registry_tls' => 'RegistryTLS',
50
+ 'jetbrains' => 'JetBrains',
51
+ 'vscode' => 'VSCode',
52
+ 'cli_commands' => 'CLICommands'
53
+ )
54
+
55
+ loader.setup
150
56
  end
151
57
  end
@@ -37,6 +37,7 @@ class GenerateQAJobs
37
37
  jobs.merge!(load_yml_contents('registry', should_automatically_run?('test_integration_registry')))
38
38
  jobs.merge!(load_yml_contents('packages', should_automatically_run?('test_instance_all_packages')))
39
39
  jobs.merge!(load_yml_contents('elasticsearch', should_automatically_run?('test_integration_elasticsearch')))
40
+ jobs.merge!(load_yml_contents('opensearch', should_automatically_run?('test_integration_opensearch')))
40
41
  jobs.merge!(load_yml_contents('praefect', should_automatically_run?('test_instance_all')))
41
42
  jobs.merge!(load_yml_contents('gitaly_cluster', should_automatically_run?('test_instance_all')))
42
43
  jobs.merge!(load_yml_contents('mtls', should_automatically_run?('test_instance_all_mtls')))
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class AdminAccessTokenSeed
4
- TOKEN_VALUE = 'yF4CpxN55A1V0sHMuYQa'
4
+ TOKEN_VALUE = 'ypCa3Dzb23o5nvsixwPA'
5
5
  SCOPES = Gitlab::Auth.all_available_scopes
6
6
 
7
7
  def self.seed!
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.35.0
4
+ version: 8.1.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: 2022-06-15 00:00:00.000000000 Z
11
+ date: 2022-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control
@@ -206,6 +206,20 @@ dependencies:
206
206
  - - '='
207
207
  - !ruby/object:Gem::Version
208
208
  version: 1.5.7
209
+ - !ruby/object:Gem::Dependency
210
+ name: zeitwerk
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: '2.4'
216
+ type: :runtime
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: '2.4'
209
223
  description:
210
224
  email:
211
225
  - gitlab-qa@gmail.com
@@ -244,6 +258,7 @@ files:
244
258
  - ".gitlab/ci/jobs/object_storage_registry_tls.gitlab-ci.yml"
245
259
  - ".gitlab/ci/jobs/omnibus_image.gitlab-ci.yml"
246
260
  - ".gitlab/ci/jobs/omnibus_upgrade.gitlab-ci.yml"
261
+ - ".gitlab/ci/jobs/opensearch.gitlab-ci.yml"
247
262
  - ".gitlab/ci/jobs/packages.gitlab-ci.yml"
248
263
  - ".gitlab/ci/jobs/praefect.gitlab-ci.yml"
249
264
  - ".gitlab/ci/jobs/registry.gitlab-ci.yml"
@@ -302,6 +317,7 @@ files:
302
317
  - lib/gitlab/qa/component/ldap.rb
303
318
  - lib/gitlab/qa/component/mail_hog.rb
304
319
  - lib/gitlab/qa/component/minio.rb
320
+ - lib/gitlab/qa/component/opensearch.rb
305
321
  - lib/gitlab/qa/component/postgresql.rb
306
322
  - lib/gitlab/qa/component/preprod.rb
307
323
  - lib/gitlab/qa/component/production.rb
@@ -320,8 +336,8 @@ files:
320
336
  - lib/gitlab/qa/report/generate_test_session.rb
321
337
  - lib/gitlab/qa/report/gitlab_issue_client.rb
322
338
  - lib/gitlab/qa/report/gitlab_issue_dry_client.rb
339
+ - lib/gitlab/qa/report/j_unit_test_results.rb
323
340
  - lib/gitlab/qa/report/json_test_results.rb
324
- - lib/gitlab/qa/report/junit_test_results.rb
325
341
  - lib/gitlab/qa/report/prepare_stage_reports.rb
326
342
  - lib/gitlab/qa/report/relate_failure_issue.rb
327
343
  - lib/gitlab/qa/report/report_as_issue.rb
@@ -381,6 +397,7 @@ files:
381
397
  - lib/gitlab/qa/scenario/test/integration/ldap_tls.rb
382
398
  - lib/gitlab/qa/scenario/test/integration/mattermost.rb
383
399
  - lib/gitlab/qa/scenario/test/integration/mtls.rb
400
+ - lib/gitlab/qa/scenario/test/integration/opensearch.rb
384
401
  - lib/gitlab/qa/scenario/test/integration/praefect.rb
385
402
  - lib/gitlab/qa/scenario/test/integration/registry.rb
386
403
  - lib/gitlab/qa/scenario/test/integration/registry_tls.rb