gitlab-qa 14.7.0 → 14.8.0

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: aca8f96e30555fcac3d968c580f1393b87d2114a3616e8ab6dbb98f913f852d4
4
- data.tar.gz: 566a628d9587a7eeb6e6bcb530bed7170aa689aaadc50cecb28eaba17096e26e
3
+ metadata.gz: 3632783614831ceda0acb1c2fa312dcea081c8e878dfe2ce41bdb6f9ac70253b
4
+ data.tar.gz: 5af7c287d9820b050feb5944a9bf93561ef33442f0120bb71e6c7d0c33528ed3
5
5
  SHA512:
6
- metadata.gz: 4304f800c1430834f7b335ddae6627e51e6126d883359feefb2863662abe274c8b3de2fadca9328c6f6e9815aeb5df2798a1e839a24cf372ee66cdd5db9bea84
7
- data.tar.gz: 1a8325bf53f232d5db6292a63107b15f0acf19a04acb7dc0186474656dbd12744ab429030eb53a4e3f83acc5f9655a7159fc14d89cf81b373650b4045904e95c
6
+ metadata.gz: 46a5d0fd06137c2f41f8f504f1b3afea1e82ba010f86f704a5991f859c555a45e74e1ad6eaa320e916ed6c8fa9227ef20e47e7da03441f8bc3ec6e6ef2aa2352
7
+ data.tar.gz: 8ccadd90b943ca72ccd967fabfd70ae26a834ff8b949456eecdda333af3a7e6754b46a956e0dc029b7b70847c9134fb11dcd54a202299d64cbfe2902620c7ca1
data/.gitlab-ci.yml CHANGED
@@ -10,7 +10,7 @@
10
10
  include:
11
11
  - component: gitlab.com/gitlab-org/components/danger-review/danger-review@~latest
12
12
  inputs:
13
- job_image: "${CI_REGISTRY}/gitlab-org/gitlab-build-images/debian-bullseye-ruby-${RUBY_VERSION}:bundler-2.4"
13
+ job_image: "${CI_REGISTRY}/gitlab-org/gitlab-build-images/debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}:bundler-${BUNDLER_VERSION}"
14
14
  - component: gitlab.com/gitlab-org/components/gem-release/gem-release@~latest
15
15
 
16
16
  stages:
@@ -20,7 +20,7 @@ stages:
20
20
  - deploy
21
21
 
22
22
  default:
23
- image: ${CI_REGISTRY}/gitlab-org/gitlab-build-images/debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}:bundler-2.3
23
+ image: ${CI_REGISTRY}/gitlab-org/gitlab-build-images/debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}:bundler-${BUNDLER_VERSION}
24
24
  tags:
25
25
  - gitlab-org
26
26
  cache:
@@ -41,8 +41,10 @@ workflow:
41
41
  - if: '$CI_PIPELINE_SOURCE == "web"'
42
42
 
43
43
  variables:
44
- DEBIAN_VERSION: bullseye
45
- RUBY_VERSION: "3.0"
44
+ DEBIAN_VERSION: bookworm
45
+ DOCKER_VERSION: "24.0.5"
46
+ BUNDLER_VERSION: "2.5"
47
+ RUBY_VERSION: "3.1"
46
48
  BUNDLE_PATH: vendor
47
49
  BUNDLE_SILENCE_ROOT_WARNING: "true"
48
50
  BUNDLE_SUPPRESS_INSTALL_USING_MESSAGES: "true"
@@ -142,6 +144,8 @@ package-and-test:
142
144
  variables:
143
145
  - RUBY_VERSION
144
146
  - DEBIAN_VERSION
147
+ - DOCKER_VERSION
148
+ - BUNDLER_VERSION
145
149
  trigger:
146
150
  strategy: depend
147
151
  forward:
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab-qa (14.7.0)
4
+ gitlab-qa (14.8.0)
5
5
  activesupport (>= 6.1, < 7.2)
6
6
  gitlab (~> 4.19)
7
7
  http (~> 5.0)
@@ -3,6 +3,7 @@
3
3
  # rubocop:disable Metrics/AbcSize
4
4
 
5
5
  require 'securerandom'
6
+ require 'active_support/core_ext/array/grouping'
6
7
 
7
8
  module Gitlab
8
9
  module QA
@@ -23,7 +24,8 @@ module Gitlab
23
24
  :runner_network,
24
25
  :hostname,
25
26
  :additional_hosts,
26
- :retry_failed_specs
27
+ :retry_failed_specs,
28
+ :infer_qa_image_from_release
27
29
 
28
30
  def initialize
29
31
  @docker = Docker::Engine.new(stream_output: true) # stream test output directly instead of through logger
@@ -155,18 +157,14 @@ module Gitlab
155
157
  def args_with_flags(feature_flag_set, retry_process: false)
156
158
  return args if feature_flag_set.empty? && !retry_process
157
159
 
158
- run_args = args.dup
159
-
160
- if retry_process
161
- if run_args.include?("--")
162
- run_args.push("--only-failures")
163
- first_rspec_arg_index = run_args.index("--") + 1
164
- # if first arg after `--` is a not a flag, it's a specific spec/folder which needs to be removed
165
- run_args.delete_at(first_rspec_arg_index) unless run_args[first_rspec_arg_index].start_with?("--")
166
- else
167
- run_args.push("--", "--only-failures")
168
- end
169
- end
160
+ run_args = if !retry_process
161
+ args.dup
162
+ elsif args.include?("--")
163
+ qa_args, rspec_args = args.split("--")
164
+ [*qa_args, "--"] + args_without_spec_arguments(rspec_args).push("--only-failures")
165
+ else
166
+ args.dup.push("--", "--only-failures")
167
+ end
170
168
 
171
169
  return run_args if feature_flag_set.empty?
172
170
 
@@ -174,16 +172,29 @@ module Gitlab
174
172
  run_args.insert(1, *feature_flag_set)
175
173
  end
176
174
 
175
+ # Remove particular spec argument like specific spec/folder or specific tags
176
+ #
177
+ # @param [Array] rspec_args
178
+ # @return [Array]
179
+ def args_without_spec_arguments(rspec_args)
180
+ arg_pairs = rspec_args.each_with_object([]) do |arg, new_args|
181
+ next new_args.push([arg]) if new_args.last.nil? || arg.start_with?("--") || new_args.last.size == 2
182
+
183
+ new_args.last.push(arg)
184
+ end
185
+
186
+ arg_pairs.reject { |pair| pair.first == "--tag" || !pair.first.start_with?("--") }.flatten
187
+ end
188
+
177
189
  def skip_tests?
178
190
  Runtime::Scenario.attributes.include?(:run_tests) && !Runtime::Scenario.run_tests
179
191
  end
180
192
 
181
193
  def qa_image
182
- if Runtime::Scenario.attributes.include?(:qa_image)
183
- Runtime::Scenario.qa_image
184
- else
185
- "#{release.qa_image}:#{release.qa_tag}"
186
- end
194
+ infered_qa_image = "#{release.qa_image}:#{release.qa_tag}"
195
+ return infered_qa_image if infer_qa_image_from_release || !Runtime::Scenario.attributes.include?(:qa_image)
196
+
197
+ Runtime::Scenario.qa_image
187
198
  end
188
199
 
189
200
  # Adds volumes to the volumes hash if the relevant host paths exist
@@ -106,6 +106,7 @@ module Gitlab
106
106
  'CI_NODE_TOTAL' => :ci_node_total,
107
107
  'CI_PROJECT_NAME' => :ci_project_name,
108
108
  'CI_PROJECT_PATH' => :ci_project_path,
109
+ 'CI_PROJECT_PATH_SLUG' => :ci_project_path_slug,
109
110
  'CI_PIPELINE_SOURCE' => :ci_pipeline_source,
110
111
  'CI_PIPELINE_ID' => :ci_pipeline_id,
111
112
  'CI_PIPELINE_URL' => :ci_pipeline_url,
@@ -114,6 +114,8 @@ module Gitlab
114
114
  # do not generate reports and metrics artifacts for non release runs or retry failures
115
115
  specs.env = { 'QA_GENERATE_ALLURE_REPORT' => false, 'QA_SAVE_TEST_METRICS' => false }
116
116
  specs.retry_failed_specs = false
117
+ # if qa-image was set explicitly, make sure it is not used on initial run for release
118
+ specs.infer_qa_image_from_release = true
117
119
  end
118
120
  rescue Support::ShellCommand::StatusError => e
119
121
  if release == current_release # only fail on current release
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Gitlab
4
4
  module QA
5
- VERSION = '14.7.0'
5
+ VERSION = '14.8.0'
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: 14.7.0
4
+ version: 14.8.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: 2024-04-11 00:00:00.000000000 Z
11
+ date: 2024-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control