gitlab-qa 7.0.1 → 7.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: 748a1ab7cef2f22dba11a3989e6ff8216eab6bc06eb017b1ba52ee9fbfff031c
4
- data.tar.gz: 3e95822a025fb825039e3615548eab3f5ba6046b340fdecf7fc5d65c8e16b912
3
+ metadata.gz: cbdcaeeeaa99ad4d6e7c479db9acaadc8f25e62f4fa17c4f6861d9b7be98fe2a
4
+ data.tar.gz: 890d74307cac468dae04a9108d80ca147a1c4f44fb14fc2301055d459f53cf06
5
5
  SHA512:
6
- metadata.gz: b80fc3ecf1eb1934126ed816b73c7f73d55a9364fec8afe035bb7d36c34d99e25003f036dba237dea3e6888102948aa303e3d18d931ae92b72ef306b1538bee6
7
- data.tar.gz: 7997a9183233fa52f52e7cf71b6a8a43577ae0631297244a2b9ac20d65a17ad4e7a300ea9af3361a67681be668e7b252e95d27ed1a458b8294ec4af56cea1800
6
+ metadata.gz: 903a50594c371873590470df3f8fc3fac516f29c086befd61c14bc2dbd17c87aa5e8a88d4792762fffa895e7b2caf8dd8670a37cde20fad527c7b75719759457
7
+ data.tar.gz: 59106ca07a8da61737bcaa482e0da8222fd6be52b5b0ee12f250be4cf0de0d55e99dbf6253ad712a049612e61f30253988690aba955648a7a0a3713d72468a23
data/.gitlab-ci.yml CHANGED
@@ -739,6 +739,7 @@ ee:object_storage:
739
739
  - .rspec-report-opts
740
740
  variables:
741
741
  GITLAB_QA_OPTS: "--omnibus-config object_storage"
742
+ QA_RSPEC_TAGS: "--tag object_storage"
742
743
 
743
744
  ee:object_storage-quarantine:
744
745
  extends:
@@ -749,6 +750,7 @@ ee:object_storage-quarantine:
749
750
  - .rspec-report-opts
750
751
  variables:
751
752
  GITLAB_QA_OPTS: "--omnibus-config object_storage"
753
+ QA_RSPEC_TAGS: "--tag quarantine --tag object_storage"
752
754
 
753
755
  ee:packages:
754
756
  extends:
@@ -758,6 +760,7 @@ ee:packages:
758
760
  - .rspec-report-opts
759
761
  variables:
760
762
  GITLAB_QA_OPTS: "--omnibus-config packages"
763
+ QA_RSPEC_TAGS: "--tag packages"
761
764
 
762
765
  ee:packages-quarantine:
763
766
  extends:
@@ -768,6 +771,7 @@ ee:packages-quarantine:
768
771
  - .rspec-report-opts
769
772
  variables:
770
773
  GITLAB_QA_OPTS: "--omnibus-config packages"
774
+ QA_RSPEC_TAGS: "--tag quarantine --tag packages"
771
775
 
772
776
  ce:actioncable:
773
777
  extends:
@@ -85,6 +85,7 @@ All environment variables used by GitLab QA should be defined in [`lib/gitlab/qa
85
85
  | `DEPLOY_VERSION` |- | The version of GitLab being tested against. | No|
86
86
  | `GITLAB_QA_USER_AGENT` |- | The browser user-agent to use instead of the default Chrome user-agent. | No|
87
87
  | `GEO_FAILOVER` | `false` | Set to `true` when a Geo secondary site has been promoted to a Geo primary site. | No|
88
+ | `GITLAB_INITIAL_ROOT_PASSWORD` | `5iveL!fe` | Initial root password for Omnibus installations | No|
88
89
 
89
90
 
90
91
  ## [Supported Remote Grid environment variables](./running_against_remote_grid.md)
@@ -78,7 +78,7 @@ module Gitlab
78
78
  end
79
79
 
80
80
  def start # rubocop:disable Metrics/AbcSize
81
- docker.run(image, tag) do |command|
81
+ docker.run(image: image, tag: tag) do |command|
82
82
  command << "-d"
83
83
  command << "--name #{name}"
84
84
  command << "--net #{network}"
@@ -129,7 +129,7 @@ module Gitlab
129
129
  def pull
130
130
  return if Runtime::Env.skip_pull?
131
131
 
132
- docker.pull(image, tag)
132
+ docker.pull(image: image, tag: tag)
133
133
  end
134
134
 
135
135
  def process_exec_commands
@@ -13,7 +13,7 @@ module Gitlab
13
13
  end
14
14
 
15
15
  def start
16
- @docker.run(image, tag) do |command|
16
+ @docker.run(image: image, tag: tag) do |command|
17
17
  command << "-d"
18
18
  command << "--name #{name}"
19
19
  command << "--net #{network}"
@@ -33,7 +33,7 @@ module Gitlab
33
33
  @volumes[GITLAB_CERTIFICATES_PATH] = SSL_PATH
34
34
  @volumes[AUTHORITY_CERTIFICATES_PATH] = TRUSTED_PATH
35
35
 
36
- @omnibus_configuration ||= OmnibusConfiguration.new
36
+ @omnibus_configuration ||= Runtime::OmnibusConfiguration.new(Runtime::Scenario.omnibus_configuration)
37
37
 
38
38
  self.release = 'CE'
39
39
  end
@@ -100,7 +100,7 @@ module Gitlab
100
100
  def start # rubocop:disable Metrics/AbcSize
101
101
  ensure_configured!
102
102
 
103
- docker.run(image, tag) do |command|
103
+ docker.run(image: image, tag: tag) do |command|
104
104
  command << "-d -p #{port}"
105
105
  command << "--name #{name}"
106
106
  command << "--net #{network}"
@@ -206,20 +206,6 @@ module Gitlab
206
206
  @uri.scheme == 'https' ? { use_ssl: true, verify_mode: OpenSSL::SSL::VERIFY_NONE } : {}
207
207
  end
208
208
  end
209
-
210
- class OmnibusConfiguration
211
- def initialize
212
- @config = Runtime::Scenario.attributes[:omnibus_configuration] || []
213
- end
214
-
215
- def <<(configuration)
216
- @config << configuration
217
- end
218
-
219
- def to_s
220
- @config.to_s
221
- end
222
- end
223
209
  end
224
210
  end
225
211
  end
@@ -49,7 +49,10 @@ module Gitlab
49
49
  def start
50
50
  raise "Must set gitlab_hostname" unless @gitlab_hostname
51
51
 
52
- @docker.run(DOCKER_IMAGE, DOCKER_IMAGE_TAG, "-o StrictHostKeyChecking=no -N -R #{subdomain}:#{@gitlab_hostname}:80 #{ENV.fetch('TUNNEL_SSH_USER')}@#{tunnel_server_hostname}") do |command|
52
+ @docker.run(
53
+ image: DOCKER_IMAGE,
54
+ tag: DOCKER_IMAGE_TAG,
55
+ args: ["-o StrictHostKeyChecking=no -N -R #{subdomain}:#{@gitlab_hostname}:80 #{ENV.fetch('TUNNEL_SSH_USER')}@#{tunnel_server_hostname}"]) do |command|
53
56
  command << '-d '
54
57
  command << "--name #{name}"
55
58
  command << "--net #{network}"
@@ -16,7 +16,7 @@ module Gitlab
16
16
  end
17
17
 
18
18
  def start
19
- docker.run(image, tag) do |command|
19
+ docker.run(image: image, tag: tag) do |command|
20
20
  command << '-d '
21
21
  command << "--name #{name}"
22
22
  command << "--net #{network}"
@@ -63,7 +63,7 @@ module Gitlab
63
63
  def start
64
64
  # copy-service needed for bootstraping LDAP user:
65
65
  # https://github.com/osixia/docker-openldap#seed-ldap-database-with-ldif
66
- docker.run(image, tag, '--copy-service') do |command|
66
+ docker.run(image: image, tag: tag, args: ['--copy-service']) do |command|
67
67
  command << '-d '
68
68
  command << "--name #{name}"
69
69
  command << "--net #{network}"
@@ -19,7 +19,7 @@ module Gitlab
19
19
  end
20
20
 
21
21
  def start
22
- docker.run(image, tag) do |command|
22
+ docker.run(image: image, tag: tag) do |command|
23
23
  command << '-d '
24
24
  command << "--name #{name}"
25
25
  command << "--net #{network}"
@@ -70,7 +70,7 @@ module Gitlab
70
70
  def start # rubocop:disable Metrics/AbcSize
71
71
  # --compat needed until https://gitlab.com/gitlab-org/gitlab-workhorse/issues/210
72
72
  # is resolved
73
- docker.run(image, tag, "server", "--compat", DATA_DIR) do |command|
73
+ docker.run(image: image, tag: tag, args: ["server", "--compat", DATA_DIR]) do |command|
74
74
  command << '-d '
75
75
  command << "--name #{name}"
76
76
  command << "--net #{network}"
@@ -10,7 +10,7 @@ module Gitlab
10
10
  end
11
11
 
12
12
  def start
13
- @docker.run(image, tag) do |command|
13
+ @docker.run(image: image, tag: tag) do |command|
14
14
  command << "-d"
15
15
  command << "--name #{name}"
16
16
  command << "--net #{network}"
@@ -34,7 +34,7 @@ module Gitlab
34
34
 
35
35
  # rubocop:disable Metrics/AbcSize
36
36
  def start
37
- docker.run(image, tag) do |command|
37
+ docker.run(image: image, tag: tag) do |command|
38
38
  command << '-d '
39
39
  command << "--name #{name}"
40
40
  command << "--net #{network}"
@@ -23,7 +23,7 @@ module Gitlab
23
23
 
24
24
  @docker.login(**release.login_params) if release.login_params
25
25
 
26
- @docker.pull(qa_image) unless Runtime::Env.skip_pull?
26
+ @docker.pull(image: qa_image) unless Runtime::Env.skip_pull?
27
27
 
28
28
  puts "Running test suite `#{suite}` for #{release.project_name}"
29
29
 
@@ -43,7 +43,7 @@ module Gitlab
43
43
  feature_flag_sets << [] unless feature_flag_sets.any?
44
44
 
45
45
  feature_flag_sets.each do |feature_flag_set|
46
- @docker.run(qa_image, nil, suite, *args_with_flags(args, feature_flag_set)) do |command|
46
+ @docker.run(image: qa_image, args: [suite, *args_with_flags(args, feature_flag_set)]) do |command|
47
47
  command << "-t --rm --net=#{network || 'bridge'}"
48
48
 
49
49
  env.merge(Runtime::Env.variables).each do |key, value|
@@ -15,11 +15,11 @@ module Gitlab
15
15
  Docker::Command.execute(%(login --username "#{username}" --password "#{password}" #{registry}), mask_secrets: password)
16
16
  end
17
17
 
18
- def pull(image, tag = nil)
18
+ def pull(image:, tag: nil)
19
19
  Docker::Command.execute("pull #{full_image_name(image, tag)}")
20
20
  end
21
21
 
22
- def run(image, tag, *args)
22
+ def run(image:, tag: nil, args: [])
23
23
  Docker::Command.new('run').tap do |command|
24
24
  yield command if block_given?
25
25
 
@@ -57,7 +57,10 @@ module Gitlab
57
57
  end
58
58
  end
59
59
 
60
- args.reject! { |arg| gitlab_qa_options.include?(arg) }
60
+ # Remove arguments passed into GitLab QA preventing them from being
61
+ # passed into the specs
62
+ args = remove_gitlab_qa_args(args)
63
+
61
64
  if args.size >= 1
62
65
  load_omnibus_configurations
63
66
 
@@ -79,7 +82,22 @@ module Gitlab
79
82
  end
80
83
 
81
84
  def self.gitlab_qa_options
82
- @gitlab_qa_options ||= @options.top.list.map(&:long).flatten
85
+ @gitlab_qa_options ||= @options.top.list
86
+ end
87
+
88
+ # Take a set of arguments and remove them from the set of
89
+ # predefined GitLab QA arguments
90
+ # @param args Array the arguments to parse through and remove GitLab QA opts
91
+ # @return Arguments to be passed ultimately to the RSpec runner
92
+ def self.remove_gitlab_qa_args(args)
93
+ args.each_with_index do |arg, i|
94
+ gitlab_qa_options.each do |opt|
95
+ next unless opt.long.flatten.first == arg
96
+
97
+ args[i] = nil
98
+ args[i + 1] = nil if opt.is_a? OptionParser::Switch::RequiredArgument
99
+ end
100
+ end.compact
83
101
  end
84
102
 
85
103
  def self.load_omnibus_configurations
@@ -100,8 +118,8 @@ module Gitlab
100
118
  end
101
119
  rescue NameError
102
120
  raise <<~ERROR
103
- Invalid Omnibus Configuration `#{config}`.
104
- Possible configurations: #{Runtime::OmnibusConfigurations.constants.map { |c| c.to_s.underscore }.join(',')}"
121
+ Invalid Omnibus Configuration `#{config}`.
122
+ Possible configurations: #{Runtime::OmnibusConfigurations.constants.map { |c| c.to_s.underscore }.join(',')}"
105
123
  ERROR
106
124
  end
107
125
  end
@@ -90,7 +90,8 @@ module Gitlab
90
90
  'CACHE_NAMESPACE_NAME' => :cache_namespace_name,
91
91
  'DEPLOY_VERSION' => :deploy_version,
92
92
  'GITLAB_QA_USER_AGENT' => :gitlab_qa_user_agent,
93
- 'GEO_FAILOVER' => :geo_failover
93
+ 'GEO_FAILOVER' => :geo_failover,
94
+ 'GITLAB_INITIAL_ROOT_PASSWORD' => :initial_root_password
94
95
  }.freeze
95
96
 
96
97
  ENV_VARIABLES.each do |env_name, method_name|
@@ -189,7 +190,7 @@ module Gitlab
189
190
  end
190
191
 
191
192
  def initial_root_password
192
- ENV['GITLAB_INITIAL_ROOT_PASSWORD']
193
+ ENV['GITLAB_INITIAL_ROOT_PASSWORD'] || '5iveL!fe'
193
194
  end
194
195
 
195
196
  def qa_container_registry_access_token
@@ -6,8 +6,18 @@ module Gitlab
6
6
  module QA
7
7
  module Runtime
8
8
  class OmnibusConfiguration
9
- def initialize
9
+ # @param prefixed_config The configuration to be prefixed to the new configuration
10
+ def initialize(prefixed_config = nil)
10
11
  @config = ["# Generated by GitLab QA Omnibus Configurator at #{Time.now.strftime('%Y-%m-%d %H:%M:%S')}"]
12
+
13
+ return unless prefixed_config
14
+
15
+ # remove generation statement if it exists within the prefixed configuration that was passed
16
+ # and insert the rest AFTER the very first generation statement
17
+ config_to_insert = prefixed_config.to_s
18
+ generation_regexp = /# Generated by GitLab QA Omnibus Configurator.*\n/
19
+ config_to_insert = config_to_insert.gsub(generation_regexp, '') if config_to_insert.match?(generation_regexp)
20
+ @config.insert(1, config_to_insert)
11
21
  end
12
22
 
13
23
  def to_s
@@ -28,7 +38,7 @@ module Gitlab
28
38
  []
29
39
  end
30
40
 
31
- # Ensures no duplicate entries
41
+ # Ensures no duplicate entries and sanitizes configurations
32
42
  # @raise RuntimeError if competing configurations exist
33
43
  # rubocop:disable Metrics/AbcSize
34
44
  def sanitize!
@@ -12,6 +12,7 @@ module Gitlab
12
12
  gitlab_rails['gitlab_default_theme'] = 10 # Light Red Theme
13
13
  gitlab_rails['gitlab_disable_animations'] = true # Disable animations
14
14
  gitlab_rails['application_settings_cache_seconds'] = 0 # Settings cache expiry
15
+ gitlab_rails['initial_root_password'] = '#{Runtime::Env.initial_root_password}' # Initial root password
15
16
  OMNIBUS
16
17
  end
17
18
 
@@ -1,5 +1,5 @@
1
1
  module Gitlab
2
2
  module QA
3
- VERSION = '7.0.1'.freeze
3
+ VERSION = '7.1.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-qa
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.1
4
+ version: 7.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: 2021-03-25 00:00:00.000000000 Z
11
+ date: 2021-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control