gitlab-qa 7.24.2 → 7.24.3

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: 862c31bca6760f872b719b43ff2acc508f5155af1ad8a8763ff9acec9097629f
4
- data.tar.gz: fb705f83636c4702e7f307b5fa445146227bd81525f6bce14dcd82e1da225a2d
3
+ metadata.gz: e2b176f3463abe8bce6879fad13baf9053f8d51175ce9b4c2994b2ad72a308b5
4
+ data.tar.gz: a93d60ad2678d98b2e94e89e2c97cc24c1a81b42e5e838f5eaa20285a92a92a1
5
5
  SHA512:
6
- metadata.gz: edd01e95ac436a768eaf06b6b84ef19b9e07a95067a8e48244cc96450168606741cd75c111517209a4a8c3d58ca41883684b76ad974426fae5b345fbdd15f8dc
7
- data.tar.gz: d49d870521be04c0a729841c9bc51d6610049eac7df2274ff7f87d18cefe4f98bebede511982bd819e618c664b102578ddc152249ff1e3ad1f8e8db5717bec95
6
+ metadata.gz: a6739f73c98c6fc9e044915632a747d990d1f1bb354eaaf77bb0de4d6c6c5abbaffda10a8f60927757a16ca48affc3dca2b8aa8a6bf4f4e6b6977eda9c3b4c20
7
+ data.tar.gz: 17379496d96c009b6c96ea8953a38bacb253eb6ac80006889557bb068a6270991100926601936dcddd92cf02dca6ea7c3159990a6f3264e601803d5460394259
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gitlab
2
4
  module QA
3
5
  module Component
@@ -18,9 +18,7 @@ module Gitlab
18
18
 
19
19
  def_delegators :release, :tag, :image, :edition
20
20
 
21
- AUTHORITY_CERTIFICATES_PATH = File.expand_path('../../../../tls_certificates/authority', __dir__)
22
- GITLAB_CERTIFICATES_PATH = File.expand_path('../../../../tls_certificates/gitlab', __dir__)
23
- GITALY_CERTIFICATES_PATH = File.expand_path('../../../../tls_certificates/gitaly', __dir__)
21
+ CERTIFICATES_PATH = File.expand_path('../../../../tls_certificates', __dir__)
24
22
 
25
23
  SSL_PATH = '/etc/gitlab/ssl'
26
24
  TRUSTED_PATH = '/etc/gitlab/trusted-certs'
@@ -31,10 +29,15 @@ module Gitlab
31
29
  @skip_availability_check = false
32
30
  @omnibus_gitlab_rails_env = {}
33
31
 
34
- @volumes[GITLAB_CERTIFICATES_PATH] = SSL_PATH
35
- @volumes[AUTHORITY_CERTIFICATES_PATH] = TRUSTED_PATH
32
+ @omnibus_configuration = Runtime::OmnibusConfiguration.new(Runtime::Scenario.omnibus_configuration)
36
33
 
37
- @omnibus_configuration ||= Runtime::OmnibusConfiguration.new(Runtime::Scenario.omnibus_configuration)
34
+ @working_dir_tmp_cert_path = Dir.mktmpdir('certs', FileUtils.mkdir_p("#{Dir.pwd}/tmp"))
35
+ @authority_cert_path = "#{@working_dir_tmp_cert_path}/authority"
36
+ @gitlab_cert_path = "#{@working_dir_tmp_cert_path}/gitlab"
37
+ @gitaly_cert_path = "#{@working_dir_tmp_cert_path}/gitaly"
38
+
39
+ @volumes[@gitlab_cert_path] = SSL_PATH
40
+ @volumes[@authority_cert_path] = TRUSTED_PATH
38
41
 
39
42
  self.release = 'CE'
40
43
  end
@@ -77,8 +80,8 @@ module Gitlab
77
80
  end
78
81
 
79
82
  def gitaly_tls
80
- @volumes.delete(GITLAB_CERTIFICATES_PATH)
81
- @volumes[GITALY_CERTIFICATES_PATH] = SSL_PATH
83
+ @volumes.delete(@gitlab_cert_path)
84
+ @volumes[@gitaly_cert_path] = SSL_PATH
82
85
  end
83
86
 
84
87
  def relative_path
@@ -91,6 +94,13 @@ module Gitlab
91
94
 
92
95
  def prepare
93
96
  prepare_gitlab_omnibus_config
97
+ copy_certificates
98
+
99
+ super
100
+ end
101
+
102
+ def teardown!
103
+ FileUtils.rm_rf(@working_dir_tmp_cert_path)
94
104
 
95
105
  super
96
106
  end
@@ -168,6 +178,14 @@ module Gitlab
168
178
 
169
179
  private
170
180
 
181
+ # Copy certs to a temporary directory in current working directory.
182
+ # This is needed for docker-in-docker ci environments where mount points outside of build dir are not accessible
183
+ #
184
+ # @return [void]
185
+ def copy_certificates
186
+ FileUtils.cp_r("#{CERTIFICATES_PATH}/.", @working_dir_tmp_cert_path)
187
+ end
188
+
171
189
  def ensure_configured!
172
190
  raise 'Please configure an instance first!' unless [name, release, network].all?
173
191
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'securerandom'
2
4
 
3
5
  # This component sets up the docker-openldap (https://github.com/osixia/docker-openldap)
@@ -16,18 +18,12 @@ module Gitlab
16
18
  module QA
17
19
  module Component
18
20
  class LDAP < Base
19
- DOCKER_IMAGE = 'osixia/openldap'.freeze
20
- DOCKER_IMAGE_TAG = 'latest'.freeze
21
- LDAP_USER = 'tanuki'.freeze
22
- LDAP_PASSWORD = 'password'.freeze
23
- BOOTSTRAP_LDIF = '/container/service/slapd/assets/config/bootstrap/ldif/custom'.freeze
24
- FIXTURE_PATH = File.expand_path('../../../../fixtures/ldap'.freeze, __dir__)
25
-
26
- def initialize
27
- super
28
-
29
- @volumes[FIXTURE_PATH] = BOOTSTRAP_LDIF
30
- end
21
+ DOCKER_IMAGE = 'osixia/openldap'
22
+ DOCKER_IMAGE_TAG = 'latest'
23
+ LDAP_USER = 'tanuki'
24
+ LDAP_PASSWORD = 'password'
25
+ BOOTSTRAP_LDIF = '/container/service/slapd/assets/config/bootstrap/ldif/custom'
26
+ FIXTURE_PATH = File.expand_path('../../../../fixtures/ldap', __dir__)
31
27
 
32
28
  # LDAP_TLS is true by default
33
29
  def tls=(status)
@@ -59,6 +55,19 @@ module Gitlab
59
55
  super
60
56
  end
61
57
 
58
+ def prepare
59
+ copy_fixtures
60
+ @volumes["#{working_dir_tmp_fixture_path}/ldap"] = BOOTSTRAP_LDIF
61
+
62
+ super
63
+ end
64
+
65
+ def teardown!
66
+ FileUtils.rm_rf(working_dir_tmp_fixture_path)
67
+
68
+ super
69
+ end
70
+
62
71
  # rubocop:disable Metrics/AbcSize
63
72
  def start
64
73
  # copy-service needed for bootstraping LDAP user:
@@ -88,6 +97,23 @@ module Gitlab
88
97
  ::Gitlab::QA::Runtime::Env.ldap_username = username
89
98
  ::Gitlab::QA::Runtime::Env.ldap_password = password
90
99
  end
100
+
101
+ private
102
+
103
+ # Temporary fixture dir in working directory
104
+ #
105
+ # @return [String]
106
+ def working_dir_tmp_fixture_path
107
+ @local_fixture_path ||= Dir.mktmpdir('ldap', FileUtils.mkdir_p("#{Dir.pwd}/tmp"))
108
+ end
109
+
110
+ # Copy fixtures to current working directory
111
+ # This is needed for docker-in-docker ci environments where mount points outside of build dir are not accessible
112
+ #
113
+ # @return [void]
114
+ def copy_fixtures
115
+ FileUtils.cp_r(FIXTURE_PATH, working_dir_tmp_fixture_path)
116
+ end
91
117
  end
92
118
  end
93
119
  end
@@ -106,8 +106,14 @@ module Gitlab
106
106
  def up_to_date_labels(test:, issue: nil, new_labels: Set.new)
107
107
  labels = issue_labels(issue)
108
108
  labels |= new_labels
109
- ee_test?(test) ? labels << "Enterprise Edition" : labels.delete("Enterprise Edition")
110
- quarantine_job? ? labels << "quarantine" : labels.delete("quarantine")
109
+ ee_test?(test) ? labels << 'Enterprise Edition' : labels.delete('Enterprise Edition')
110
+
111
+ if test.quarantine?
112
+ labels << 'quarantine'
113
+ labels << "quarantine::#{test.quarantine_type}"
114
+ else
115
+ labels.delete_if { |label| label.include?('quarantine') }
116
+ end
111
117
 
112
118
  labels
113
119
  end
@@ -133,10 +139,6 @@ module Gitlab
133
139
  test.file =~ %r{features/ee/(api|browser_ui)}
134
140
  end
135
141
 
136
- def quarantine_job?
137
- Runtime::Env.ci_job_name&.include?('quarantine')
138
- end
139
-
140
142
  def partial_file_path(path)
141
143
  path.match(/((api|browser_ui).*)/i)[1]
142
144
  end
@@ -100,7 +100,6 @@ module Gitlab
100
100
 
101
101
  def failure_summary
102
102
  summary = [":x: ~\"#{pipeline}::failed\""]
103
- summary << "~\"quarantine\"" if quarantine_job?
104
103
  summary << "in job `#{Runtime::Env.ci_job_name}` in #{Runtime::Env.ci_job_url}"
105
104
  summary.join(' ')
106
105
  end
@@ -30,6 +30,7 @@ module Gitlab
30
30
 
31
31
  def update_testcase(testcase, test)
32
32
  puts "Test case labels updated." if update_labels(testcase, test)
33
+ puts "Test case quarantine section updated." if update_quarantine_link(testcase, test)
33
34
  end
34
35
 
35
36
  private
@@ -61,7 +62,9 @@ module Gitlab
61
62
  end
62
63
 
63
64
  def new_issue_description(test)
64
- "#{super}\n\n#{execution_graph_section(test)}"
65
+ quarantine_section = test.quarantine? && test.quarantine_issue ? "\n\n### Quarantine issue\n\n#{test.quarantine_issue}" : ''
66
+
67
+ "#{super}#{quarantine_section}\n\n#{execution_graph_section(test)}"
65
68
  end
66
69
 
67
70
  def execution_graph_section(test)
@@ -84,6 +87,24 @@ module Gitlab
84
87
  def issue_title_needs_updating?(testcase, test)
85
88
  super || !testcase.description.include?(execution_graph_section(test)) && !%w[canary production preprod release].include?(pipeline)
86
89
  end
90
+
91
+ def quarantine_link_needs_updating?(testcase, test)
92
+ if test.quarantine? && test.quarantine_issue
93
+ return false if testcase.description.include?(test.quarantine_issue)
94
+ else
95
+ return false unless testcase.description.include?('Quarantine issue')
96
+ end
97
+
98
+ true
99
+ end
100
+
101
+ def update_quarantine_link(testcase, test)
102
+ return unless quarantine_link_needs_updating?(testcase, test)
103
+
104
+ new_description = updated_description(testcase, test)
105
+
106
+ gitlab.edit_issue(iid: testcase.iid, options: { description: new_description })
107
+ end
87
108
  end
88
109
  end
89
110
  end
@@ -87,6 +87,14 @@ module Gitlab
87
87
  report['quarantine'].present?
88
88
  end
89
89
 
90
+ def quarantine_type
91
+ report['quarantine']['type'] if quarantine?
92
+ end
93
+
94
+ def quarantine_issue
95
+ report['quarantine']['issue'] if quarantine?
96
+ end
97
+
90
98
  private
91
99
 
92
100
  # rubocop:disable Metrics/AbcSize
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  module QA
5
- VERSION = '7.24.2'
5
+ VERSION = '7.24.3'
6
6
  end
7
7
  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.24.2
4
+ version: 7.24.3
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-03-03 00:00:00.000000000 Z
11
+ date: 2022-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control