gitlab-qa 8.0.0 → 8.1.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: '0982270bb1256eb950e30c84028a70fca0663c744fff1bf00cb1937f89936f43'
4
- data.tar.gz: c2051a27b8027df5d47359a6b27a54338e25bfc37471dae2fe600087e118b392
3
+ metadata.gz: d9b328348db20338194b52a69ad58985c4f48bfec8b9a7989b44a1840c6d27d2
4
+ data.tar.gz: 11aaf09daf2aac04f0f06e626087230b959ee68eba236c516ae4ce28df808817
5
5
  SHA512:
6
- metadata.gz: c11dd80b24b285fcd8b93c94c0fabac93be215576eb307804c485ad9a5dbba4a7b6cd9f6b016f13082ba4c146f8189a2e7f6bf9b41ef85172a735696e2e558af
7
- data.tar.gz: 0cf57dcfa1f30e37f2acc66015ed03c0d2e3d2bd65284f7be92d71b1028fadbceb9f72feaa7a4dad29905d7554a9f985885b6d95ca096944c1a955ffa0ac244d
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/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab-qa (8.0.0)
4
+ gitlab-qa (8.1.0)
5
5
  activesupport (~> 6.1)
6
6
  gitlab (~> 4.18.0)
7
7
  http (~> 5.0)
@@ -13,7 +13,7 @@ PATH
13
13
  GEM
14
14
  remote: https://rubygems.org/
15
15
  specs:
16
- activesupport (6.1.6)
16
+ activesupport (6.1.6.1)
17
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
18
  i18n (>= 1.6, < 2)
19
19
  minitest (>= 5.1)
@@ -72,11 +72,11 @@ GEM
72
72
  faraday-em_http (1.0.0)
73
73
  faraday-em_synchrony (1.0.0)
74
74
  faraday-excon (1.1.0)
75
- faraday-http-cache (2.2.0)
75
+ faraday-http-cache (2.4.0)
76
76
  faraday (>= 0.8)
77
77
  faraday-httpclient (1.0.1)
78
- faraday-multipart (1.0.3)
79
- multipart-post (>= 1.2, < 3)
78
+ faraday-multipart (1.0.4)
79
+ multipart-post (~> 2)
80
80
  faraday-net_http (1.0.1)
81
81
  faraday-net_http_persistent (1.2.0)
82
82
  faraday-patron (1.0.0)
@@ -101,7 +101,7 @@ GEM
101
101
  rubocop-rails (~> 2.9)
102
102
  rubocop-rspec (~> 1.44)
103
103
  hashdiff (1.0.1)
104
- http (5.0.4)
104
+ http (5.1.0)
105
105
  addressable (~> 2.8)
106
106
  http-cookie (~> 1.0)
107
107
  http-form_data (~> 2.2)
@@ -112,7 +112,7 @@ GEM
112
112
  httparty (0.20.0)
113
113
  mime-types (~> 3.0)
114
114
  multi_xml (>= 0.5.2)
115
- i18n (1.10.0)
115
+ i18n (1.12.0)
116
116
  concurrent-ruby (~> 1.0)
117
117
  jaro_winkler (1.5.4)
118
118
  kramdown (2.4.0)
@@ -127,17 +127,17 @@ GEM
127
127
  mime-types-data (~> 3.2015)
128
128
  mime-types-data (3.2022.0105)
129
129
  mini_portile2 (2.8.0)
130
- minitest (5.15.0)
130
+ minitest (5.16.2)
131
131
  multi_xml (0.6.0)
132
- multipart-post (2.1.1)
132
+ multipart-post (2.2.3)
133
133
  nap (1.1.0)
134
134
  no_proxy_fix (0.1.2)
135
- nokogiri (1.13.6)
135
+ nokogiri (1.13.8)
136
136
  mini_portile2 (~> 2.8.0)
137
137
  racc (~> 1.4)
138
- octokit (4.22.0)
139
- faraday (>= 0.9)
140
- sawyer (~> 0.8.0, >= 0.5.3)
138
+ octokit (4.25.1)
139
+ faraday (>= 1, < 3)
140
+ sawyer (~> 0.9)
141
141
  open4 (1.3.4)
142
142
  parallel (1.22.1)
143
143
  parser (3.1.2.0)
@@ -147,11 +147,11 @@ GEM
147
147
  method_source (~> 1.0)
148
148
  public_suffix (4.0.7)
149
149
  racc (1.6.0)
150
- rack (2.2.3)
150
+ rack (2.2.4)
151
151
  rainbow (3.0.0)
152
152
  rake (13.0.6)
153
153
  rchardet (1.8.0)
154
- regexp_parser (2.4.0)
154
+ regexp_parser (2.5.0)
155
155
  reverse_markdown (2.1.1)
156
156
  nokogiri
157
157
  rexml (3.2.5)
@@ -177,7 +177,7 @@ GEM
177
177
  rubocop-ast (>= 0.6.0)
178
178
  ruby-progressbar (~> 1.7)
179
179
  unicode-display_width (>= 1.4.0, < 2.0)
180
- rubocop-ast (1.18.0)
180
+ rubocop-ast (1.19.1)
181
181
  parser (>= 3.1.1.0)
182
182
  rubocop-gitlab-security (0.1.1)
183
183
  rubocop (>= 0.51)
@@ -193,9 +193,9 @@ GEM
193
193
  rubocop-ast (>= 0.7.1)
194
194
  ruby-progressbar (1.11.0)
195
195
  ruby2_keywords (0.0.5)
196
- sawyer (0.8.2)
196
+ sawyer (0.9.2)
197
197
  addressable (>= 2.3.5)
198
- faraday (> 0.8, < 2.0)
198
+ faraday (>= 0.17.3, < 3)
199
199
  solargraph (0.45.0)
200
200
  backport (~> 1.2)
201
201
  benchmark
@@ -215,8 +215,8 @@ GEM
215
215
  terminal-table (3.0.2)
216
216
  unicode-display_width (>= 1.1.1, < 3)
217
217
  thor (1.2.1)
218
- tilt (2.0.10)
219
- tzinfo (2.0.4)
218
+ tilt (2.0.11)
219
+ tzinfo (2.0.5)
220
220
  concurrent-ruby (~> 1.0)
221
221
  unf (0.1.4)
222
222
  unf_ext
@@ -227,9 +227,9 @@ GEM
227
227
  crack (>= 0.3.2)
228
228
  hashdiff (>= 0.4.0, < 2.0.0)
229
229
  webrick (1.7.0)
230
- yard (0.9.27)
230
+ yard (0.9.28)
231
231
  webrick (~> 1.7.0)
232
- zeitwerk (2.5.4)
232
+ zeitwerk (2.6.0)
233
233
 
234
234
  PLATFORMS
235
235
  ruby
@@ -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):
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
 
@@ -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
@@ -232,6 +232,10 @@ module Gitlab
232
232
  env_var_value_if_defined('ELASTIC_VERSION') || '8.2.0'
233
233
  end
234
234
 
235
+ def opensearch_version
236
+ env_var_value_if_defined('OPENSEARCH_VERSION') || '2.0.1'
237
+ end
238
+
235
239
  def require_license!
236
240
  return if ENV.include?('EE_LICENSE')
237
241
 
@@ -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|
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  module QA
5
- VERSION = '8.0.0'
5
+ VERSION = '8.1.0'
6
6
  end
7
7
  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')))
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: 8.0.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-27 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
@@ -258,6 +258,7 @@ files:
258
258
  - ".gitlab/ci/jobs/object_storage_registry_tls.gitlab-ci.yml"
259
259
  - ".gitlab/ci/jobs/omnibus_image.gitlab-ci.yml"
260
260
  - ".gitlab/ci/jobs/omnibus_upgrade.gitlab-ci.yml"
261
+ - ".gitlab/ci/jobs/opensearch.gitlab-ci.yml"
261
262
  - ".gitlab/ci/jobs/packages.gitlab-ci.yml"
262
263
  - ".gitlab/ci/jobs/praefect.gitlab-ci.yml"
263
264
  - ".gitlab/ci/jobs/registry.gitlab-ci.yml"
@@ -316,6 +317,7 @@ files:
316
317
  - lib/gitlab/qa/component/ldap.rb
317
318
  - lib/gitlab/qa/component/mail_hog.rb
318
319
  - lib/gitlab/qa/component/minio.rb
320
+ - lib/gitlab/qa/component/opensearch.rb
319
321
  - lib/gitlab/qa/component/postgresql.rb
320
322
  - lib/gitlab/qa/component/preprod.rb
321
323
  - lib/gitlab/qa/component/production.rb
@@ -395,6 +397,7 @@ files:
395
397
  - lib/gitlab/qa/scenario/test/integration/ldap_tls.rb
396
398
  - lib/gitlab/qa/scenario/test/integration/mattermost.rb
397
399
  - lib/gitlab/qa/scenario/test/integration/mtls.rb
400
+ - lib/gitlab/qa/scenario/test/integration/opensearch.rb
398
401
  - lib/gitlab/qa/scenario/test/integration/praefect.rb
399
402
  - lib/gitlab/qa/scenario/test/integration/registry.rb
400
403
  - lib/gitlab/qa/scenario/test/integration/registry_tls.rb