gitlab-qa 7.32.0 → 7.35.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.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.gitlab/ci/jobs/base.gitlab-ci.yml +0 -1
  3. data/.gitlab/ci/jobs/registry_with_cdn.gitlab-ci.yml +12 -0
  4. data/.rubocop_todo.yml +0 -7
  5. data/Dangerfile +2 -0
  6. data/Gemfile +2 -0
  7. data/Gemfile.lock +1 -1
  8. data/Rakefile +2 -0
  9. data/docs/what_tests_can_be_run.md +2 -1
  10. data/exe/gitlab-qa +1 -0
  11. data/exe/gitlab-qa-report +1 -0
  12. data/lib/gitlab/qa/component/base.rb +3 -1
  13. data/lib/gitlab/qa/component/elasticsearch.rb +3 -1
  14. data/lib/gitlab/qa/component/gitlab.rb +42 -24
  15. data/lib/gitlab/qa/component/internet_tunnel.rb +4 -2
  16. data/lib/gitlab/qa/component/jira.rb +4 -2
  17. data/lib/gitlab/qa/component/mail_hog.rb +3 -2
  18. data/lib/gitlab/qa/component/minio.rb +7 -5
  19. data/lib/gitlab/qa/component/postgresql.rb +4 -2
  20. data/lib/gitlab/qa/component/preprod.rb +3 -1
  21. data/lib/gitlab/qa/component/production.rb +3 -1
  22. data/lib/gitlab/qa/component/release.rb +3 -1
  23. data/lib/gitlab/qa/component/saml.rb +4 -2
  24. data/lib/gitlab/qa/component/specs.rb +2 -0
  25. data/lib/gitlab/qa/component/staging.rb +4 -2
  26. data/lib/gitlab/qa/component/staging_ref.rb +4 -2
  27. data/lib/gitlab/qa/docker/command.rb +7 -1
  28. data/lib/gitlab/qa/docker/engine.rb +10 -0
  29. data/lib/gitlab/qa/docker/shellout.rb +24 -14
  30. data/lib/gitlab/qa/docker/volumes.rb +3 -1
  31. data/lib/gitlab/qa/release.rb +6 -4
  32. data/lib/gitlab/qa/report/prepare_stage_reports.rb +2 -0
  33. data/lib/gitlab/qa/report/summary_table.rb +2 -0
  34. data/lib/gitlab/qa/report/update_screenshot_path.rb +2 -0
  35. data/lib/gitlab/qa/reporter.rb +2 -0
  36. data/lib/gitlab/qa/runtime/env.rb +9 -4
  37. data/lib/gitlab/qa/runtime/logger.rb +1 -1
  38. data/lib/gitlab/qa/scenario/actable.rb +2 -0
  39. data/lib/gitlab/qa/scenario/cli_commands.rb +3 -1
  40. data/lib/gitlab/qa/scenario/template.rb +2 -0
  41. data/lib/gitlab/qa/scenario/test/instance/airgapped.rb +2 -0
  42. data/lib/gitlab/qa/scenario/test/instance/any.rb +2 -0
  43. data/lib/gitlab/qa/scenario/test/instance/deployment_base.rb +2 -0
  44. data/lib/gitlab/qa/scenario/test/instance/geo.rb +2 -0
  45. data/lib/gitlab/qa/scenario/test/instance/image.rb +2 -0
  46. data/lib/gitlab/qa/scenario/test/instance/preprod.rb +2 -0
  47. data/lib/gitlab/qa/scenario/test/instance/production.rb +2 -0
  48. data/lib/gitlab/qa/scenario/test/instance/relative_url.rb +2 -0
  49. data/lib/gitlab/qa/scenario/test/instance/release.rb +2 -0
  50. data/lib/gitlab/qa/scenario/test/instance/repository_storage.rb +2 -0
  51. data/lib/gitlab/qa/scenario/test/instance/smoke.rb +2 -0
  52. data/lib/gitlab/qa/scenario/test/instance/staging.rb +2 -0
  53. data/lib/gitlab/qa/scenario/test/instance/staging_geo.rb +2 -0
  54. data/lib/gitlab/qa/scenario/test/instance/staging_ref.rb +2 -0
  55. data/lib/gitlab/qa/scenario/test/instance/staging_ref_geo.rb +2 -0
  56. data/lib/gitlab/qa/scenario/test/integration/client_ssl.rb +2 -0
  57. data/lib/gitlab/qa/scenario/test/integration/elasticsearch.rb +2 -0
  58. data/lib/gitlab/qa/scenario/test/integration/geo.rb +2 -0
  59. data/lib/gitlab/qa/scenario/test/integration/gitaly_cluster.rb +51 -27
  60. data/lib/gitlab/qa/scenario/test/integration/group_saml.rb +2 -0
  61. data/lib/gitlab/qa/scenario/test/integration/instance_saml.rb +2 -0
  62. data/lib/gitlab/qa/scenario/test/integration/jira.rb +2 -0
  63. data/lib/gitlab/qa/scenario/test/integration/kubernetes.rb +2 -0
  64. data/lib/gitlab/qa/scenario/test/integration/ldap.rb +8 -6
  65. data/lib/gitlab/qa/scenario/test/integration/ldap_no_server.rb +2 -0
  66. data/lib/gitlab/qa/scenario/test/integration/ldap_no_tls.rb +2 -0
  67. data/lib/gitlab/qa/scenario/test/integration/ldap_tls.rb +2 -0
  68. data/lib/gitlab/qa/scenario/test/integration/mattermost.rb +2 -0
  69. data/lib/gitlab/qa/scenario/test/integration/mtls.rb +2 -0
  70. data/lib/gitlab/qa/scenario/test/integration/praefect.rb +2 -0
  71. data/lib/gitlab/qa/scenario/test/integration/saml.rb +2 -0
  72. data/lib/gitlab/qa/scenario/test/integration/smtp.rb +2 -0
  73. data/lib/gitlab/qa/scenario/test/omnibus/image.rb +2 -0
  74. data/lib/gitlab/qa/scenario/test/omnibus/update.rb +2 -0
  75. data/lib/gitlab/qa/scenario/test/omnibus/upgrade.rb +2 -0
  76. data/lib/gitlab/qa/scenario/test/sanity/version.rb +2 -0
  77. data/lib/gitlab/qa/slack/post_to_slack.rb +2 -0
  78. data/lib/gitlab/qa/support/dev_ee_qa_image.rb +3 -1
  79. data/lib/gitlab/qa/support/get_request.rb +2 -0
  80. data/lib/gitlab/qa/support/http_request.rb +2 -0
  81. data/lib/gitlab/qa/support/invalid_response_error.rb +2 -0
  82. data/lib/gitlab/qa/version.rb +1 -1
  83. data/lib/gitlab/qa.rb +4 -0
  84. data/scripts/generate-qa-jobs.rb +1 -0
  85. data/support/data/license_usage_seed.rb +2 -1
  86. metadata +2 -2
@@ -1,6 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'active_support/core_ext/object/blank'
2
4
  require 'securerandom'
3
- require 'rainbow/refinement'
4
5
 
5
6
  module Gitlab
6
7
  module QA
@@ -142,7 +143,9 @@ module Gitlab
142
143
  attr_writer(method_name)
143
144
 
144
145
  define_method(method_name) do
145
- env_var_value_if_defined(env_name) || (instance_variable_get("@#{method_name}") if instance_variable_defined?("@#{method_name}"))
146
+ env_var_value_if_defined(env_name) || (if instance_variable_defined?("@#{method_name}")
147
+ instance_variable_get("@#{method_name}")
148
+ end)
146
149
  end
147
150
  end
148
151
 
@@ -220,11 +223,13 @@ module Gitlab
220
223
  end
221
224
 
222
225
  def host_artifacts_dir
223
- @host_artifacts_dir ||= File.join(env_var_value_if_defined('QA_ARTIFACTS_DIR') || '/tmp/gitlab-qa', Runtime::Env.run_id)
226
+ @host_artifacts_dir ||= File.join(
227
+ env_var_value_if_defined('QA_ARTIFACTS_DIR') || '/tmp/gitlab-qa', Runtime::Env.run_id
228
+ )
224
229
  end
225
230
 
226
231
  def elastic_version
227
- env_var_value_if_defined('ELASTIC_VERSION') || '7.17.0'.freeze
232
+ env_var_value_if_defined('ELASTIC_VERSION') || '7.17.0'
228
233
  end
229
234
 
230
235
  def require_license!
@@ -16,7 +16,7 @@ module Gitlab
16
16
  log_path = Env.log_path
17
17
  ::FileUtils.mkdir_p(log_path) unless File.exist?(log_path)
18
18
 
19
- TestLogger.logger(level: Env.debug? ? "DEBUG" : Env.log_level, path: log_path)
19
+ TestLogger.logger(level: Env.log_level, path: log_path)
20
20
  end
21
21
  end
22
22
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
4
6
  module CLICommands
5
- GIT_LFS_VERSION = '2.8.0'.freeze
7
+ GIT_LFS_VERSION = '2.8.0'
6
8
 
7
9
  def self.git_lfs_install_commands
8
10
  [
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -20,28 +22,14 @@ module Gitlab
20
22
  end
21
23
 
22
24
  def perform(release, *rspec_args)
23
- gitaly_primary_node = gitaly(@primary_node_name, release)
24
- gitaly_secondary_node = gitaly(@secondary_node_name, release)
25
- gitaly_tertiary_node = gitaly(@tertiary_node_name, release)
26
-
27
- sql_node = Component::PostgreSQL.new.tap do |sql|
28
- sql.name = @database
29
- sql.network = @network
30
- sql.instance(skip_teardown: true) do
31
- sql.run_psql '-d template1 -c "CREATE DATABASE praefect_production OWNER postgres"'
32
- end
33
- end
34
-
35
- praefect_node = Component::Gitlab.new.tap do |praefect|
36
- praefect.release = QA::Release.new(release)
37
- praefect.name = @praefect_node_name
38
- praefect.network = @network
39
- praefect.skip_availability_check = true
40
- praefect.seed_admin_token = false
41
-
42
- praefect.omnibus_configuration << praefect_omnibus_configuration
43
-
44
- praefect.instance(skip_teardown: true)
25
+ # The postgres container starts in seconds so not essential to parallelize it
26
+ # This also ensure that the docker network is created here, avoiding any potential race conditions later
27
+ # if the gitaly-cluster and GitLab containers attempt to create a network in parallel
28
+ @sql_node = postgres
29
+
30
+ gitaly_cluster = Thread.new do
31
+ Thread.current.abort_on_exception = true
32
+ start_gitaly_cluster(release)
45
33
  end
46
34
 
47
35
  Component::Gitlab.perform do |gitlab|
@@ -51,6 +39,8 @@ module Gitlab
51
39
 
52
40
  gitlab.omnibus_configuration << gitlab_omnibus_configuration
53
41
  gitlab.instance do
42
+ # Wait for gitaly cluster to finish booting, before attempting to run specs
43
+ gitaly_cluster.join
54
44
  Runtime::Logger.info('Running Gitaly Cluster specs!')
55
45
 
56
46
  if @tag
@@ -68,15 +58,25 @@ module Gitlab
68
58
  end
69
59
  end
70
60
  ensure
71
- praefect_node&.teardown
72
- sql_node&.teardown
73
- gitaly_primary_node&.teardown
74
- gitaly_secondary_node&.teardown
75
- gitaly_tertiary_node&.teardown
61
+ @praefect_node&.teardown
62
+ @sql_node&.teardown
63
+ @gitaly_primary_node&.teardown
64
+ @gitaly_secondary_node&.teardown
65
+ @gitaly_tertiary_node&.teardown
76
66
  end
77
67
 
78
68
  private
79
69
 
70
+ def start_gitaly_cluster(release)
71
+ Runtime::Logger.info("Starting Gitaly Cluster")
72
+ @gitaly_primary_node = gitaly(@primary_node_name, release)
73
+ @gitaly_secondary_node = gitaly(@secondary_node_name, release)
74
+ @gitaly_tertiary_node = gitaly(@tertiary_node_name, release)
75
+
76
+ @praefect_node = praefect(@praefect_node_name, release)
77
+ Runtime::Logger.info("Gitaly Cluster Ready")
78
+ end
79
+
80
80
  def disable_other_services
81
81
  <<~OMNIBUS
82
82
  postgresql['enable'] = false;
@@ -191,6 +191,30 @@ module Gitlab
191
191
  OMNIBUS
192
192
  end
193
193
 
194
+ def praefect(name, release)
195
+ Component::Gitlab.new.tap do |praefect|
196
+ praefect.release = QA::Release.new(release)
197
+ praefect.name = name
198
+ praefect.network = @network
199
+ praefect.skip_availability_check = true
200
+ praefect.seed_admin_token = false
201
+
202
+ praefect.omnibus_configuration << praefect_omnibus_configuration
203
+
204
+ praefect.instance(skip_teardown: true)
205
+ end
206
+ end
207
+
208
+ def postgres
209
+ Component::PostgreSQL.new.tap do |sql|
210
+ sql.name = @database
211
+ sql.network = @network
212
+ sql.instance(skip_teardown: true) do
213
+ sql.run_psql '-d template1 -c "CREATE DATABASE praefect_production OWNER postgres"'
214
+ end
215
+ end
216
+ end
217
+
194
218
  def gitaly(name, release)
195
219
  Component::Gitlab.new.tap do |gitaly|
196
220
  gitaly.release = QA::Release.new(release)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
4
 
3
5
  module Gitlab
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
4
 
3
5
  module Gitlab
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
4
 
3
5
  module Gitlab
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
4
 
3
5
  module Gitlab
@@ -8,12 +10,12 @@ module Gitlab
8
10
  class LDAP < Scenario::Template
9
11
  LDAP_PORT = 389
10
12
  LDAP_TLS_PORT = 636
11
- BASE_DN = 'dc=example,dc=org'.freeze
12
- BIND_DN = 'cn=admin,dc=example,dc=org'.freeze
13
- GROUP_BASE = 'ou=Global Groups,dc=example,dc=org'.freeze
14
- ADMIN_GROUP = 'AdminGroup'.freeze
15
- ADMIN_USER = 'admin'.freeze
16
- ADMIN_PASSWORD = 'admin'.freeze
13
+ BASE_DN = 'dc=example,dc=org'
14
+ BIND_DN = 'cn=admin,dc=example,dc=org'
15
+ GROUP_BASE = 'ou=Global Groups,dc=example,dc=org'
16
+ ADMIN_GROUP = 'AdminGroup'
17
+ ADMIN_USER = 'admin'
18
+ ADMIN_PASSWORD = 'admin'
17
19
 
18
20
  attr_reader :gitlab_name, :spec_suite, :tls, :ldap_name, :network, :orchestrate_ldap_server
19
21
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
4
 
3
5
  module Gitlab
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
4
 
3
5
  module Gitlab
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
4
 
3
5
  module Gitlab
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'yaml'
2
4
 
3
5
  module Gitlab
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Scenario
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'tmpdir'
2
4
  require 'fileutils'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'tmpdir'
2
4
  require 'fileutils'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'json'
2
4
  require 'net/http'
3
5
  require 'cgi'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Slack
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'json'
2
4
  require 'uri'
3
5
 
@@ -7,7 +9,7 @@ module Gitlab
7
9
  class DevEEQAImage
8
10
  attr_reader :base_url
9
11
 
10
- DEV_ADDRESS = 'https://dev.gitlab.org'.freeze
12
+ DEV_ADDRESS = 'https://dev.gitlab.org'
11
13
  GITLAB_EE_QA_REPOSITORY_ID = 55
12
14
  QAImageNotFoundError = Class.new(StandardError)
13
15
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'net/http'
2
4
  require 'uri'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'http'
2
4
  require 'json'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Support
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  module QA
5
- VERSION = '7.32.0'
5
+ VERSION = '7.35.0'
6
6
  end
7
7
  end
data/lib/gitlab/qa.rb CHANGED
@@ -1,3 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rainbow/refinement'
4
+
1
5
  module Gitlab
2
6
  module QA
3
7
  autoload :Release, 'gitlab/qa/release'
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'yaml'
4
5
 
@@ -48,7 +48,8 @@ class LicenseUsageSeed
48
48
  end
49
49
 
50
50
  def self.create_member(user, group_id)
51
- roles = Gitlab::Access.values
51
+ # Excludes GUEST role based on ultimate license seat count
52
+ roles = [Gitlab::Access::REPORTER, Gitlab::Access::DEVELOPER, Gitlab::Access::MAINTAINER]
52
53
 
53
54
  GroupMember.create(user_id: user.id, access_level: roles.sample, source_id: group_id)
54
55
  Users::UpdateHighestMemberRoleService.new(user).execute
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.32.0
4
+ version: 7.35.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-09 00:00:00.000000000 Z
11
+ date: 2022-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control