gitlab-qa 8.3.1 → 8.4.1

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: de73ba2a256efc0b8a025d1b46c0299fe8f9906b2a1cb06672a11a04702be170
4
- data.tar.gz: e11f0ebabe74afe58b2c5b3621c1114d106aa3c8f828a64a506673b91604b77a
3
+ metadata.gz: a758eb621a80dc1dffc3abca040003057fdb20fc75c246c1ffdac09808c0a379
4
+ data.tar.gz: 0b753ad126a428621c735d2277cf2d21132de0969078255afce15affe4e8d7e6
5
5
  SHA512:
6
- metadata.gz: aa235104c7be55f5b0276133e4a04231939b5dcceaed4e1e454a84ac17539b15c15a9ac09182c9a1ecf3e199105f5b3556fd26d2120370a43e5cfc1777550617
7
- data.tar.gz: ccab7c480393683821ffff87aeee541474dcb126ab7a6d77dd24d890eec90a2c2924a178cb2d6dbec46898fdc9ad5f21a328190eb27389e4d6969140e00f481c
6
+ metadata.gz: db2058be2ccfb34ac72bb7a14cb453142a06d7a88c9084fe575d62425faac0ebda7beace5d45568a7945a3d3cad19939e0a8e60fa0b621b20c39424e01ef2dc9
7
+ data.tar.gz: 84fcf64c8afe5075d761f0f8116a8fbfb8944c3f801c145c003e13485110815bcbacda5c3ddf01d92e3353f280bdb2cf6cce4862519557912d0894d434f1cd77
@@ -2,6 +2,7 @@ ce:mtls:
2
2
  extends:
3
3
  - .rules:ce-never-when-triggered-by-feature-flag-definition-change
4
4
  - .test
5
+ - .high-capacity
5
6
  - .ce-variables
6
7
  - .rspec-report-opts
7
8
  variables:
@@ -11,6 +12,7 @@ ee:mtls:
11
12
  extends:
12
13
  - .rules:ee-never-when-triggered-by-feature-flag-definition-change
13
14
  - .test
15
+ - .high-capacity
14
16
  - .ee-variables
15
17
  - .rspec-report-opts
16
18
  variables:
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab-qa (8.3.1)
4
+ gitlab-qa (8.4.1)
5
5
  activesupport (~> 6.1)
6
6
  gitlab (~> 4.18.0)
7
7
  http (~> 5.0)
@@ -14,8 +14,14 @@ module Gitlab
14
14
 
15
15
  def initialize
16
16
  @docker = Docker::Engine.new(stream_output: true) # stream test output directly instead of through logger
17
- @volumes = {}
18
17
  @env = {}
18
+ @volumes = {}
19
+ @default_volumes = { '/var/run/docker.sock' => '/var/run/docker.sock' }
20
+ return if Runtime::Env.qa_knapsack_report_path.blank?
21
+
22
+ @default_volumes[Runtime::Env.qa_knapsack_report_path] = File.join(
23
+ Docker::Volumes::QA_CONTAINER_WORKDIR, 'knapsack'
24
+ )
19
25
  end
20
26
 
21
27
  def perform
@@ -59,12 +65,12 @@ module Gitlab
59
65
  command.env(key, value)
60
66
  end
61
67
 
62
- command.volume('/var/run/docker.sock', '/var/run/docker.sock')
63
- command.volume(File.join(Runtime::Env.host_artifacts_dir, name), File.join(Docker::Volumes::QA_CONTAINER_WORKDIR, 'tmp'))
68
+ command.volume(
69
+ File.join(Runtime::Env.host_artifacts_dir, name),
70
+ File.join(Docker::Volumes::QA_CONTAINER_WORKDIR, 'tmp')
71
+ )
64
72
 
65
- @volumes.to_h.each do |to, from|
66
- command.volume(to, from)
67
- end
73
+ volumes.to_h.merge(default_volumes).each { |to, from| command.volume(to, from) }
68
74
 
69
75
  command.name(name)
70
76
  end
@@ -73,6 +79,8 @@ module Gitlab
73
79
 
74
80
  private
75
81
 
82
+ attr_reader :default_volumes
83
+
76
84
  def docker_pull_qa_image_if_needed
77
85
  @docker.login(**release.login_params) if release.login_params
78
86
 
@@ -9,19 +9,19 @@ module Gitlab
9
9
  (-qa)?
10
10
  (:(?<tag>.+))?
11
11
  \z
12
- /xi
12
+ /xi.freeze
13
13
  CUSTOM_GITLAB_IMAGE_REGEX = %r{
14
14
  \A
15
15
  (?<image_without_tag>
16
- (?<registry>[^\/:]+(:(?<port>\d+))?)
17
- .+
16
+ (?<registry>[^/:]+(:(?<port>\d+))?)
17
+ (?<project>.+)
18
18
  gitlab-
19
19
  (?<edition>ce|ee)
20
20
  )
21
21
  (-qa)?
22
22
  (:(?<tag>.+))?
23
23
  \z
24
- }xi
24
+ }xi.freeze
25
25
 
26
26
  # Official dev tag example:
27
27
  # 12.5.4(-rc42)-ee
@@ -35,7 +35,7 @@ module Gitlab
35
35
  \A
36
36
  (?<version>\d+\.\d+.\d+(?:-rc\d+)?)-(?<edition>ce|ee)
37
37
  \z
38
- /xi
38
+ /xi.freeze
39
39
 
40
40
  # Dev tag example:
41
41
  # 12.1.201906121026-325a6632895.b340d0bd35d
@@ -47,9 +47,9 @@ module Gitlab
47
47
  # version
48
48
  DEV_TAG_REGEX = /
49
49
  \A
50
- (?<version>\d+\.\d+(.\d+)?)\.(?<timestamp>\d+)\-(?<gitlab_ref>[A-Za-z0-9]+)\.(?<omnibus_ref>[A-Za-z0-9]+)
50
+ (?<version>\d+\.\d+(.\d+)?)\.(?<timestamp>\d+)-(?<gitlab_ref>[A-Za-z0-9]+)\.(?<omnibus_ref>[A-Za-z0-9]+)
51
51
  \z
52
- /xi
52
+ /xi.freeze
53
53
 
54
54
  DEFAULT_TAG = 'latest'
55
55
  DEFAULT_CANONICAL_TAG = 'nightly'
@@ -63,8 +63,9 @@ module Gitlab
63
63
 
64
64
  def initialize(release)
65
65
  @release = release.to_s.downcase
66
+ return if valid?
66
67
 
67
- raise InvalidImageNameError, "The release image name '#{@release}' does not have the expected format." unless valid?
68
+ raise InvalidImageNameError, "The release image name '#{@release}' does not have the expected format."
68
69
  end
69
70
 
70
71
  def to_s
@@ -106,7 +107,14 @@ module Gitlab
106
107
  end
107
108
 
108
109
  def qa_image
109
- "#{image}-qa"
110
+ @qa_image ||= if omnibus_mirror?
111
+ omnibus_project = image.match(CUSTOM_GITLAB_IMAGE_REGEX)[:project]
112
+ gitlab_project = "/gitlab-org/gitlab/"
113
+
114
+ "#{image.gsub(omnibus_project, gitlab_project)}-qa"
115
+ else
116
+ "#{image}-qa"
117
+ end
110
118
  end
111
119
 
112
120
  def project_name
@@ -133,7 +141,7 @@ module Gitlab
133
141
  if dev_gitlab_org? && (match_data = tag.match(DEV_TAG_REGEX))
134
142
  "#{match_data[:version]}-#{match_data[:gitlab_ref]}"
135
143
  else
136
- tag.sub(/[-\.]([ce]e)(\.(\d+))?\z/, '-\1')
144
+ tag.sub(/[-.]([ce]e)(\.(\d+))?\z/, '-\1')
137
145
  end
138
146
  end
139
147
 
@@ -158,6 +166,7 @@ module Gitlab
158
166
 
159
167
  [Runtime::Env.gitlab_username, Runtime::Env.qa_access_token]
160
168
  end
169
+
161
170
  {
162
171
  username: username,
163
172
  password: password,
@@ -159,14 +159,14 @@ module Gitlab
159
159
  # Gets the name of the pipeline the test was run in, to be used as the key of a scoped label
160
160
  #
161
161
  # Tests can be run in several pipelines:
162
- # gitlab-qa, nightly, staging, canary, production, preprod, MRs, and the default branch (master/main)
162
+ # gitlab, nightly, staging, canary, production, preprod, MRs, and the default branch (master/main)
163
163
  #
164
164
  # Some of those run in their own project, so CI_PROJECT_NAME is the name we need. Those are:
165
165
  # nightly, staging, canary, production, and preprod
166
166
  #
167
- # MR, master/main, and gitlab-qa tests run in gitlab-qa, but we only want to report tests run on
167
+ # MR, master/main, and gitlab tests run in gitlab-qa, but we only want to report tests run on
168
168
  # master/main because the other pipelines will be monitored by the author of the MR that triggered them.
169
- # So we assume that we're reporting a master/main pipeline if the project name is 'gitlab-qa'.
169
+ # So we assume that we're reporting a master/main pipeline if the project name is 'gitlab'.
170
170
 
171
171
  @pipeline ||= Runtime::Env.pipeline_from_project_name
172
172
  end
@@ -81,6 +81,7 @@ module Gitlab
81
81
  'KNAPSACK_TEST_FILE_PATTERN' => :knapsack_test_file_pattern,
82
82
  'KNAPSACK_TEST_DIR' => :knapsack_test_dir,
83
83
  'QA_KNAPSACK_REPORT_GCS_CREDENTIALS' => :qa_knapsack_report_gcs_credentials,
84
+ 'QA_KNAPSACK_REPORT_PATH' => :qa_knapsack_report_path,
84
85
  'CI' => :ci,
85
86
  'CI_COMMIT_REF_NAME' => :ci_commit_ref_name,
86
87
  'CI_JOB_NAME' => :ci_job_name,
@@ -198,7 +199,7 @@ module Gitlab
198
199
  end
199
200
 
200
201
  def pipeline_from_project_name
201
- ci_project_name.to_s.start_with?('gitlab-qa') ? QA::Runtime::Env.default_branch : ci_project_name
202
+ ci_project_name.to_s.start_with?('gitlab') ? QA::Runtime::Env.default_branch : ci_project_name
202
203
  end
203
204
 
204
205
  def run_id
@@ -29,7 +29,6 @@ module Gitlab
29
29
  specs.suite = @suite
30
30
  specs.release = release
31
31
  specs.args = non_rspec_args.push(*args)
32
- specs.volumes[host_knapsack_report_path] = "/home/gitlab/qa/knapsack" if host_knapsack_report_path
33
32
  end
34
33
  end
35
34
 
@@ -40,10 +39,6 @@ module Gitlab
40
39
  def deployment_component
41
40
  raise NotImplementedError, 'Please define the Component for the deployment environment associated with this scenario.'
42
41
  end
43
-
44
- def host_knapsack_report_path
45
- ENV["QA_KNAPSACK_REPORT_PATH"]
46
- end
47
42
  end
48
43
  end
49
44
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  module QA
5
- VERSION = '8.3.1'
5
+ VERSION = '8.4.1'
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: 8.3.1
4
+ version: 8.4.1
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-08-10 00:00:00.000000000 Z
11
+ date: 2022-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control