gitlab-qa 6.22.1 → 6.23.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: 8bc00da4cf9e49638677be4e367af1f998b99d096ff7fb777175a66fe06f8b8d
4
- data.tar.gz: f16010de2eea8d2efa1e8ee96280f9c5bff569696b19d4b93095d3c604c45a27
3
+ metadata.gz: be38f6268c3a91ecdeee390c040f658e07194eb1e3d5f99694d50c68540a5461
4
+ data.tar.gz: bb9fd66f54e18792a9d5a8bb445fefe7cc63d824ef445b61b60f2c7ef378422f
5
5
  SHA512:
6
- metadata.gz: d61d4c983f8be4ad97ca421f3bfcfc7797c75cdf39affea49a0c58ef49ac5d8aebf7eb2c4d23d24c8f04d6b623ffb17b5d35eb56f64c45c7026706f8666f17a1
7
- data.tar.gz: f5efe84a3f6750872fc3069a88b1ab7a5afb68c2429f7c4e81e9d4984054ba0400f318b4896664c86a1101ed102b7eb2d45de63ff24bdfdce7cffaecb5516ba5
6
+ metadata.gz: 54f0d06a51b27c5e4ea0c1352ca01f634d8e7bc00475345c87650beaf783e7f4dcc4cc53828d54e75b01ada167f002c1a51451147afac400a27ae9132008ee30
7
+ data.tar.gz: a651ecb24eb49d6e3997c5c6abfef1048900f760d81374e35b9104b05b25210f94c0ecf4de65e5e79c710ca7552153da7aab36e765b5e1acd9c829cf6feb36c1
data/.gitlab-ci.yml CHANGED
@@ -12,13 +12,13 @@ default:
12
12
  cache:
13
13
  key:
14
14
  files:
15
- - Gemfile
15
+ - Gemfile.lock
16
16
  - gitlab-qa.gemspec
17
17
  paths:
18
18
  - vendor/ruby
19
19
  before_script:
20
20
  - bundle version
21
- - bundle install --clean --jobs=$(nproc) --path=vendor --retry=3 --quiet && bundle check
21
+ - bundle install --jobs=$(nproc) --path=vendor --retry=3 --quiet && bundle check
22
22
  - if [ -n "$TRIGGERED_USER" ] && [ -n "$TRIGGER_SOURCE" ]; then
23
23
  echo "Pipeline triggered by $TRIGGERED_USER at $TRIGGER_SOURCE";
24
24
  fi
@@ -143,6 +143,40 @@ To run EE tests, the `EE_LICENSE` environment variable needs to be set:
143
143
 
144
144
  `$ export EE_LICENSE=$(cat /path/to/GitLab.gitlab_license)`
145
145
 
146
+ ## Specifying the GitLab QA image to use
147
+
148
+ By default, `gitlab-qa` infers the QA image to use based on the GitLab image.
149
+ For instance, if you run the following:
150
+
151
+ ```
152
+ $ gitlab-qa Test::Instance::Image gitlab/gitlab-ee:12.4.0-ee.0
153
+ ```
154
+
155
+ Then, `gitlab-qa` would infer `gitlab/gitlab-ee-qa:12.4.0-ee.0` as the QA image
156
+ based on the GitLab image (note the `-qa` suffix in the image name).
157
+
158
+ In some cases, you'll want to use a specific QA image instead of letting
159
+ `gitlab-qa` infer the QA image name from the GitLab image. Such cases can be
160
+ when you're doing local debugging/testing and you want to control the QA image
161
+ name, or in the CI where the QA image might be built by a project (e.g.
162
+ `gitlab-org/gitlab`, and the GitLab image might be built by another project
163
+ (e.g. `gitlab-org/omnibus-gitlab-mirror`).
164
+
165
+ To specify the QA image to use, pass the `--qa-image QA_IMAGE` option,
166
+ as follows:
167
+
168
+ ```
169
+ $ gitlab-qa Test::Instance::Image --qa-image registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:branch-name EE
170
+ ```
171
+
172
+ Additionally, setting the `$QA_IMAGE` environment variable achieve the same result,
173
+ without needing to pass the `--qa-image` option:
174
+
175
+ ```
176
+ $ export QA_IMAGE="registry.gitlab.com/gitlab-org/gitlab/gitlab-ee-qa:branch-name"
177
+ $ gitlab-qa Test::Instance::Image EE
178
+ ```
179
+
146
180
  ## Running a specific test (or set of tests)
147
181
 
148
182
  In most of the scenarios listed below, if you don't want to run all the tests
@@ -23,7 +23,7 @@ module Gitlab
23
23
 
24
24
  @docker.login(**release.login_params) if release.login_params
25
25
 
26
- @docker.pull(release.qa_image, release.qa_tag) unless Runtime::Env.skip_pull?
26
+ @docker.pull(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(release.qa_image, release.qa_tag, suite, *args_with_flags(args, feature_flag_set)) do |command|
46
+ @docker.run(qa_image, nil, 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|
@@ -76,6 +76,14 @@ module Gitlab
76
76
  def skip_tests?
77
77
  Runtime::Scenario.attributes.include?(:run_tests) && !Runtime::Scenario.run_tests
78
78
  end
79
+
80
+ def qa_image
81
+ if Runtime::Scenario.attributes.include?(:qa_image)
82
+ Runtime::Scenario.qa_image
83
+ else
84
+ "#{release.qa_image}:#{release.qa_tag}"
85
+ end
86
+ end
79
87
  end
80
88
  end
81
89
  end
@@ -13,15 +13,15 @@ module Gitlab
13
13
  Docker::Command.execute(%(login --username "#{username}" --password "#{password}" #{registry}), mask_secrets: password)
14
14
  end
15
15
 
16
- def pull(image, tag)
17
- Docker::Command.execute("pull #{image}:#{tag}")
16
+ def pull(image, tag = nil)
17
+ Docker::Command.execute("pull #{full_image_name(image, tag)}")
18
18
  end
19
19
 
20
20
  def run(image, tag, *args)
21
21
  Docker::Command.new('run').tap do |command|
22
22
  yield command if block_given?
23
23
 
24
- command << "#{image}:#{tag}"
24
+ command << full_image_name(image, tag)
25
25
  command << args if args.any?
26
26
 
27
27
  command.execute!
@@ -43,7 +43,7 @@ module Gitlab
43
43
  end
44
44
 
45
45
  def read_file(image, tag, path, &block)
46
- cat_file = "run --rm --entrypoint /bin/cat #{image}:#{tag} #{path}"
46
+ cat_file = "run --rm --entrypoint /bin/cat #{full_image_name(image, tag)} #{path}"
47
47
  Docker::Command.execute(cat_file, &block)
48
48
  end
49
49
 
@@ -94,6 +94,12 @@ module Gitlab
94
94
  def ps(name = nil)
95
95
  Docker::Command.execute(['ps', name].compact.join(' '))
96
96
  end
97
+
98
+ private
99
+
100
+ def full_image_name(image, tag)
101
+ [image, tag].compact.join(':')
102
+ end
97
103
  end
98
104
  end
99
105
  end
@@ -7,6 +7,7 @@ module Gitlab
7
7
  def self.run(args)
8
8
  Runtime::Scenario.define(:teardown, true)
9
9
  Runtime::Scenario.define(:run_tests, true)
10
+ Runtime::Scenario.define(:qa_image, Runtime::Env.qa_image) if Runtime::Env.qa_image
10
11
 
11
12
  @options = OptionParser.new do |opts|
12
13
  opts.banner = 'Usage: gitlab-qa [options] Scenario URL [[--] path] [rspec_options]'
@@ -20,6 +21,10 @@ module Gitlab
20
21
  Runtime::Scenario.define(:teardown, false)
21
22
  end
22
23
 
24
+ opts.on('--qa-image QA_IMAGE', String, 'Specifies a QA image to be used instead of inferring it from the GitLab image. See Gitlab::QA::Release#qa_image') do |value|
25
+ Runtime::Scenario.define(:qa_image, value)
26
+ end
27
+
23
28
  opts.on_tail('-v', '--version', 'Show the version') do
24
29
  require 'gitlab/qa/version'
25
30
  puts "#{$PROGRAM_NAME} : #{VERSION}"
@@ -10,6 +10,7 @@ module Gitlab
10
10
  # These variables should be listed in /docs/what_tests_can_be_run.md#supported-gitlab-environment-variables
11
11
  # unless they're defined elsewhere (e.g.: https://docs.gitlab.com/ee/ci/variables/predefined_variables.html)
12
12
  ENV_VARIABLES = {
13
+ 'QA_IMAGE' => :qa_image,
13
14
  'QA_REMOTE_GRID' => :remote_grid,
14
15
  'QA_REMOTE_GRID_USERNAME' => :remote_grid_username,
15
16
  'QA_REMOTE_GRID_ACCESS_KEY' => :remote_grid_access_key,
@@ -1,5 +1,5 @@
1
1
  module Gitlab
2
2
  module QA
3
- VERSION = '6.22.1'.freeze
3
+ VERSION = '6.23.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: 6.22.1
4
+ version: 6.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grzegorz Bizon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-24 00:00:00.000000000 Z
11
+ date: 2021-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: climate_control